C# Класс PayPal.Api.Invoice

Detailed invoice information.

See PayPal Developer documentation for more information.

Наследование: PayPalResource
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
Cancel ( APIContext apiContext, CancelNotification cancelNotification ) : void

Cancels a sent invoice, by ID, and, optionally, sends a notification about the cancellation to the payer, merchant, and Cc: emails.

Cancel ( APIContext apiContext, string invoiceId, CancelNotification cancelNotification ) : void

Cancels an invoice.

Create ( APIContext apiContext ) : Invoice
Create ( APIContext apiContext, Invoice invoice ) : Invoice

Creates a draft invoice. You can optionally create an invoice [template](/docs/api/invoicing/#templates). Then, when you create an invoice from a template, the invoice is populated with the predefined data that the source template contains. To move the invoice from a draft to payable state, you must [send the invoice](/docs/api/invoicing/#invoices_send). In the JSON request body, include invoice details including merchant information. The `invoice` object must include an `items` array.

Note: The merchant specified in an invoice must have a PayPal account in good standing.

Delete ( APIContext apiContext ) : void

Deletes a draft invoice, by ID. Note that this call works for invoices in the draft state only. For invoices that have already been sent, you can [cancel the invoice](/docs/api/invoicing/#invoices_cancel). After you delete a draft invoice, you can no longer use it or show its details. However, you can reuse its invoice number.

Delete ( APIContext apiContext, string invoiceId ) : void

Deletes a draft invoice, by ID. Note that this call works for invoices in the draft state only. For invoices that have already been sent, you can [cancel the invoice](/docs/api/invoicing/#invoices_cancel). After you delete a draft invoice, you can no longer use it or show its details. However, you can reuse its invoice number.

DeleteExternalPayment ( APIContext apiContext, string invoiceId, string transactionId ) : void

Deletes an external payment, by invoice ID and transaction ID.

DeleteExternalRefund ( APIContext apiContext, string invoiceId, string transactionId ) : void

Deletes an external refund, by invoice ID and transaction ID.

GenerateNumber ( APIContext apiContext ) : InvoiceNumber

Generates the next invoice number that is available to the user.

Get ( APIContext apiContext, string invoiceId ) : Invoice

Shows details for a specified invoice, by ID.

GetAll ( APIContext apiContext, int page = 1, int pageSize = 20, bool totalCountRequired = false ) : PayPal.Api.InvoiceSearchResponse

Lists merchant invoices. Optionally, you can specify one or more query parameters to filter the response.

QrCode ( APIContext apiContext, string invoiceId, int width = 500, int height = 500, string action = "pay" ) : Image

Generates a QR code for an invoice, by ID.

The QR code is a PNG image in [Base64-encoded](https://www.base64encode.org/) format that corresponds to the invoice ID. You can generate a QR code for an invoice and add it to a paper or PDF invoice. When a customer uses their mobile device to scan the QR code, he or she is redirected to the PayPal mobile payment flow where he or she can pay online with PayPal or a credit card.

Before you get a QR code, you must:

  1. [Create an invoice](#invoices_create). Specify `[email protected]` as the recipient email address in the `billing_info` object. Use a customer email address only if you want to email the invoice.

  2. [Send an invoice](#invoices_send) to move the invoice from a draft to payable state. If you specify `[email protected]` as the recipient email address, the invoice is not emailed.

RecordPayment ( APIContext apiContext, PaymentDetail paymentDetail ) : void

Marks the status of a specified invoice, by ID, as paid. Include a payment detail object that defines the payment method and other details in the JSON request body.

RecordPayment ( APIContext apiContext, string invoiceId, PaymentDetail paymentDetail ) : void

Mark the status of the invoice as paid.

RecordRefund ( APIContext apiContext, RefundDetail refundDetail ) : void

Marks the status of an invoice, by ID, as refunded. In the JSON request body, include a payment detail object that defines the payment method and other details.

RecordRefund ( APIContext apiContext, string invoiceId, RefundDetail refundDetail ) : void

Mark the status of the invoice as refunded.

Remind ( APIContext apiContext, Notification notification ) : void

Sends a reminder about an invoice, by ID, to a customer. In the JSON request body, include a `notification` object that defines the subject of the reminder and other details.

Remind ( APIContext apiContext, string invoiceId, Notification notification ) : void

Reminds the payer to pay the invoice.

Search ( APIContext apiContext, Search search ) : PayPal.Api.InvoiceSearchResponse

Lists invoices that match search criteria. In the JSON request body, include a `search` object that specifies the search criteria.

Send ( APIContext apiContext, bool notifyMerchant = true ) : void

Sends an invoice, by ID, to a customer.

Note: After you send an invoice, you cannot resend it.

Optionally, set the `notify_merchant` query parameter to also send the merchant an invoice update notification. Default is `true`.

Send ( APIContext apiContext, string invoiceId, bool notifyMerchant = true ) : void

Sends a legitimate invoice to the payer.

Update ( APIContext apiContext, Invoice invoice, bool notifyMerchant = true ) : Invoice

Full update of the invoice resource for the given identifier.

Update ( APIContext apiContext, bool notifyMerchant = true ) : Invoice

Fully updates an invoice, by ID. In the JSON request body, include a complete `invoice` object. This call does not support partial updates.

Описание методов

Cancel() публичный Метод

Cancels a sent invoice, by ID, and, optionally, sends a notification about the cancellation to the payer, merchant, and Cc: emails.
public Cancel ( APIContext apiContext, CancelNotification cancelNotification ) : void
apiContext APIContext APIContext used for the API call.
cancelNotification CancelNotification CancelNotification
Результат void

Cancel() публичный статический Метод

Cancels an invoice.
public static Cancel ( APIContext apiContext, string invoiceId, CancelNotification cancelNotification ) : void
apiContext APIContext APIContext used for the API call.
invoiceId string ID of the invoice to cancel.
cancelNotification CancelNotification CancelNotification
Результат void

Create() публичный Метод

public Create ( APIContext apiContext ) : Invoice
apiContext APIContext APIContext used for the API call.
Результат Invoice

Create() публичный статический Метод

Creates a draft invoice. You can optionally create an invoice [template](/docs/api/invoicing/#templates). Then, when you create an invoice from a template, the invoice is populated with the predefined data that the source template contains. To move the invoice from a draft to payable state, you must [send the invoice](/docs/api/invoicing/#invoices_send). In the JSON request body, include invoice details including merchant information. The `invoice` object must include an `items` array.
Note: The merchant specified in an invoice must have a PayPal account in good standing.
public static Create ( APIContext apiContext, Invoice invoice ) : Invoice
apiContext APIContext APIContext used for the API call.
invoice Invoice Invoice object to be used for creating the PayPal resource.
Результат Invoice

Delete() публичный Метод

Deletes a draft invoice, by ID. Note that this call works for invoices in the draft state only. For invoices that have already been sent, you can [cancel the invoice](/docs/api/invoicing/#invoices_cancel). After you delete a draft invoice, you can no longer use it or show its details. However, you can reuse its invoice number.
public Delete ( APIContext apiContext ) : void
apiContext APIContext APIContext used for the API call.
Результат void

Delete() публичный статический Метод

Deletes a draft invoice, by ID. Note that this call works for invoices in the draft state only. For invoices that have already been sent, you can [cancel the invoice](/docs/api/invoicing/#invoices_cancel). After you delete a draft invoice, you can no longer use it or show its details. However, you can reuse its invoice number.
public static Delete ( APIContext apiContext, string invoiceId ) : void
apiContext APIContext APIContext used for the API call.
invoiceId string The ID of the invoice to delete.
Результат void

DeleteExternalPayment() публичный статический Метод

Deletes an external payment, by invoice ID and transaction ID.
public static DeleteExternalPayment ( APIContext apiContext, string invoiceId, string transactionId ) : void
apiContext APIContext APIContext used for the API call.
invoiceId string The ID of the invoice from which to delete a payment transaction.
transactionId string The ID of the payment transaction to delete.
Результат void

DeleteExternalRefund() публичный статический Метод

Deletes an external refund, by invoice ID and transaction ID.
public static DeleteExternalRefund ( APIContext apiContext, string invoiceId, string transactionId ) : void
apiContext APIContext APIContext used for the API call.
invoiceId string The ID of the invoice from which to delete the refund transaction.
transactionId string The ID of the refund transaction to delete.
Результат void

GenerateNumber() публичный Метод

Generates the next invoice number that is available to the user.
public GenerateNumber ( APIContext apiContext ) : InvoiceNumber
apiContext APIContext APIContext used for the API call.
Результат InvoiceNumber

Get() публичный статический Метод

Shows details for a specified invoice, by ID.
public static Get ( APIContext apiContext, string invoiceId ) : Invoice
apiContext APIContext APIContext used for the API call.
invoiceId string The ID of the invoice for which to show details.
Результат Invoice

GetAll() публичный статический Метод

Lists merchant invoices. Optionally, you can specify one or more query parameters to filter the response.
public static GetAll ( APIContext apiContext, int page = 1, int pageSize = 20, bool totalCountRequired = false ) : PayPal.Api.InvoiceSearchResponse
apiContext APIContext APIContext used for the API call.
page int A *zero-relative* index of the list of merchant invoices.
pageSize int The number of invoices to list beginning with the specified `page`.
totalCountRequired bool Indicates whether the total count appears in the response. Default is `false`.
Результат PayPal.Api.InvoiceSearchResponse

QrCode() публичный статический Метод

Generates a QR code for an invoice, by ID.

The QR code is a PNG image in [Base64-encoded](https://www.base64encode.org/) format that corresponds to the invoice ID. You can generate a QR code for an invoice and add it to a paper or PDF invoice. When a customer uses their mobile device to scan the QR code, he or she is redirected to the PayPal mobile payment flow where he or she can pay online with PayPal or a credit card.

Before you get a QR code, you must:
  1. [Create an invoice](#invoices_create). Specify `[email protected]` as the recipient email address in the `billing_info` object. Use a customer email address only if you want to email the invoice.

  2. [Send an invoice](#invoices_send) to move the invoice from a draft to payable state. If you specify `[email protected]` as the recipient email address, the invoice is not emailed.

public static QrCode ( APIContext apiContext, string invoiceId, int width = 500, int height = 500, string action = "pay" ) : Image
apiContext APIContext APIContext used for the API call.
invoiceId string The ID of the invoice for which to generate a QR code.
width int The width, in pixels, of the QR code image. Valid value is from 150 to 500. Default is 500.
height int The height, in pixels, of the QR code image. Valid value is from 150 to 500. Default is 500.
action string The type of URL for which to generate a QR code. Default is `pay` and is the only supported value.
Результат Image

RecordPayment() публичный Метод

Marks the status of a specified invoice, by ID, as paid. Include a payment detail object that defines the payment method and other details in the JSON request body.
public RecordPayment ( APIContext apiContext, PaymentDetail paymentDetail ) : void
apiContext APIContext APIContext used for the API call.
paymentDetail PaymentDetail PaymentDetail
Результат void

RecordPayment() публичный статический Метод

Mark the status of the invoice as paid.
public static RecordPayment ( APIContext apiContext, string invoiceId, PaymentDetail paymentDetail ) : void
apiContext APIContext APIContext used for the API call.
invoiceId string ID of the invoice to mark as paid.
paymentDetail PaymentDetail PaymentDetail
Результат void

RecordRefund() публичный Метод

Marks the status of an invoice, by ID, as refunded. In the JSON request body, include a payment detail object that defines the payment method and other details.
public RecordRefund ( APIContext apiContext, RefundDetail refundDetail ) : void
apiContext APIContext APIContext used for the API call.
refundDetail RefundDetail RefundDetail
Результат void

RecordRefund() публичный статический Метод

Mark the status of the invoice as refunded.
public static RecordRefund ( APIContext apiContext, string invoiceId, RefundDetail refundDetail ) : void
apiContext APIContext APIContext used for the API call.
invoiceId string ID fo the invoice to mark as refunded.
refundDetail RefundDetail RefundDetail
Результат void

Remind() публичный Метод

Sends a reminder about an invoice, by ID, to a customer. In the JSON request body, include a `notification` object that defines the subject of the reminder and other details.
public Remind ( APIContext apiContext, Notification notification ) : void
apiContext APIContext APIContext used for the API call.
notification Notification Notification
Результат void

Remind() публичный статический Метод

Reminds the payer to pay the invoice.
public static Remind ( APIContext apiContext, string invoiceId, Notification notification ) : void
apiContext APIContext APIContext used for the API call.
invoiceId string ID of the invoice the payer will be reminded to pay.
notification Notification Notification
Результат void

Search() публичный статический Метод

Lists invoices that match search criteria. In the JSON request body, include a `search` object that specifies the search criteria.
public static Search ( APIContext apiContext, Search search ) : PayPal.Api.InvoiceSearchResponse
apiContext APIContext APIContext used for the API call.
search Search Search
Результат PayPal.Api.InvoiceSearchResponse

Send() публичный Метод

Sends an invoice, by ID, to a customer.
Note: After you send an invoice, you cannot resend it.

Optionally, set the `notify_merchant` query parameter to also send the merchant an invoice update notification. Default is `true`.
public Send ( APIContext apiContext, bool notifyMerchant = true ) : void
apiContext APIContext APIContext used for the API call.
notifyMerchant bool Indicates whether to send the invoice update notification to the merchant. Default is `true`.
Результат void

Send() публичный статический Метод

Sends a legitimate invoice to the payer.
public static Send ( APIContext apiContext, string invoiceId, bool notifyMerchant = true ) : void
apiContext APIContext APIContext used for the API call.
invoiceId string ID of the invoice to send.
notifyMerchant bool Specifies if the invoice send notification is needed for merchant
Результат void

Update() публичный статический Метод

Full update of the invoice resource for the given identifier.
public static Update ( APIContext apiContext, Invoice invoice, bool notifyMerchant = true ) : Invoice
apiContext APIContext APIContext used for the API call.
invoice Invoice Invoice object to update.
notifyMerchant bool Specifies if the invoice update notification is needed for merchant
Результат Invoice

Update() публичный Метод

Fully updates an invoice, by ID. In the JSON request body, include a complete `invoice` object. This call does not support partial updates.
public Update ( APIContext apiContext, bool notifyMerchant = true ) : Invoice
apiContext APIContext APIContext used for the API call.
notifyMerchant bool Indicates whether to send the invoice update notification to the merchant. Default is `true`.
Результат Invoice