Invoicing API

Use the Invoicing API to create, send, and manage invoices. You can also use the API or webhooks to track invoice payments. When you send an invoice to a customer, the invoice moves from draft to payable state. PayPal then emails the customer a link to the invoice on the PayPal website. Customers with a PayPal account can log in and pay the invoice with PayPal. Alternatively, customers can pay as a guest with a debit card or credit card. For more information, see Invoicing Overview and the Invoicing Integration Guide.

Invoices (resource group)

Use the /invoices resource to create, update, and send invoices and invoice reminders. To manage invoices, you can also list invoices, show details for invoices, delete draft invoices, and cancel sent invoices. You can also mark invoices as fully or partially paid, or as refunded. Lastly, you can create QR codes for invoices that can be scanned, viewed, and paid by a mobile phone.

Create draft invoice

POST /v1/invoicing/invoices
Creates a draft invoice. To move the invoice from a draft to payable state, you must send the invoice.

In the JSON request body, include invoice details including merchant information. The invoice object must include an items array.
Note: The merchant that you specify in an invoice must have a PayPal account in good standing.
.

Request body

  • number

    string

    The invoice number. If you omit this value, the default is the number that the API automatically increments from the last number.

    Maximum length: 25.

  • merchant_info

    object

    required

    The merchant information, such as business name, email, address, and so on.
  • billing_info

    array (contains the billing_info object)

    An array of billing information for the invoice recipient.
    Note: This value is an array with only one element.
  • shipping_info

    object

    The shipping information for the recipient of the invoice.
  • cc_info

    array (contains the participant object)

    An array of email addresses to which PayPal sends a copy of the invoice.
  • items

    array (contains the invoice_item object)

    An array of invoice line item information.
  • invoice_date

    string

    The invoice date as specified by the sender, in Internet date and time format.
  • payment_term

    object

    The payment due date of the invoice. If you include due_date, the term_type value is ignored.
  • reference

    string

    The reference data, such as PO number.

    Maximum length: 60.

  • discount

    object

    The invoice level discount, as a percent or an amount value.
  • shipping_cost

    object

    The shipping amount, as a percent or an amount value.
  • custom

    object

    The custom amount to apply to an invoice. If you include a label, you must include a custom amount.
  • allow_partial_payment

    boolean

    Indicates whether the invoice allows a partial payment. If false, the invoice must be paid in full. If true, the invoice allows partial payments.
    Note: This feature is not available for merchants in India, Brazil, or Israel.
  • minimum_amount_due

    object

    The minimum amount allowed for a partial payment. Valid only if allow_partial_payment is true.
  • tax_calculated_after_discount

    boolean

    Indicates whether the tax is calculated before or after a discount. If false, the tax is calculated before a discount. If true, the tax is calculated after a discount.
  • tax_inclusive

    boolean

    Indicates whether the unit price includes tax.
  • terms

    string

    The general terms of the invoice.

    Maximum length: 4000.

  • note

    string

    A note to the invoice recipient. The note also appears on the invoice notification email.

    Maximum length: 4000.

  • merchant_memo

    string

    A private bookkeeping memo for the merchant.

    Maximum length: 500.

  • logo_url

    string

    The full URL to an external logo image. The logo must not be larger than 250 pixels wide by 90 pixels high. The logo must be stored on a secure server.

    Maximum length: 4000.

  • allow_tip

    boolean

    Indicates whether the invoice enables the customer to enter a tip amount during payment. If true, the invoice shows a tip amount field so that the customer can enter a tip amount. If false, the invoice does not show a tip amount field.
    Note: This feature is not available for merchants in Hong Kong, Taiwan, India, or Japan.
  • template_id

    string

    This value is only used to determine the layout to display on the create or edit invoice experience, such as which fields to show and hide. It does not impact the view of the invoice that the customer receives.
    Note: If you are just using the Invoicing APIs to create and send invoices, leave this field blank. The template_id is only needed if you use the Invoicing API to build a full invoicing solution that includes templates.

    Default: PayPal system template.

SDK samples: C#, JAVA, Node.js, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "merchant_info": {
    "email": "merchant@example.com",
    "first_name": "David",
    "last_name": "Larusso",
    "business_name": "Mitchell & Murray",
    "phone": {
      "country_code": "001",
      "national_number": "4085551234"
    },
    "address": {
      "line1": "1234 First Street",
      "city": "Anytown",
      "state": "CA",
      "postal_code": "98765",
      "country_code": "US"
    }
  },
  "billing_info": [
    {
      "email": "bill-me@example.com",
      "first_name": "Stephanie",
      "last_name": "Meyers"
    }
  ],
  "shipping_info": {
    "first_name": "Stephanie",
    "last_name": "Meyers",
    "address": {
      "line1": "1234 Main Street",
      "city": "Anytown",
      "state": "CA",
      "postal_code": "98765",
      "country_code": "US"
    }
  },
  "items": [
    {
      "name": "Zoom System wireless headphones",
      "quantity": 2,
      "unit_price": {
        "currency": "USD",
        "value": "120"
      },
      "tax": {
        "name": "Tax",
        "percent": 8
      }
    },
    {
      "name": "Bluetooth speaker",
      "quantity": 1,
      "unit_price": {
        "currency": "USD",
        "value": "145"
      },
      "tax": {
        "name": "Tax",
        "percent": 8
      }
    }
  ],
  "discount": {
    "percent": 1
  },
  "shipping_cost": {
    "amount": {
      "currency": "USD",
      "value": "10"
    }
  },
  "note": "Thank you for your business.",
  "terms": "No refunds after 30 days."
}'

Response

A successful request returns the HTTP 201 Created status code and a JSON response body that shows invoice details.
  • id

    string

    The ID of the invoice.

    Read only.

  • number

    string

    The invoice number. If you omit this value, the default is the number that the API automatically increments from the last number.

    Maximum length: 25.

  • status

    enum

    The invoice status. When you search for invoices, you must specify this value as an array. For example, "status": ["REFUNDED"]. The status indicates the phase of an invoice in its lifecycle. The status also indicates whether the invoice is unpaid, partially paid, fully paid, partially refunded, or fully refunded. An invoice payment can be either:
    • Connected to an invoice. The customer clicks Pay on the invoice to make a payment. The payment is automatically recorded.
    • Disconnected from an invoice. The customer pays by check, wire transfer, or another method. The merchant manually records the payment.

    Similarly, an invoice refund can be disconnected from an invoice. The merchant refunds a payment by check, wire transfer, or another method and manually records the refund. This table lists the typical order through which an invoice moves through status values:
    StatusOccurs when
    DRAFTA merchant creates a draft invoice.
    Note: A customer cannot pay an invoice with this status. A customer cannot pay an invoice until it has a status of SENT or UNPAID.
    UNPAIDA merchant chooses to suppress the PayPal email notification when he or she sends the invoice through the API or the Create Invoice page, and then manually sends the invoice link in his or her own email.
    To send an invoice without email notification, the merchant either:
    • Sets the notify_merchant and notify_customer query parameters to false when he or she sends the invoice.
    • Selects Share link myself from the Send menu when he or she sends the invoice through the web UI Create Invoice page.
    SENTA merchant accepts the default PayPal email notification when he or she sends the invoice through the API or the Create Invoice page. PayPal automatically emails the invoice to the customer and a Pay button appears on the invoice, which enables the customer to pay the invoice. In a web app, the invoice appears as Unpaid (sent).
    SCHEDULEDA merchant schedules an invoice to send on a future date. At 07:00 on that date in the preferred time zone of the merchant's PayPal account profile, PayPal emails an invoice notification to the merchant and the customer, adds an online payment button to the customer’s view of the invoice, and updates the invoice status to SENT.
    PARTIALLY_PAIDA customer makes a partial payment for the invoice through one of these methods:
    PAYMENT_PENDINGA customer pays an invoice but the payment is pending for one of these reasons:
    • The payment is an uncleared eCheck.
    • The merchant must either accept the payment before it clears or deny the payment.
    • PayPal risk is reviewing the payment.
    Note: Most payments never go into a payment-pending state.
    PAIDA customer fully pays the invoice through one of these methods:
    MARKED_AS_PAIDA customer makes a disconnected payment for the balance of the invoice. The merchant manually marks the invoice as paid.
    CANCELLEDA merchant or customer cancels a sent invoice. You can cancel an invoice in SENT or UNPAID status.
    REFUNDEDA merchant fully refunds an invoice through one these methods:
    PARTIALLY_REFUNDEDA merchant partially refunds an invoice through one or both of these methods:
    MARKED_AS_REFUNDEDA merchant makes a disconnected refund, such as a check payment, for the invoice balance and manually marks the invoice as fully refunded.
    Note: A merchant can only mark a marked-as-paid invoice as refunded.

    Read only.

    Possible values: DRAFT, UNPAID, SENT, SCHEDULED, PARTIALLY_PAID, PAYMENT_PENDING, PAID, MARKED_AS_PAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, MARKED_AS_REFUNDED.

  • merchant_info

    object

    The merchant information, such as business name, email, address, and so on.
  • billing_info

    array (contains the billing_info object)

    An array of billing information for the invoice recipient.
    Note: This value is an array with only one element.
  • shipping_info

    object

    The shipping information for the recipient of the invoice.
  • cc_info

    array (contains the participant object)

    An array of email addresses to which PayPal sends a copy of the invoice.
  • items

    array (contains the invoice_item object)

    An array of invoice line item information.
  • invoice_date

    string

    The invoice date as specified by the sender, in Internet date and time format.
  • payment_term

    object

    The payment due date of the invoice. If you include due_date, the term_type value is ignored.
  • reference

    string

    The reference data, such as PO number.

    Maximum length: 60.

  • discount

    object

    The invoice level discount, as a percent or an amount value.
  • shipping_cost

    object

    The shipping amount, as a percent or an amount value.
  • custom

    object

    The custom amount to apply to an invoice. If you include a label, you must include a custom amount.
  • allow_partial_payment

    boolean

    Indicates whether the invoice allows a partial payment. If false, the invoice must be paid in full. If true, the invoice allows partial payments.
    Note: This feature is not available for merchants in India, Brazil, or Israel.
  • minimum_amount_due

    object

    The minimum amount allowed for a partial payment. Valid only if allow_partial_payment is true.
  • tax_calculated_after_discount

    boolean

    Indicates whether the tax is calculated before or after a discount. If false, the tax is calculated before a discount. If true, the tax is calculated after a discount.
  • tax_inclusive

    boolean

    Indicates whether the unit price includes tax.
  • terms

    string

    The general terms of the invoice.

    Maximum length: 4000.

  • note

    string

    A note to the invoice recipient. The note also appears on the invoice notification email.

    Maximum length: 4000.

  • merchant_memo

    string

    A private bookkeeping memo for the merchant.

    Maximum length: 500.

  • logo_url

    string

    The full URL to an external logo image. The logo must not be larger than 250 pixels wide by 90 pixels high. The logo must be stored on a secure server.

    Maximum length: 4000.

  • total_amount

    object

    The total amount of the invoice.

    Read only.

  • payments

    array (contains the payment_detail object)

    An array of payment details for the invoice.

    Read only.

  • refunds

    array (contains the refund_detail object)

    An array of refund details for the invoice.

    Read only.

  • metadata

    object

    The audit information for the invoice.

    Read only.

  • paid_amount

    object

    The payment summary of the invoice. Includes the amount paid through PayPal and other sources.

    Read only.

  • refunded_amount

    object

    The payment summary of the invoice. Includes the amount refunded through PayPal and other sources.

    Read only.

  • attachments

    array (contains the file_attachment object)

    An array of PayPal file IDs for the files that are attached to an invoice. You can attach up to five files.

    Read only.

  • allow_tip

    boolean

    Indicates whether the invoice enables the customer to enter a tip amount during payment. If true, the invoice shows a tip amount field so that the customer can enter a tip amount. If false, the invoice does not show a tip amount field.
    Note: This feature is not available for merchants in Hong Kong, Taiwan, India, or Japan.
  • template_id

    string

    This value is only used to determine the layout to display on the create or edit invoice experience, such as which fields to show and hide. It does not impact the view of the invoice that the customer receives.
    Note: If you are just using the Invoicing APIs to create and send invoices, leave this field blank. The template_id is only needed if you use the Invoicing API to build a full invoicing solution that includes templates.

    Default: PayPal system template.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

Sample Response

{
  "id": "INV2-RUVR-ADWQ-H89Y-ABCD",
  "number": "INV 01256",
  "status": "DRAFT",
  "merchant_info": {
    "email": "merchant@example.com",
    "first_name": "David",
    "last_name": "Larusso",
    "business_name": "Mitchell & Murray",
    "phone": {
      "country_code": "001",
      "national_number": "4085551234"
    },
    "address": {
      "line1": "1234 First Street",
      "city": "Anytown",
      "state": "CA",
      "postal_code": "98765",
      "country_code": "US"
    }
  },
  "billing_info": [
    {
      "email": "bill-me@example.com",
      "first_name": "Stephanie",
      "last_name": "Meyers"
    }
  ],
  "shipping_info": {
    "first_name": "Stephanie",
    "last_name": "Meyers",
    "address": {
      "line1": "1234 Main Street",
      "city": "Anytown",
      "state": "CA",
      "postal_code": "98765",
      "country_code": "US"
    }
  },
  "items": [
    {
      "name": "Zoom System wireless headphones",
      "quantity": 2,
      "unit_price": {
        "currency": "USD",
        "value": "120.00"
      },
      "tax": {
        "name": "Tax",
        "percent": 8,
        "amount": {
          "currency": "USD",
          "value": "19.20"
        }
      }
    },
    {
      "name": "Bluetooth speaker",
      "quantity": 1,
      "unit_price": {
        "currency": "USD",
        "value": "145.00"
      },
      "tax": {
        "name": "Tax",
        "percent": 8,
        "amount": {
          "currency": "USD",
          "value": "11.60"
        }
      }
    }
  ],
  "invoice_date": "2017-06-22 PDT",
  "discount": {
    "percent": 10,
    "amount": {
      "currency": "USD",
      "value": "38.50"
    }
  },
  "shipping_cost": {
    "amount": {
      "currency": "USD",
      "value": "10.00"
    }
  },
  "tax_calculated_after_discount": false,
  "tax_inclusive": false,
  "note": "Thank you for your business.",
  "total_amount": {
    "currency": "USD",
    "value": "387.30"
  },
  "metadata": {
    "created_date": "2017-06-22 09:39:04 PDT"
  },
  "allow_tip": false,
  "links": [
    {
      "rel": "self",
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-FSLW-8GKP-N3QV-QQCX",
      "method": "GET"
    },
    {
      "rel": "send",
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-FSLW-8GKP-N3QV-QQCX/send",
      "method": "POST"
    },
    {
      "rel": "update",
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-FSLW-8GKP-N3QV-QQCX",
      "method": "PUT"
    },
    {
      "rel": "delete",
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-FSLW-8GKP-N3QV-QQCX",
      "method": "DELETE"
    }
  ]
}

List invoices

GET /v1/invoicing/invoices
Lists invoices. To filter the invoices that appear in the response, you can specify one or more optional query parameters.

Query parameters

  • page

    integer

    The zero-relative start index of the entire list of merchant invoices that are returned in the response. So, the combination of page=0 and page_size=20 returns the first 20 invoices.The combination of page=20 and page_size=20 returns the next 20 invoices.

    Default: 1.

  • page_size

    integer

    The number of invoices to return in the response.

    Default: 20.

  • total_count_required

    boolean

    Indicates whether to show the total count in the response.
SDK samples: C#, JAVA, Node.js, PHP, Python, Ruby

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/invoicing/invoices?page=3&page_size=4&total_count_required=true \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that lists invoices with details.
  • total_count

    integer

    The total number of invoices that match the search criteria.

    Read only.

  • invoices

    array (contains the invoice object)

    An array of invoice-level details.
    Note: This array does not return item details for the invoice.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

Sample Response

{
  "total_count": 589,
  "invoices": [
    {
      "id": "INV2-2NB5-UJ7A-YSUJ-ABCD",
      "number": "9879878979003791",
      "status": "DRAFT",
      "merchant_info": {
        "email": "merchant@example.com"
      },
      "billing_info": [
        {
          "email": "bill-me@example.com"
        }
      ],
      "shipping_info": {
        "first_name": "Sally",
        "last_name": "Patient",
        "business_name": "Not applicable"
      },
      "invoice_date": "2014-02-27 PST",
      "note": "Medical Invoice 16 Jul, 2013 PST",
      "total_amount": {
        "currency": "USD",
        "value": "0.00"
      },
      "metadata": {
        "created_date": "2014-02-27 23:55:58 PST"
      }
    },
    {
      "id": "INV2-5AYC-UE5K-XXEG-ABCD",
      "number": "9879878979003790",
      "status": "DRAFT",
      "merchant_info": {
        "email": "merchant@example.com"
      },
      "billing_info": [
        {
          "email": "bill-me@example.com"
        }
      ],
      "shipping_info": {
        "first_name": "Sally",
        "last_name": "Patient",
        "business_name": "Not applicable"
      },
      "invoice_date": "2014-02-27 PST",
      "note": "Medical Invoice 16 Jul, 2013 PST",
      "total_amount": {
        "currency": "USD",
        "value": "0.00"
      },
      "metadata": {
        "created_date": "2014-02-27 19:41:56 PST"
      }
    },
    {
      "id": "INV2-C4QH-KEKM-C5QE-ABCD",
      "number": "9879878979003789",
      "status": "DRAFT",
      "merchant_info": {
        "email": "merchant@example.com"
      },
      "billing_info": [
        {
          "email": "bill-me@example.com"
        }
      ],
      "shipping_info": {
        "first_name": "Sally",
        "last_name": "Patient",
        "business_name": "Not applicable"
      },
      "invoice_date": "2014-02-27 PST",
      "note": "Medical Invoice 16 Jul, 2013 PST",
      "total_amount": {
        "currency": "USD",
        "value": "0.00"
      },
      "metadata": {
        "created_date": "2014-02-27 15:34:11 PST"
      }
    },
    {
      "id": "INV2-YP6Y-9LJU-9NFS-ABCD",
      "number": "9879878979003788",
      "status": "DRAFT",
      "merchant_info": {
        "email": "merchant@example.com"
      },
      "billing_info": [
        {
          "email": "bill-me@example.com"
        }
      ],
      "shipping_info": {
        "first_name": "Sally",
        "last_name": "Patient",
        "business_name": "Not applicable"
      },
      "invoice_date": "2014-02-27 PST",
      "note": "Medical Invoice 16 Jul, 2013 PST",
      "total_amount": {
        "currency": "USD",
        "value": "12.00"
      },
      "metadata": {
        "created_date": "2014-02-27 15:34:01 PST"
      }
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices?page=4&page_size=4&total_count_required=true",
      "rel": "next",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices?page=2&page_size=4&total_count_required=true",
      "rel": "previous",
      "method": "GET"
    }
  ]
}

Update invoice

PUT /v1/invoicing/invoices/{invoice_id}
Fully updates an invoice, by ID. In the JSON request body, include a complete invoice object. This call does not support partial updates.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice to update.

Query parameters

  • notify_merchant

    boolean

    Indicates whether to send the invoice update notification to the merchant.

    Default: true.

Request body

  • number

    string

    The invoice number. If you omit this value, the default is the number that the API automatically increments from the last number.

    Maximum length: 25.

  • merchant_info

    object

    required

    The merchant information, such as business name, email, address, and so on.
  • billing_info

    array (contains the billing_info object)

    An array of billing information for the invoice recipient.
    Note: This value is an array with only one element.
  • shipping_info

    object

    The shipping information for the recipient of the invoice.
  • cc_info

    array (contains the participant object)

    An array of email addresses to which PayPal sends a copy of the invoice.
  • items

    array (contains the invoice_item object)

    An array of invoice line item information.
  • invoice_date

    string

    The invoice date as specified by the sender, in Internet date and time format.
  • payment_term

    object

    The payment due date of the invoice. If you include due_date, the term_type value is ignored.
  • reference

    string

    The reference data, such as PO number.

    Maximum length: 60.

  • discount

    object

    The invoice level discount, as a percent or an amount value.
  • shipping_cost

    object

    The shipping amount, as a percent or an amount value.
  • custom

    object

    The custom amount to apply to an invoice. If you include a label, you must include a custom amount.
  • allow_partial_payment

    boolean

    Indicates whether the invoice allows a partial payment. If false, the invoice must be paid in full. If true, the invoice allows partial payments.
    Note: This feature is not available for merchants in India, Brazil, or Israel.
  • minimum_amount_due

    object

    The minimum amount allowed for a partial payment. Valid only if allow_partial_payment is true.
  • tax_calculated_after_discount

    boolean

    Indicates whether the tax is calculated before or after a discount. If false, the tax is calculated before a discount. If true, the tax is calculated after a discount.
  • tax_inclusive

    boolean

    Indicates whether the unit price includes tax.
  • terms

    string

    The general terms of the invoice.

    Maximum length: 4000.

  • note

    string

    A note to the invoice recipient. The note also appears on the invoice notification email.

    Maximum length: 4000.

  • merchant_memo

    string

    A private bookkeeping memo for the merchant.

    Maximum length: 500.

  • logo_url

    string

    The full URL to an external logo image. The logo must not be larger than 250 pixels wide by 90 pixels high. The logo must be stored on a secure server.

    Maximum length: 4000.

  • allow_tip

    boolean

    Indicates whether the invoice enables the customer to enter a tip amount during payment. If true, the invoice shows a tip amount field so that the customer can enter a tip amount. If false, the invoice does not show a tip amount field.
    Note: This feature is not available for merchants in Hong Kong, Taiwan, India, or Japan.
  • template_id

    string

    This value is only used to determine the layout to display on the create or edit invoice experience, such as which fields to show and hide. It does not impact the view of the invoice that the customer receives.
    Note: If you are just using the Invoicing APIs to create and send invoices, leave this field blank. The template_id is only needed if you use the Invoicing API to build a full invoicing solution that includes templates.

    Default: PayPal system template.

SDK samples: C#, JAVA, Node, PHP

Sample Request

curl -v -X PUT https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-8UZ6-Q3DK-VZXV-SXQB \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "merchant_info": {
    "email": "merchant@example.com",
    "first_name": "Dennis",
    "last_name": "Doctor",
    "business_name": "Medical Professionals, LLC",
    "phone": {
      "country_code": "001",
      "national_number": "5032141716"
    },
    "address": {
      "line1": "1234 Main St.",
      "city": "Portland",
      "state": "OR",
      "postal_code": "97217",
      "country_code": "US"
    }
  },
  "billing_info": [
    {
      "email": "bill-me@example.com"
    }
  ],
  "items": [
    {
      "name": "Sutures",
      "quantity": 100,
      "unit_price": {
        "currency": "USD",
        "value": "5"
      }
    }
  ],
  "note": "Medical Invoice 16 Jul, 2013 PST",
  "payment_term": {
    "term_type": "NET_45"
  },
  "shipping_info": {
    "first_name": "Sally",
    "last_name": "Patient",
    "business_name": "Not applicable",
    "address": {
      "line1": "1234 Broad St.",
      "city": "Portland",
      "state": "OR",
      "postal_code": "97216",
      "country_code": "US"
    }
  }
}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows invoice details.
  • id

    string

    The ID of the invoice.

    Read only.

  • number

    string

    The invoice number. If you omit this value, the default is the number that the API automatically increments from the last number.

    Maximum length: 25.

  • status

    enum

    The invoice status. When you search for invoices, you must specify this value as an array. For example, "status": ["REFUNDED"]. The status indicates the phase of an invoice in its lifecycle. The status also indicates whether the invoice is unpaid, partially paid, fully paid, partially refunded, or fully refunded. An invoice payment can be either:
    • Connected to an invoice. The customer clicks Pay on the invoice to make a payment. The payment is automatically recorded.
    • Disconnected from an invoice. The customer pays by check, wire transfer, or another method. The merchant manually records the payment.

    Similarly, an invoice refund can be disconnected from an invoice. The merchant refunds a payment by check, wire transfer, or another method and manually records the refund. This table lists the typical order through which an invoice moves through status values:
    StatusOccurs when
    DRAFTA merchant creates a draft invoice.
    Note: A customer cannot pay an invoice with this status. A customer cannot pay an invoice until it has a status of SENT or UNPAID.
    UNPAIDA merchant chooses to suppress the PayPal email notification when he or she sends the invoice through the API or the Create Invoice page, and then manually sends the invoice link in his or her own email.
    To send an invoice without email notification, the merchant either:
    • Sets the notify_merchant and notify_customer query parameters to false when he or she sends the invoice.
    • Selects Share link myself from the Send menu when he or she sends the invoice through the web UI Create Invoice page.
    SENTA merchant accepts the default PayPal email notification when he or she sends the invoice through the API or the Create Invoice page. PayPal automatically emails the invoice to the customer and a Pay button appears on the invoice, which enables the customer to pay the invoice. In a web app, the invoice appears as Unpaid (sent).
    SCHEDULEDA merchant schedules an invoice to send on a future date. At 07:00 on that date in the preferred time zone of the merchant's PayPal account profile, PayPal emails an invoice notification to the merchant and the customer, adds an online payment button to the customer’s view of the invoice, and updates the invoice status to SENT.
    PARTIALLY_PAIDA customer makes a partial payment for the invoice through one of these methods:
    PAYMENT_PENDINGA customer pays an invoice but the payment is pending for one of these reasons:
    • The payment is an uncleared eCheck.
    • The merchant must either accept the payment before it clears or deny the payment.
    • PayPal risk is reviewing the payment.
    Note: Most payments never go into a payment-pending state.
    PAIDA customer fully pays the invoice through one of these methods:
    MARKED_AS_PAIDA customer makes a disconnected payment for the balance of the invoice. The merchant manually marks the invoice as paid.
    CANCELLEDA merchant or customer cancels a sent invoice. You can cancel an invoice in SENT or UNPAID status.
    REFUNDEDA merchant fully refunds an invoice through one these methods:
    PARTIALLY_REFUNDEDA merchant partially refunds an invoice through one or both of these methods:
    MARKED_AS_REFUNDEDA merchant makes a disconnected refund, such as a check payment, for the invoice balance and manually marks the invoice as fully refunded.
    Note: A merchant can only mark a marked-as-paid invoice as refunded.

    Read only.

    Possible values: DRAFT, UNPAID, SENT, SCHEDULED, PARTIALLY_PAID, PAYMENT_PENDING, PAID, MARKED_AS_PAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, MARKED_AS_REFUNDED.

  • merchant_info

    object

    The merchant information, such as business name, email, address, and so on.
  • billing_info

    array (contains the billing_info object)

    An array of billing information for the invoice recipient.
    Note: This value is an array with only one element.
  • shipping_info

    object

    The shipping information for the recipient of the invoice.
  • cc_info

    array (contains the participant object)

    An array of email addresses to which PayPal sends a copy of the invoice.
  • items

    array (contains the invoice_item object)

    An array of invoice line item information.
  • invoice_date

    string

    The invoice date as specified by the sender, in Internet date and time format.
  • payment_term

    object

    The payment due date of the invoice. If you include due_date, the term_type value is ignored.
  • reference

    string

    The reference data, such as PO number.

    Maximum length: 60.

  • discount

    object

    The invoice level discount, as a percent or an amount value.
  • shipping_cost

    object

    The shipping amount, as a percent or an amount value.
  • custom

    object

    The custom amount to apply to an invoice. If you include a label, you must include a custom amount.
  • allow_partial_payment

    boolean

    Indicates whether the invoice allows a partial payment. If false, the invoice must be paid in full. If true, the invoice allows partial payments.
    Note: This feature is not available for merchants in India, Brazil, or Israel.
  • minimum_amount_due

    object

    The minimum amount allowed for a partial payment. Valid only if allow_partial_payment is true.
  • tax_calculated_after_discount

    boolean

    Indicates whether the tax is calculated before or after a discount. If false, the tax is calculated before a discount. If true, the tax is calculated after a discount.
  • tax_inclusive

    boolean

    Indicates whether the unit price includes tax.
  • terms

    string

    The general terms of the invoice.

    Maximum length: 4000.

  • note

    string

    A note to the invoice recipient. The note also appears on the invoice notification email.

    Maximum length: 4000.

  • merchant_memo

    string

    A private bookkeeping memo for the merchant.

    Maximum length: 500.

  • logo_url

    string

    The full URL to an external logo image. The logo must not be larger than 250 pixels wide by 90 pixels high. The logo must be stored on a secure server.

    Maximum length: 4000.

  • total_amount

    object

    The total amount of the invoice.

    Read only.

  • payments

    array (contains the payment_detail object)

    An array of payment details for the invoice.

    Read only.

  • refunds

    array (contains the refund_detail object)

    An array of refund details for the invoice.

    Read only.

  • metadata

    object

    The audit information for the invoice.

    Read only.

  • paid_amount

    object

    The payment summary of the invoice. Includes the amount paid through PayPal and other sources.

    Read only.

  • refunded_amount

    object

    The payment summary of the invoice. Includes the amount refunded through PayPal and other sources.

    Read only.

  • attachments

    array (contains the file_attachment object)

    An array of PayPal file IDs for the files that are attached to an invoice. You can attach up to five files.

    Read only.

  • allow_tip

    boolean

    Indicates whether the invoice enables the customer to enter a tip amount during payment. If true, the invoice shows a tip amount field so that the customer can enter a tip amount. If false, the invoice does not show a tip amount field.
    Note: This feature is not available for merchants in Hong Kong, Taiwan, India, or Japan.
  • template_id

    string

    This value is only used to determine the layout to display on the create or edit invoice experience, such as which fields to show and hide. It does not impact the view of the invoice that the customer receives.
    Note: If you are just using the Invoicing APIs to create and send invoices, leave this field blank. The template_id is only needed if you use the Invoicing API to build a full invoicing solution that includes templates.

    Default: PayPal system template.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

Sample Response

{
  "id": "INV2-8UZ6-Q3DK-VZXV-SXQB",
  "number": "0014",
  "status": "DRAFT",
  "merchant_info": {
    "email": "merchant@example.com",
    "first_name": "Dennis",
    "last_name": "Doctor",
    "business_name": "Medical Professionals, LLC",
    "phone": {
      "country_code": "1",
      "national_number": "5032141716"
    },
    "address": {
      "line1": "1234 Main St.",
      "city": "Portland",
      "state": "OR",
      "postal_code": "97217",
      "country_code": "US"
    }
  },
  "billing_info": [
    {
      "email": "bill-me@example.com"
    }
  ],
  "shipping_info": {
    "first_name": "Sally",
    "last_name": "Patient",
    "business_name": "Not applicable",
    "address": {
      "line1": "1234 Broad St.",
      "city": "Portland",
      "state": "OR",
      "postal_code": "97216",
      "country_code": "US"
    }
  },
  "items": [
    {
      "name": "Sutures",
      "quantity": 100,
      "unit_price": {
        "currency": "USD",
        "value": "5.00"
      }
    }
  ],
  "invoice_date": "2014-03-24 PDT",
  "payment_term": {
    "term_type": "NET_45",
    "due_date": "2014-05-08 PDT"
  },
  "tax_calculated_after_discount": false,
  "tax_inclusive": false,
  "note": "Medical Invoice 16 Jul, 2013 PST",
  "total_amount": {
    "currency": "USD",
    "value": "500.00"
  }
}

Show invoice details

GET /v1/invoicing/invoices/{invoice_id}
Shows details for an invoice, by ID.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice for which to show details.
SDK samples: C#, JAVA, Node.js, PHP, Python, Ruby

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-RF6D-L66T-D7H2-CRU7 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows invoice details.
  • id

    string

    The ID of the invoice.

    Read only.

  • number

    string

    The invoice number. If you omit this value, the default is the number that the API automatically increments from the last number.

    Maximum length: 25.

  • status

    enum

    The invoice status. When you search for invoices, you must specify this value as an array. For example, "status": ["REFUNDED"]. The status indicates the phase of an invoice in its lifecycle. The status also indicates whether the invoice is unpaid, partially paid, fully paid, partially refunded, or fully refunded. An invoice payment can be either:
    • Connected to an invoice. The customer clicks Pay on the invoice to make a payment. The payment is automatically recorded.
    • Disconnected from an invoice. The customer pays by check, wire transfer, or another method. The merchant manually records the payment.

    Similarly, an invoice refund can be disconnected from an invoice. The merchant refunds a payment by check, wire transfer, or another method and manually records the refund. This table lists the typical order through which an invoice moves through status values:
    StatusOccurs when
    DRAFTA merchant creates a draft invoice.
    Note: A customer cannot pay an invoice with this status. A customer cannot pay an invoice until it has a status of SENT or UNPAID.
    UNPAIDA merchant chooses to suppress the PayPal email notification when he or she sends the invoice through the API or the Create Invoice page, and then manually sends the invoice link in his or her own email.
    To send an invoice without email notification, the merchant either:
    • Sets the notify_merchant and notify_customer query parameters to false when he or she sends the invoice.
    • Selects Share link myself from the Send menu when he or she sends the invoice through the web UI Create Invoice page.
    SENTA merchant accepts the default PayPal email notification when he or she sends the invoice through the API or the Create Invoice page. PayPal automatically emails the invoice to the customer and a Pay button appears on the invoice, which enables the customer to pay the invoice. In a web app, the invoice appears as Unpaid (sent).
    SCHEDULEDA merchant schedules an invoice to send on a future date. At 07:00 on that date in the preferred time zone of the merchant's PayPal account profile, PayPal emails an invoice notification to the merchant and the customer, adds an online payment button to the customer’s view of the invoice, and updates the invoice status to SENT.
    PARTIALLY_PAIDA customer makes a partial payment for the invoice through one of these methods:
    PAYMENT_PENDINGA customer pays an invoice but the payment is pending for one of these reasons:
    • The payment is an uncleared eCheck.
    • The merchant must either accept the payment before it clears or deny the payment.
    • PayPal risk is reviewing the payment.
    Note: Most payments never go into a payment-pending state.
    PAIDA customer fully pays the invoice through one of these methods:
    MARKED_AS_PAIDA customer makes a disconnected payment for the balance of the invoice. The merchant manually marks the invoice as paid.
    CANCELLEDA merchant or customer cancels a sent invoice. You can cancel an invoice in SENT or UNPAID status.
    REFUNDEDA merchant fully refunds an invoice through one these methods:
    PARTIALLY_REFUNDEDA merchant partially refunds an invoice through one or both of these methods:
    MARKED_AS_REFUNDEDA merchant makes a disconnected refund, such as a check payment, for the invoice balance and manually marks the invoice as fully refunded.
    Note: A merchant can only mark a marked-as-paid invoice as refunded.

    Read only.

    Possible values: DRAFT, UNPAID, SENT, SCHEDULED, PARTIALLY_PAID, PAYMENT_PENDING, PAID, MARKED_AS_PAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, MARKED_AS_REFUNDED.

  • merchant_info

    object

    The merchant information, such as business name, email, address, and so on.
  • billing_info

    array (contains the billing_info object)

    An array of billing information for the invoice recipient.
    Note: This value is an array with only one element.
  • shipping_info

    object

    The shipping information for the recipient of the invoice.
  • cc_info

    array (contains the participant object)

    An array of email addresses to which PayPal sends a copy of the invoice.
  • items

    array (contains the invoice_item object)

    An array of invoice line item information.
  • invoice_date

    string

    The invoice date as specified by the sender, in Internet date and time format.
  • payment_term

    object

    The payment due date of the invoice. If you include due_date, the term_type value is ignored.
  • reference

    string

    The reference data, such as PO number.

    Maximum length: 60.

  • discount

    object

    The invoice level discount, as a percent or an amount value.
  • shipping_cost

    object

    The shipping amount, as a percent or an amount value.
  • custom

    object

    The custom amount to apply to an invoice. If you include a label, you must include a custom amount.
  • allow_partial_payment

    boolean

    Indicates whether the invoice allows a partial payment. If false, the invoice must be paid in full. If true, the invoice allows partial payments.
    Note: This feature is not available for merchants in India, Brazil, or Israel.
  • minimum_amount_due

    object

    The minimum amount allowed for a partial payment. Valid only if allow_partial_payment is true.
  • tax_calculated_after_discount

    boolean

    Indicates whether the tax is calculated before or after a discount. If false, the tax is calculated before a discount. If true, the tax is calculated after a discount.
  • tax_inclusive

    boolean

    Indicates whether the unit price includes tax.
  • terms

    string

    The general terms of the invoice.

    Maximum length: 4000.

  • note

    string

    A note to the invoice recipient. The note also appears on the invoice notification email.

    Maximum length: 4000.

  • merchant_memo

    string

    A private bookkeeping memo for the merchant.

    Maximum length: 500.

  • logo_url

    string

    The full URL to an external logo image. The logo must not be larger than 250 pixels wide by 90 pixels high. The logo must be stored on a secure server.

    Maximum length: 4000.

  • total_amount

    object

    The total amount of the invoice.

    Read only.

  • payments

    array (contains the payment_detail object)

    An array of payment details for the invoice.

    Read only.

  • refunds

    array (contains the refund_detail object)

    An array of refund details for the invoice.

    Read only.

  • metadata

    object

    The audit information for the invoice.

    Read only.

  • paid_amount

    object

    The payment summary of the invoice. Includes the amount paid through PayPal and other sources.

    Read only.

  • refunded_amount

    object

    The payment summary of the invoice. Includes the amount refunded through PayPal and other sources.

    Read only.

  • attachments

    array (contains the file_attachment object)

    An array of PayPal file IDs for the files that are attached to an invoice. You can attach up to five files.

    Read only.

  • allow_tip

    boolean

    Indicates whether the invoice enables the customer to enter a tip amount during payment. If true, the invoice shows a tip amount field so that the customer can enter a tip amount. If false, the invoice does not show a tip amount field.
    Note: This feature is not available for merchants in Hong Kong, Taiwan, India, or Japan.
  • template_id

    string

    This value is only used to determine the layout to display on the create or edit invoice experience, such as which fields to show and hide. It does not impact the view of the invoice that the customer receives.
    Note: If you are just using the Invoicing APIs to create and send invoices, leave this field blank. The template_id is only needed if you use the Invoicing API to build a full invoicing solution that includes templates.

    Default: PayPal system template.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

Sample Response

{
  "id": "INV2-RF6D-L66T-D7H2-CRU7",
  "number": "0002",
  "status": "DRAFT",
  "template_id": "TEMP-XYZ",
  "merchant_info": {
    "email": "merchant@example.com",
    "first_name": "Dennis",
    "last_name": "Doctor",
    "business_name": "Medical Professionals, LLC",
    "phone": {
      "country_code": "1",
      "national_number": "5032141716"
    },
    "address": {
      "line1": "1234 Main St.",
      "city": "Portland",
      "state": "OR",
      "postal_code": "97217",
      "country_code": "US"
    }
  },
  "billing_info": [
    {
      "email": "bill-me@example.com"
    }
  ],
  "shipping_info": {
    "first_name": "Sally",
    "last_name": "Patient",
    "business_name": "Not applicable",
    "address": {
      "line1": "1234 Broad St.",
      "city": "Portland",
      "state": "OR",
      "postal_code": "97216",
      "country_code": "US"
    }
  },
  "items": [
    {
      "name": "Sutures",
      "quantity": 100,
      "unit_price": {
        "currency": "USD",
        "value": "5.00"
      }
    }
  ],
  "invoice_date": "2014-03-24 PDT",
  "payment_term": {
    "term_type": "NET_45",
    "due_date": "2014-05-08 PDT"
  },
  "tax_calculated_after_discount": false,
  "tax_inclusive": false,
  "note": "Medical Invoice 16 Jul, 2013 PST",
  "total_amount": {
    "currency": "USD",
    "value": "500.00"
  },
  "metadata": {
    "created_date": "2014-03-24 12:11:52 PDT"
  },
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-RF6D-L66T-D7H2-CRU7/send",
      "rel": "send",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-RF6D-L66T-D7H2-CRU7",
      "rel": "delete",
      "method": "DELETE"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-RF6D-L66T-D7H2-CRU7",
      "rel": "update",
      "method": "PUT"
    }
  ]
}

Delete draft invoice

DELETE /v1/invoicing/invoices/{invoice_id}
Deletes invoices in the DRAFT or SCHEDULED state, by ID. For invoices that have already been sent, you can cancel the invoice. After you delete a draft or scheduled invoice, you can no longer use it or show its details. However, you can reuse its invoice number.

Path parameters

  • invoice_id

    string

    required

    The ID of the draft invoice to delete.
SDK samples: C#, JAVA, Node.js, PHP

Sample Request

curl -v -X DELETE https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-92MG-CNXV-ND7G-P3D2 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 204 No Content status code with no JSON response body.

Sample Response

204 No Content

Cancel sent invoice

POST /v1/invoicing/invoices/{invoice_id}/cancel
Cancels a sent invoice, by ID, and, optionally, sends a notification about the cancellation to the payer, merchant, and CC: emails.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice to cancel.

Request body

  • subject

    string

    The subject of the notification. If left blank we include a generic subject.
  • note

    string

    A note to the payer.
  • send_to_merchant

    boolean

    Indicates whether to send the notification to the merchant.

    Default: true.

  • send_to_payer

    boolean

    Indicates whether to send the notification to the payer.

    Default: true.

  • cc_emails

    array (contains the cc_email object)

    An array of one or more CC: emails to which to send notification emails. If you omit this parameter, the API sends notification emails to all CC: email addresses that are part of the invoice.
    Note: Additional email addresses are not supported.
SDK samples: C#, JAVA, Node.js, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-WW57-VFCD-X5H4-XTUP/cancel \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "subject": "Invoice canceled",
  "note": "Canceling this invoice per your request.",
  "send_to_merchant": true,
  "send_to_payer": true,
  "cc_emails": [
    "cc-email@example.com"
  ]
}'

Response

A successful request returns the HTTP 204 No Content status code with no JSON response body.

Sample Response

204 No Content

Delete external payment

DELETE /v1/invoicing/invoices/{invoice_id}/payment-records/{transaction_id}
Deletes an external payment, by invoice ID and transaction ID.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice from which to delete an external payment transaction.
  • transaction_id

    string

    required

    The ID of the external payment transaction to delete.

Sample Request

curl -v -X DELETE https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-TBRZ-SWBK-7FQ9-AC8F/payment-records/EXTR-86F38350LX4353815 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 204 No Content status code with no JSON response body.

Sample Response

204 No Content

Generate QR code

GET /v1/invoicing/invoices/{invoice_id}/qr-code
Generates a QR code for an invoice, by ID. The QR code is a PNG image in Base64-encoded 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 customers use their mobile devices to scan the QR code, they are redirected to the PayPal mobile payment flow where they can view the invoice and pay online with PayPal or a credit card. Before you get a QR code, you must create an invoice and send an invoice to move the invoice from a draft to payable state. Do not include an email address if you do not want the invoice emailed.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice for which to generate a QR code.

Query parameters

  • width

    integer

    The width, in pixels, of the QR code image. Value is from 150 to 500.

    Default: 500.

  • height

    integer

    The height, in pixels, of the QR code image. Value is from 150 to 500.

    Default: 500.

SDK samples: C#, Node.js, PHP, Python

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-S6FG-ZZCK-VXMM-8KKP/qr-code \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows the QR code as a PNG image.
  • image

    string

    The base64-encoded image of the image/png type.

Sample Response

{
  "image": "iVBORw0KGgoAA......XUDM"
}

Mark invoice as paid

POST /v1/invoicing/invoices/{invoice_id}/record-payment
Marks the status of an invoice, by ID, as paid.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice to mark as paid.

Request body

  • date

    string

    The date when the invoice was paid, in Internet date and time format.
  • method

    enum

    required

    The payment mode or method.

    Allowed values: BANK_TRANSFER, CASH, CHECK, CREDIT_CARD, DEBIT_CARD, PAYPAL, WIRE_TRANSFER, OTHER.

  • note

    string

    A note associated with the payment.
  • amount

    object

    The payment amount to record against the invoice. If you omit this parameter, the total invoice amount is marked as paid. This amount cannot exceed the amount due.
SDK samples: C#, Node.js, PHP, Python

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-T4UQ-VW4W-K7N7-XM2R/record-payment \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "method": "CASH",
  "date": "2013-11-06 03:30:00 PST",
  "note": "I got the payment by cash!",
  "amount": {
    "currency": "USD",
    "value": "20.00"
  }
}'

Response

A successful request returns the HTTP 200 OK status code with no JSON response body.

Sample Response

200 OK

Mark invoice as refunded

POST /v1/invoicing/invoices/{invoice_id}/record-refund
Marks the status of an invoice, by ID, as refunded.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice to mark as refunded.

Request body

  • date

    string

    The date when the invoice was refunded, in Internet date and time format. For example, 2014-02-27 PST.
  • note

    string

    A note associated with the refund.
  • amount

    object

    The currency and amount to record as refunded. If you omit the amount, the total invoice paid amount is recorded as refunded.
SDK samples: C#, Node.js, PHP, Python

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-T4UQ-VW4W-K7N7-XM2R/record-refund \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "date": "2013-11-10 14:00:00 PST",
  "note": "Refunded by cash!",
  "amount": {
    "currency": "USD",
    "value": "20.00"
  }
}'

Response

A successful request returns the HTTP 200 OK status code with no JSON response body.

Sample Response

200 OK

Delete external refund

DELETE /v1/invoicing/invoices/{invoice_id}/refund-records/{transaction_id}
Deletes an external refund, by invoice ID and transaction ID.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice from which to delete the external refund transaction.
  • transaction_id

    string

    required

    The ID of the external refund transaction to delete.

Sample Request

curl -v -X DELETE https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-333R-YUQL-YNNN-D7WF/refund-records/EXTR-2LG703375E477444T \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 204 No Content status code with no JSON response body.

Sample Response

204 No Content

Send invoice reminder

POST /v1/invoicing/invoices/{invoice_id}/remind
Sends a reminder to the payer about an invoice, by ID. In the JSON request body, include a notification object that defines the subject of the reminder and other details.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice for which to send a reminder.

Request body

  • subject

    string

    The subject of the notification. Default is a generic subject.
  • note

    string

    A note to the payer.
  • send_to_merchant

    boolean

    Indicates whether to send a copy of the email to the merchant.

    Default: true.

  • cc_emails

    array (contains the cc_email object)

    An array of one or more CC: emails to which to send notification emails. If you omit this parameter, the API sends notification emails to all CC: email addresses that are part of the invoice.
    Note: Valid values are email addresses in the cc_info array of the invoice.
SDK samples: C#, JAVA, Node.js, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-T4UQ-VW4W-K7N7-XM2R/remind \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "subject": "Past due",
  "note": "Please pay soon",
  "send_to_merchant": true,
  "cc_emails": [
    "cc-email@example.com"
  ]
}'

Response

A successful request returns the HTTP 202 Accepted status code with no JSON response body.

Sample Response

202 Accepted

Schedule invoice

POST /v1/invoicing/invoices/{invoice_id}/schedule
Schedules an invoice, by ID, to send on a future date. At 07:00 on that date in the preferred time zone of the merchant's PayPal account profile, PayPal emails an invoice notification to the merchant and the customer, adds an online payment button to the customer’s view of the invoice, and updates the invoice status to SENT.
Note: To change the scheduled date, adjust the invoice date and update invoice. To send the invoice immediately, update the invoice date to today or to a date in the past.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice to schedule.

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-EHNV-LJ5S-A7DZ-V6NJ/schedule \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 202 Accepted status code and a JSON response body with a link to the invoice .

Sample Response

{
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-RF6D-L66T-D7H2-CRU7",
      "rel": "self",
      "method": "GET"
    }
  ]
}

Send invoice

POST /v1/invoicing/invoices/{invoice_id}/send
Sends an invoice, by ID, to a customer. To suppress the merchant's email notification, set the notify_merchant query parameter to false.
Note: After you send an invoice, you cannot resend it.

Path parameters

  • invoice_id

    string

    required

    The ID of the invoice to send.

Query parameters

  • notify_merchant

    boolean

    Indicates whether to send the invoice update notification to the merchant.

    Default: true.

SDK samples: C#, JAVA, Node.js, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/INV2-EHNV-LJ5S-A7DZ-V6NJ/send?notify_merchant=true \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 202 Accepted status code with no JSON response body.

Sample Response

202 Accepted

Generate invoice number

POST /v1/invoicing/invoices/next-invoice-number
Generates the next invoice number that is available to the merchant. The next invoice number uses the prefix and suffix from the last invoice number and increments the number by one. For example, the next invoice number after INVOICE-1234 is INVOICE-1235.

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows the next invoice number.
  • number

    string

    The invoice number. If you omit this value from the request, the default is the number that the API automatically increments from the last number.

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/invoices/next-invoice-number \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Sample Response

{
  "number": "ee0044"
}

Templates (resource group)

Use the /templates resource to create, list, show details for, update, and delete invoice templates. The template API is useful when creating a third-party invoicing application. For instance, a business can create a template with predefined invoice data. Later, the business can select the template to populate the invoice data.
Note: To upload a logo to display on an invoice, you can use the Template Settings dashboard to create a template. Then, use the URI of that logo when you create an invoice.

Create template

POST /v1/invoicing/templates
Creates an invoice template. You can use details from this template to create an invoice. You can create up to 50 templates.
Note: Every merchant starts with three PayPal system templates that are optimized for the unit type billed. The template includes Quantity, Hours, and Amount.

Request body

  • name

    string

    The template name.
    Note: The template name must be unique.
  • default

    boolean

    Indicates whether this template is the default merchant template. A merchant can have one default template.
  • template_data

    object

    The template data.
  • settings

    array (contains the template_settings object)

    An array of template settings that describe which fields to show or hide when creating an invoice.
  • unit_of_measure

    enum

    The unit of measure for the template.

    Allowed values: HOURS, QUANTITY, AMOUNT.

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/invoicing/templates/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "name": "Hours Template",
  "default": true,
  "unit_of_measure": "HOURS",
  "template_data": {
    "merchant_info": {
      "email": "doctor@example.com",
      "first_name": "Dennis",
      "last_name": "Doctor",
      "business_name": "Medical Professionals, LLC",
      "phone": {
        "country_code": "001",
        "national_number": "5032141716"
      },
      "address": {
        "line1": "1234 Main St.",
        "city": "Portland",
        "state": "OR",
        "postal_code": "97217",
        "country_code": "US"
      }
    },
    "items": [
      {
        "name": "Nutri Bullet",
        "quantity": 1,
        "unit_price": {
          "currency": "USD",
          "value": "50.00"
        }
      }
    ],
    "tax_calculated_after_discount": false,
    "tax_inclusive": false,
    "note": "Thank you for your business.",
    "logo_url": "https://example.com/v1/images/redDot.jpeg"
  },
  "settings": [
    {
      "field_name": "items.date",
      "display_preference": {
        "hidden": true
      }
    },
    {
      "field_name": "custom",
      "display_preference": {
        "hidden": true
      }
    }
  ]
}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows template details.
  • template_id

    string

    The ID of the template.

    Read only.

  • name

    string

    The template name.
    Note: The template name must be unique.
  • default

    boolean

    Indicates whether this template is the default merchant template. A merchant can have one default template.
  • template_data

    object

    The template data.
  • settings

    array (contains the template_settings object)

    An array of template settings that describe which fields to show or hide when creating an invoice.
  • unit_of_measure

    enum

    The unit of measure for the template.

    Possible values: HOURS, QUANTITY, AMOUNT.

  • custom

    boolean

    Indicates whether this template is a merchant-created custom template. The system generates non-custom templates.

    Read only.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

Sample Response

{
  "template_id": "TEMP-XYZ",
  "name": "Hours Template",
  "default": true,
  "unit_of_measure": "HOURS",
  "template_data": {
    "merchant_info": {
      "email": "doctor@example.com",
      "first_name": "Dennis",
      "last_name": "Doctor",
      "business_name": "Medical Professionals, LLC",
      "phone": {
        "country_code": "001",
        "national_number": "5032141716"
      },
      "address": {
        "line1": "1234 Main St.",
        "city": "Portland",
        "state": "OR",
        "postal_code": "97217",
        "country_code": "US"
      }
    },
    "items": [
      {
        "name": "Nutri Bullet",
        "quantity": 1,
        "unit_price": {
          "currency": "USD",
          "value": "50.00"
        }
      }
    ],
    "tax_calculated_after_discount": false,
    "tax_inclusive": false,
    "note": "Thank you for your business.",
    "logo_url": "https://example.com/v1/images/redDot.jpeg"
  },
  "settings": [
    {
      "field_name": "items.date",
      "display_preference": {
        "hidden": true
      }
    },
    {
      "field_name": "custom",
      "display_preference": {
        "hidden": true
      }
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
      "rel": "replace",
      "method": "PUT"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
      "rel": "delete",
      "method": "DELETE"
    }
  ]
}

List templates

GET /v1/invoicing/templates
Lists merchant-created templates with associated details. The associated details include the email addresses, postal addresses, and phone numbers from the user's PayPal profile.
The user can select which values to show in the business information section of their template.

Query parameters

  • fields

    string

    The fields to return in the response. Value is all or none. To return only the template name, ID, and default attributes, specify none.

    Default: all.

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/invoicing/templates \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that lists invoices.
  • addresses

    array (contains the address object)

    An array of postal addresses in the user's PayPal profile.
  • emails

    array (contains the email object)

    An array of email addresses in the user's PayPal profile.
  • phones

    array (contains the phone object)

    An array of phone numbers in the user's PayPal profile.
  • templates

    array (contains the template object)

    The details for each template. If fields is none, returns only the template name, ID, and default status.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

Sample Response

{
  "addresses": [
    {
      "line1": "2211 N 1st Street",
      "city": "San Jose",
      "postal_code": "95131",
      "state": "CA",
      "country_code": "US"
    }
  ],
  "emails": [
    "invoicing-merchant@example.com",
    "invoicing-merch-store2@example.com"
  ],
  "phones": [
    {
      "country_code": "1",
      "national_number": "4085057783"
    },
    {
      "country_code": "1",
      "national_number": "4088064703"
    }
  ],
  "templates": [
    {
      "template_id": "TEMP-XYZ",
      "name": "Hours Template",
      "default": true,
      "unit_of_measure": "HOURS",
      "template_data": {
        "merchant_info": {
          "email": "doctor@example.com",
          "first_name": "Dennis",
          "last_name": "Doctor",
          "business_name": "Medical Professionals, LLC",
          "phone": {
            "country_code": "001",
            "national_number": "5032141716"
          },
          "address": {
            "line1": "1234 Main St.",
            "city": "Portland",
            "state": "OR",
            "postal_code": "97217",
            "country_code": "US"
          }
        },
        "items": [
          {
            "name": "Nutri Bullet",
            "quantity": 1,
            "unit_price": {
              "currency": "USD",
              "value": "50.00"
            }
          }
        ],
        "tax_calculated_after_discount": false,
        "tax_inclusive": false,
        "note": "Thank you for your business.",
        "logo_url": "https://example.com/v1/images/redDot.jpeg"
      },
      "settings": [
        {
          "field_name": "items.date",
          "display_preference": {
            "hidden": true
          }
        },
        {
          "field_name": "custom",
          "display_preference": {
            "hidden": true
          }
        }
      ],
      "links": [
        {
          "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
          "rel": "self",
          "method": "GET"
        },
        {
          "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
          "rel": "replace",
          "method": "PUT"
        },
        {
          "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
          "rel": "delete",
          "method": "DELETE"
        }
      ]
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates",
      "rel": "collection",
      "method": "GET"
    }
  ]
}

Update template

PUT /v1/invoicing/templates/{template_id}
Updates a template, by ID. In the JSON request body, specify a complete template object. The update method does not support partial updates.

Path parameters

  • template_id

    string

    required

    The ID of the template to update.

Request body

  • name

    string

    The template name.
    Note: The template name must be unique.
  • default

    boolean

    Indicates whether this template is the default merchant template. A merchant can have one default template.
  • template_data

    object

    The template data.
  • settings

    array (contains the template_settings object)

    An array of template settings that describe which fields to show or hide when creating an invoice.
  • unit_of_measure

    enum

    The unit of measure for the template.

    Allowed values: HOURS, QUANTITY, AMOUNT.

Sample Request

curl -v -X PUT https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "template_id": "TEMP-XYZ",
  "name": "Hours Template",
  "default": true,
  "unit_of_measure": "HOURS",
  "template_data": {
    "merchant_info": {
      "email": "doctor@example.com",
      "first_name": "Dennis",
      "last_name": "Doctor",
      "business_name": "Medical Professionals, LLC",
      "phone": {
        "country_code": "001",
        "national_number": "5032141716"
      },
      "address": {
        "line1": "1234 Main St.",
        "city": "Portland",
        "state": "OR",
        "postal_code": "97217",
        "country_code": "US"
      }
    },
    "items": [
      {
        "name": "Nutri Bullet",
        "quantity": 1,
        "unit_price": {
          "currency": "USD",
          "value": "50.00"
        }
      }
    ],
    "tax_calculated_after_discount": false,
    "tax_inclusive": false,
    "note": "Thank you for your business.",
    "logo_url": "https://example.com/v1/images/redDot.jpeg"
  },
  "settings": [
    {
      "field_name": "items.date",
      "display_preference": {
        "hidden": true
      }
    },
    {
      "field_name": "custom",
      "display_preference": {
        "hidden": true
      }
    }
  ]
}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows template details.
  • template_id

    string

    The ID of the template.

    Read only.

  • name

    string

    The template name.
    Note: The template name must be unique.
  • default

    boolean

    Indicates whether this template is the default merchant template. A merchant can have one default template.
  • template_data

    object

    The template data.
  • settings

    array (contains the template_settings object)

    An array of template settings that describe which fields to show or hide when creating an invoice.
  • unit_of_measure

    enum

    The unit of measure for the template.

    Possible values: HOURS, QUANTITY, AMOUNT.

  • custom

    boolean

    Indicates whether this template is a merchant-created custom template. The system generates non-custom templates.

    Read only.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

Sample Response

{
  "template_id": "TEMP-XYZ",
  "name": "Hours Template",
  "default": true,
  "unit_of_measure": "HOURS",
  "template_data": {
    "merchant_info": {
      "email": "doctor@example.com",
      "first_name": "Dennis",
      "last_name": "Doctor",
      "business_name": "Medical Professionals, LLC",
      "phone": {
        "country_code": "001",
        "national_number": "5032141716"
      },
      "address": {
        "line1": "1234 Main St.",
        "city": "Portland",
        "state": "OR",
        "postal_code": "97217",
        "country_code": "US"
      }
    },
    "items": [
      {
        "name": "Nutri Bullet",
        "quantity": 1,
        "unit_price": {
          "currency": "USD",
          "value": "50.00"
        }
      }
    ],
    "tax_calculated_after_discount": false,
    "tax_inclusive": false,
    "note": "Thank you for your business.",
    "logo_url": "https://example.com/v1/images/redDot.jpeg"
  },
  "settings": [
    {
      "field_name": "items.date",
      "display_preference": {
        "hidden": true
      }
    },
    {
      "field_name": "custom",
      "display_preference": {
        "hidden": true
      }
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
      "rel": "replace",
      "method": "PUT"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
      "rel": "delete",
      "method": "DELETE"
    }
  ]
}

Delete template

DELETE /v1/invoicing/templates/{template_id}
Deletes a template, by ID.

Path parameters

  • template_id

    string

    required

    The ID of the template to delete.

Sample Request

curl -v -X DELETE https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-0JV3858360943364J \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 204 No Content status code with no JSON response body.

Sample Response

204 No Content

Show template details

GET /v1/invoicing/templates/{template_id}
Shows details for a template, by ID.

Path parameters

  • template_id

    string

    required

    The ID of the template for which to show details.

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-0JV3858360943364J \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows template details.
  • template_id

    string

    The ID of the template.

    Read only.

  • name

    string

    The template name.
    Note: The template name must be unique.
  • default

    boolean

    Indicates whether this template is the default merchant template. A merchant can have one default template.
  • template_data

    object

    The template data.
  • settings

    array (contains the template_settings object)

    An array of template settings that describe which fields to show or hide when creating an invoice.
  • unit_of_measure

    enum

    The unit of measure for the template.

    Possible values: HOURS, QUANTITY, AMOUNT.

  • custom

    boolean

    Indicates whether this template is a merchant-created custom template. The system generates non-custom templates.

    Read only.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

Sample Response

{
  "template_id": "TEMP-XYZ",
  "name": "Hours Template",
  "default": true,
  "unit_of_measure": "HOURS",
  "template_data": {
    "merchant_info": {
      "email": "doctor@example.com",
      "first_name": "Dennis",
      "last_name": "Doctor",
      "business_name": "Medical Professionals, LLC",
      "phone": {
        "country_code": "001",
        "national_number": "5032141716"
      },
      "address": {
        "line1": "1234 Main St.",
        "city": "Portland",
        "state": "OR",
        "postal_code": "97217",
        "country_code": "US"
      }
    },
    "items": [
      {
        "name": "Nutri Bullet",
        "quantity": 1,
        "unit_price": {
          "currency": "USD",
          "value": "50.00"
        }
      }
    ],
    "tax_calculated_after_discount": false,
    "tax_inclusive": false,
    "note": "Thank you for your business.",
    "logo_url": "https://example.com/v1/images/redDot.jpeg"
  },
  "settings": [
    {
      "field_name": "items.date",
      "display_preference": {
        "hidden": true
      }
    },
    {
      "field_name": "custom",
      "display_preference": {
        "hidden": true
      }
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
      "rel": "replace",
      "method": "PUT"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/invoicing/templates/TEMP-XYZ",
      "rel": "delete",
      "method": "DELETE"
    }
  ]
}

Common object definitions

address

  • line1

    string

    required

    The first line of the address. For example, number or street.
  • line2

    string

    The second line of the address. For example, suite or apartment number.
  • city

    string

    required

    The city name.
  • country_code

    string

    required

    The two-character ISO 3166-1 code that identifies the country or region.
    Note: The country code for Great Britain is GB and not UK as is used in that country's top-level domain names. Use the C2 country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
  • postal_code

    string

    The postal code, which is the zip code or equivalent. Typically required for countries with a postal code or an equivalent. See postal code.
  • state

    string

    The code for a US state or the equivalent for other countries. Required for transactions if the address is in one of these countries: Argentina, Brazil, Canada, India, Italy, Japan, Mexico, Thailand, or United States. Maximum length is 40 single-byte characters.
  • phone

    string

    The phone number, in its canonical international E.164 numbering plan format.

amount_summary

  • total_amount

    object

    The currency and amount of the invoice total.

    Read only.

  • paid_amount

    object

    The payment summary of invoice data including the amount paid through PayPal and other sources.

    Read only.

  • refunded_amount

    object

    The payment summary of invoice data including the amount refunded through PayPal and other sources.

    Read only.

billing_info

  • email

    string

    The invoice recipient email address. If you omit this value, the invoice is payable and a notification email is not sent.

    Maximum length: 260.

  • phone

    object

    The invoice recipient's phone number.
  • first_name

    string

    The invoice recipient's first name.

    Maximum length: 30.

  • last_name

    string

    The invoice recipient's last name.

    Maximum length: 30.

  • business_name

    string

    The invoice recipient's business name.

    Maximum length: 100.

  • address

    object

    The invoice recipient's billing address.
  • language

    enum

    The language in which the invoice recipient's email appears. Used only when the recipient does not have a PayPal account.
    If you omit the language and the recipient does not have a PayPal account, the email is sent in the language of the merchant's PayPal account.

    Possible values: da_DK, de_DE, en_AU, en_GB, en_US, es_ES, es_XC, fr_CA, fr_FR, fr_XC, he_IL, id_ID, it_IT, ja_JP, nl_NL, no_NO, pl_PL, pt_BR, pt_PT, ru_RU, sv_SE, th_TH, tr_TR, zh_CN, zh_HK, zh_TW, zh_XC.

  • additional_info

    string

    Any additional information about the recipient.

    Maximum length: 40.

cancel_notification

  • subject

    string

    The subject of the notification. If left blank we include a generic subject.
  • note

    string

    A note to the payer.
  • send_to_merchant

    boolean

    Indicates whether to send the notification to the merchant.

    Default: true.

  • send_to_payer

    boolean

    Indicates whether to send the notification to the payer.

    Default: true.

  • cc_emails

    array (contains the cc_email object)

    An array of one or more CC: emails to which to send notification emails. If you omit this parameter, the API sends notification emails to all CC: email addresses that are part of the invoice.
    Note: Additional email addresses are not supported.

cc_email

  • cc_email

    string

    A CC: email to which to send a notification email.

    Minimum length: 3.

    Maximum length: 254.

    Pattern: ^.+@[^"\-].+$.

currency

  • currency

    string

    required

  • value

    string

    required

    The value, which might be:
    • An integer for currencies like JPY that are not typically fractional.
    • A decimal fraction for currencies like TND that are subdivided into thousandths.
    For the required number of decimal places for a currency code, see Currency codes - ISO 4217.

custom_amount

  • label

    string

    The custom amount label.

    Maximum length: 50.

  • amount

    object

    The currency and amount of the custom value. Value is from -1000000 to 1000000. Supports up to two decimal places.

discount

  • percent

    number

    The discount as a percentage value. Value is from 0 to 100. Supports up to five decimal places.
  • amount

    object

    The currency and amount of the invoice-level discount. Value is from 0 to 1000000. Supports up to two decimal places.

email

  • email

    string

    An email in the user's PayPal profile.

    Minimum length: 3.

    Maximum length: 254.

    Pattern: ^.+@[^"\-].+$.

email

  • email

    string

    The participant's email address.

error

  • name

    string

    required

    The human-readable, unique name of the error.

    Read only.

  • debug_id

    string

    The PayPal internal ID. Used for correlation purposes.

    Read only.

  • message

    string

    required

    The message that describes the error.

    Read only.

  • information_link

    string

    required

    The URI to detailed information related to this error for the developer.

    Read only.

  • details

    array (contains the error_details object)

    An array of additional details for the error.

    Read only.

error_details

  • field

    string

    required

    The name of the field that caused the error.
  • issue

    string

    required

    The reason for the error.

file_attachment

  • name

    string

    The name of the attached file.
  • url

    string

    The URL of the attached file. Use this URL to download the file.

file_upload_response

  • message

    string

    The Document Management System (DMS) information.

    Maximum length: 200.

  • id

    string

    The encrypted DMS-returned path for invoices.
  • filename

    string

    The file name of the uploaded document.

group_invoicing_response

  • group_id

    string

    required

    The ID for the group of invoices.

invoice

  • id

    string

    The ID of the invoice.

    Read only.

  • number

    string

    The invoice number. If you omit this value, the default is the number that the API automatically increments from the last number.

    Maximum length: 25.

  • status

    enum

    The invoice status. When you search for invoices, you must specify this value as an array. For example, "status": ["REFUNDED"]. The status indicates the phase of an invoice in its lifecycle. The status also indicates whether the invoice is unpaid, partially paid, fully paid, partially refunded, or fully refunded. An invoice payment can be either:
    • Connected to an invoice. The customer clicks Pay on the invoice to make a payment. The payment is automatically recorded.
    • Disconnected from an invoice. The customer pays by check, wire transfer, or another method. The merchant manually records the payment.

    Similarly, an invoice refund can be disconnected from an invoice. The merchant refunds a payment by check, wire transfer, or another method and manually records the refund. This table lists the typical order through which an invoice moves through status values:
    StatusOccurs when
    DRAFTA merchant creates a draft invoice.
    Note: A customer cannot pay an invoice with this status. A customer cannot pay an invoice until it has a status of SENT or UNPAID.
    UNPAIDA merchant chooses to suppress the PayPal email notification when he or she sends the invoice through the API or the Create Invoice page, and then manually sends the invoice link in his or her own email.
    To send an invoice without email notification, the merchant either:
    • Sets the notify_merchant and notify_customer query parameters to false when he or she sends the invoice.
    • Selects Share link myself from the Send menu when he or she sends the invoice through the web UI Create Invoice page.
    SENTA merchant accepts the default PayPal email notification when he or she sends the invoice through the API or the Create Invoice page. PayPal automatically emails the invoice to the customer and a Pay button appears on the invoice, which enables the customer to pay the invoice. In a web app, the invoice appears as Unpaid (sent).
    SCHEDULEDA merchant schedules an invoice to send on a future date. At 07:00 on that date in the preferred time zone of the merchant's PayPal account profile, PayPal emails an invoice notification to the merchant and the customer, adds an online payment button to the customer’s view of the invoice, and updates the invoice status to SENT.
    PARTIALLY_PAIDA customer makes a partial payment for the invoice through one of these methods:
    PAYMENT_PENDINGA customer pays an invoice but the payment is pending for one of these reasons:
    • The payment is an uncleared eCheck.
    • The merchant must either accept the payment before it clears or deny the payment.
    • PayPal risk is reviewing the payment.
    Note: Most payments never go into a payment-pending state.
    PAIDA customer fully pays the invoice through one of these methods:
    MARKED_AS_PAIDA customer makes a disconnected payment for the balance of the invoice. The merchant manually marks the invoice as paid.
    CANCELLEDA merchant or customer cancels a sent invoice. You can cancel an invoice in SENT or UNPAID status.
    REFUNDEDA merchant fully refunds an invoice through one these methods:
    PARTIALLY_REFUNDEDA merchant partially refunds an invoice through one or both of these methods:
    MARKED_AS_REFUNDEDA merchant makes a disconnected refund, such as a check payment, for the invoice balance and manually marks the invoice as fully refunded.
    Note: A merchant can only mark a marked-as-paid invoice as refunded.

    Read only.

    Possible values: DRAFT, UNPAID, SENT, SCHEDULED, PARTIALLY_PAID, PAYMENT_PENDING, PAID, MARKED_AS_PAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, MARKED_AS_REFUNDED.

  • merchant_info

    object

    required

    The merchant information, such as business name, email, address, and so on.
  • billing_info

    array (contains the billing_info object)

    An array of billing information for the invoice recipient.
    Note: This value is an array with only one element.
  • shipping_info

    object

    The shipping information for the recipient of the invoice.
  • cc_info

    array (contains the participant object)

    An array of email addresses to which PayPal sends a copy of the invoice.
  • items

    array (contains the invoice_item object)

    An array of invoice line item information.
  • invoice_date

    string

    The invoice date as specified by the sender, in Internet date and time format.
  • payment_term

    object

    The payment due date of the invoice. If you include due_date, the term_type value is ignored.
  • reference

    string

    The reference data, such as PO number.

    Maximum length: 60.

  • discount

    object

    The invoice level discount, as a percent or an amount value.
  • shipping_cost

    object

    The shipping amount, as a percent or an amount value.
  • custom

    object

    The custom amount to apply to an invoice. If you include a label, you must include a custom amount.
  • allow_partial_payment

    boolean

    Indicates whether the invoice allows a partial payment. If false, the invoice must be paid in full. If true, the invoice allows partial payments.
    Note: This feature is not available for merchants in India, Brazil, or Israel.
  • minimum_amount_due

    object

    The minimum amount allowed for a partial payment. Valid only if allow_partial_payment is true.
  • tax_calculated_after_discount

    boolean

    Indicates whether the tax is calculated before or after a discount. If false, the tax is calculated before a discount. If true, the tax is calculated after a discount.
  • tax_inclusive

    boolean

    Indicates whether the unit price includes tax.
  • terms

    string

    The general terms of the invoice.

    Maximum length: 4000.

  • note

    string

    A note to the invoice recipient. The note also appears on the invoice notification email.

    Maximum length: 4000.

  • merchant_memo

    string

    A private bookkeeping memo for the merchant.

    Maximum length: 500.

  • logo_url

    string

    The full URL to an external logo image. The logo must not be larger than 250 pixels wide by 90 pixels high. The logo must be stored on a secure server.

    Maximum length: 4000.

  • total_amount

    object

    The total amount of the invoice.

    Read only.

  • payments

    array (contains the payment_detail object)

    An array of payment details for the invoice.

    Read only.

  • refunds

    array (contains the refund_detail object)

    An array of refund details for the invoice.

    Read only.

  • metadata

    object

    The audit information for the invoice.

    Read only.

  • paid_amount

    object

    The payment summary of the invoice. Includes the amount paid through PayPal and other sources.

    Read only.

  • refunded_amount

    object

    The payment summary of the invoice. Includes the amount refunded through PayPal and other sources.

    Read only.

  • attachments

    array (contains the file_attachment object)

    An array of PayPal file IDs for the files that are attached to an invoice. You can attach up to five files.

    Read only.

  • allow_tip

    boolean

    Indicates whether the invoice enables the customer to enter a tip amount during payment. If true, the invoice shows a tip amount field so that the customer can enter a tip amount. If false, the invoice does not show a tip amount field.
    Note: This feature is not available for merchants in Hong Kong, Taiwan, India, or Japan.
  • template_id

    string

    This value is only used to determine the layout to display on the create or edit invoice experience, such as which fields to show and hide. It does not impact the view of the invoice that the customer receives.
    Note: If you are just using the Invoicing APIs to create and send invoices, leave this field blank. The template_id is only needed if you use the Invoicing API to build a full invoicing solution that includes templates.

    Default: PayPal system template.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

invoice_item

  • name

    string

    required

    The item name.

    Maximum length: 200.

  • description

    string

    The item description.

    Maximum length: 1000.

  • quantity

    number

    required

    The item quantity. Value is from -10000 to 10000. Supports up to five decimal places.
  • unit_price

    object

    required

    The currency and amount of the item unit price. Value is from -1000000 to 1000000. Supports up to two decimal places.
  • tax

    object

    The tax information.
  • date

    string

    The date when the item or service was provided, in Internet date and time format. For example, yyyy-MM-dd z.
  • discount

    object

    The item discount, as a percent or an amount value.
  • unit_of_measure

    enum

    The unit of measure for the invoiced item. For AMOUNT the unit_price and quantity are not shown on the invoice.
    Note: If your specify different unit_of_measure values for the same invoice, the invoice uses the first value.

    Possible values: QUANTITY, HOURS, AMOUNT.

invoice_number

  • number

    string

    The invoice number. If you omit this value from the request, the default is the number that the API automatically increments from the last number.

invoices

  • total_count

    integer

    The total number of invoices that match the search criteria.

    Read only.

  • invoices

    array (contains the invoice object)

    An array of invoice-level details.
    Note: This array does not return item details for the invoice.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

merchant_info

  • email

    string

    The merchant email address. This email must be listed in the merchant's PayPal profile.
    If you omit this value, notifications are sent from and to the primary email address but do not appear on the invoice.

    Maximum length: 260.

  • business_name

    string

    The merchant's business name.

    Maximum length: 100.

  • first_name

    string

    The merchant's first name.

    Maximum length: 256.

  • last_name

    string

    The merchant's last name.

    Maximum length: 256.

  • address

    object

    The merchant's address.
  • phone

    object

    The merchant's phone number.
  • fax

    object

    The merchant's fax number.
  • website

    string

    The merchant's website.

    Maximum length: 2048.

  • tax_id

    string

    The merchant's tax ID.

    Maximum length: 100.

  • additional_info

    string

    Any additional information, such as business hours.

    Maximum length: 40.

metadata

  • created_date

    string

    The date and time when the resource was created, in Internet date and time format.

    Read only.

  • created_by

    string

    The email address of the account that created the resource.

    Read only.

  • cancelled_date

    string

    The date and time when the resource was canceled, in Internet date and time format.

    Read only.

  • cancelled_by

    string

    The actor who canceled the resource.

    Read only.

  • last_updated_date

    string

    The date and time when the resource was last edited, in Internet date and time format.

    Read only.

  • last_updated_by

    string

    The email address of the account that last edited the resource.

    Read only.

  • first_sent_date

    string

    The date and time when the resource was first sent, in Internet date and time format.

    Read only.

  • last_sent_date

    string

    The date and time when the resource was last sent, in Internet date and time format.

    Read only.

  • last_sent_by

    string

    The email address of the account that last sent the resource.

    Read only.

  • payer_view_url

    string

    The URL for the payer's view of the invoice.

    Read only.

notification

  • subject

    string

    The subject of the notification. Default is a generic subject.
  • note

    string

    A note to the payer.
  • send_to_merchant

    boolean

    Indicates whether to send a copy of the email to the merchant.

    Default: true.

  • cc_emails

    array (contains the cc_email object)

    An array of one or more CC: emails to which to send notification emails. If you omit this parameter, the API sends notification emails to all CC: email addresses that are part of the invoice.
    Note: Valid values are email addresses in the cc_info array of the invoice.

participant

  • email

    string

    required

    The email address of the person who receives a copy of the invoice.

    Maximum length: 260.

payment_detail

  • type

    enum

    The payment type in an invoicing flow. The record refund method supports the EXTERNAL refund type. The PAYPAL refund type is supported for backward compatibility.

    Read only.

    Possible values: PAYPAL, EXTERNAL.

  • transaction_id

    string

    The ID for a PayPal payment transaction. Required for the PAYPAL payment type.

    Read only.

  • transaction_type

    enum

    The transaction type.

    Read only.

    Possible values: SALE, AUTHORIZATION, CAPTURE.

  • date

    string

    The date when the invoice was paid, in Internet date and time format.
  • method

    enum

    required

    The payment mode or method.

    Possible values: BANK_TRANSFER, CASH, CHECK, CREDIT_CARD, DEBIT_CARD, PAYPAL, WIRE_TRANSFER, OTHER.

  • note

    string

    A note associated with the payment.
  • amount

    object

    The payment amount to record against the invoice. If you omit this parameter, the total invoice amount is marked as paid. This amount cannot exceed the amount due.

payment_summary

  • paypal

    object

    The currency and amount of the total paid or refunded through PayPal.

    Read only.

  • other

    object

    The currency and amount of the total paid or refunded through other sources.

    Read only.

payment_term

  • term_type

    enum

    The term when the invoice payment is due.

    Possible values: DUE_ON_RECEIPT, DUE_ON_DATE_SPECIFIED, NET_10, NET_15, NET_30, NET_45, NET_60, NET_90, NO_DUE_DATE.

  • due_date

    string

    The date when the invoice payment is due, in Internet date and time format. For example, yyyy-MM-dd z.

phone

  • country_code

    string

    The country code portion of the phone number, in E.164 format.

    Minimum length: 1.

    Maximum length: 3.

    Pattern: ^[0-9]{1,3}?$.

  • national_number

    string

    The in-country phone number, in E.164 format.

    Minimum length: 1.

    Maximum length: 14.

    Pattern: ^[0-9]{1,14}?$.

qr_code

  • image

    string

    The base64-encoded image of the image/png type.

refund_detail

  • type

    enum

    The PayPal refund type. Indicates whether the refund was paid through PayPal or externally in the invoicing flow. The record refund method supports the EXTERNAL refund type. The PAYPAL refund type is supported for backward compatibility.

    Read only.

    Possible values: PAYPAL, EXTERNAL.

  • transaction_id

    string

    The ID of the PayPal refund transaction. Required for the PAYPAL refund type.

    Read only.

  • date

    string

    The date when the invoice was refunded, in Internet date and time format. For example, 2014-02-27 PST.
  • note

    string

    A note associated with the refund.
  • amount

    object

    The currency and amount to record as refunded. If you omit the amount, the total invoice paid amount is recorded as refunded.

shipping_cost

  • amount

    object

    The currency and amount of the shipping charge. Value is from 0 to 1000000. Supports up to two decimal places.
  • tax

    object

    The tax percentage on the shipping amount.

shipping_info

  • first_name

    string

    The first name of the recipient at the shipping address.

    Maximum length: 256.

  • last_name

    string

    The last name of the recipient at the shipping address.

    Maximum length: 256.

  • business_name

    string

    The business name of the recipient at the shipping address.

    Maximum length: 480.

  • address

    object

    The shipping address.

summaries

  • summaries

    array (contains the summary object)

    An array of summaries of invoice data.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

summary

  • status

    enum

    The invoice status. The status indicates the phase of the invoice in its lifecycle:
    StatusOccurs when
    CANCELLEDA merchant or customer cancels a sent invoice.
    DRAFTA merchant creates a draft invoice.
    Note: A customer cannot pay an invoice until a merchant sends it.
    MARKED_AS_PAIDA merchant marks an invoice as paid after he or she receives a check or cash payment for the invoice.
    MARKED_AS_REFUNDEDA merchant marks an invoice as refunded.
    Note: A merchant can only mark a marked-as-paid invoice as refunded.
    PAIDA customer fully pays an invoice. It is marked as paid through one or both of these methods:
    • A merchant marks an invoice as paid after he or she receives a check or cash payment from the customer for the invoice.
    • A customer makes an online payment for the invoice.
    PARTIALLY_PAIDA merchant or customer fully pays an invoice through one or both of these methods:
    • A merchant marks an invoice as paid after he or she receives a check or cash payment from the customer for the invoice.
    • A customer makes an online payment for the invoice.
    PARTIALLY_REFUNDEDA merchant partially refunds an invoice through one or both of these methods:
    PAYMENT_PENDINGA customer pays an invoice but the payment is pending for one of these reasons:
    • The payment is an uncleared eCheck.
    • The payment is in an accept or deny state upon which the merchant must act.
    • PayPal risk is reviewing the payment.
    Note: Most payments never go into a payment-pending state.
    REFUNDEDA merchant fully refunds an invoice through one or both of these methods:
    SCHEDULEDA merchant schedules an invoice to be emailed by PayPal on a specified date.
    SENTA merchant sends an invoice to the customer.
    After the merchant sends the invoice:
    • PayPal emails the invoice to the customer.
    • A Payment button appears on the invoice. The customer can now pay the invoice.
    • In a web app, the invoice appears as Unpaid (sent).
    UNPAIDA merchant sends an invoice and sets the notify_merchant and notify_customer query parameters to false to suppress the PayPal email notification. Then, the merchant manually sends the invoice link in his or her own email.

    Read only.

    Possible values: DRAFT, SENT, SCHEDULED, PAID, MARKED_AS_PAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, MARKED_AS_REFUNDED, UNPAID, PAYMENT_PENDING.

  • count

    integer

    The total count of invoices.

    Read only.

  • amount_summary

    array (contains the amount_summary object)

    An array of amounts, grouped by the currency code of the invoice.

tax

  • name

    string

    required

    The tax name.

    Maximum length: 100.

  • percent

    number

    required

    The tax rate. Value is from 0 to 100. Supports up to five decimal places.

    Minimum value: 0.

  • amount

    object

    The currency and amount of the calculated tax.

    Read only.

template

  • template_id

    string

    The ID of the template.

    Read only.

  • name

    string

    The template name.
    Note: The template name must be unique.
  • default

    boolean

    Indicates whether this template is the default merchant template. A merchant can have one default template.
  • template_data

    object

    The template data.
  • settings

    array (contains the template_settings object)

    An array of template settings that describe which fields to show or hide when creating an invoice.
  • unit_of_measure

    enum

    The unit of measure for the template.

    Possible values: HOURS, QUANTITY, AMOUNT.

  • custom

    boolean

    Indicates whether this template is a merchant-created custom template. The system generates non-custom templates.

    Read only.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

template_data

  • merchant_info

    object

    required

    The merchant business information that appears on the invoice.
  • billing_info

    array (contains the billing_info object)

    The billing information of the invoice recipient.
    Note: This value is an array with only one element.
  • shipping_info

    object

    The shipping information for the invoice recipient.
  • cc_info

    array (contains the email object)

    An array of email addresses to which PayPal sends a copy of the invoice.
  • items

    array (contains the invoice_item object)

    An array of invoice line item information. The maximum items for an invoice is 100.
  • payment_term

    object

    The payment term of the invoice. If you specify term_type, you cannot specify due_date, and vice versa.
  • reference

    string

    The reference data, such as a PO number.

    Maximum length: 60.

  • discount

    object

    The invoice level discount, as a percent or an amount value.
  • shipping_cost

    object

    The shipping cost, as a percent or an amount value.
  • custom

    object

    The custom amount to apply to an invoice. If you include a label, you must include a custom amount.
  • allow_partial_payment

    boolean

    Indicates whether the invoice allows a partial payment. If false, the invoice must be paid in full. If true, the invoice allows partial payments.
    Note: This feature is not available for merchants in India, Brazil, or Israel.
  • minimum_amount_due

    object

    The currency and amount of the minimum allowed for a partial payment. Valid only when allow_partial_payment is true.
  • tax_calculated_after_discount

    boolean

    Indicates whether the tax is calculated before or after a discount. If false, the tax is calculated before a discount. If true, the tax is calculated after a discount.
  • tax_inclusive

    boolean

    Indicates whether the unit price includes tax.
  • terms

    string

    The general terms of the invoice.

    Maximum length: 4000.

  • note

    string

    A note to the invoice recipient. This note also appears on the invoice notification email.

    Maximum length: 4000.

  • merchant_memo

    string

    A private bookkeeping memo for the merchant.

    Maximum length: 150.

  • logo_url

    string

    The full URL to an external logo image. The logo image must not be larger than 250 pixels wide by 90 pixels high.

    Maximum length: 4000.

  • total_amount

    object

    The currency and amount of the invoice total.

    Read only.

  • attachments

    array (contains the file_attachment object)

    An array of PayPal file IDs for the files that are attached to an invoice. The maximum number of files is 5.

template_settings

  • field_name

    enum

    The field name in template_data for which to map corresponding display preferences.

    Possible values: items.quantity, items.description, items.date, items.discount, items.tax, discount, shipping, custom.

  • display_preference

    object

    The template settings metadata.

template_settings_metadata

  • hidden

    boolean

    Indicates whether to show or hide this field.

templates

  • addresses

    array (contains the address object)

    An array of postal addresses in the user's PayPal profile.
  • emails

    array (contains the email object)

    An array of email addresses in the user's PayPal profile.
  • phones

    array (contains the phone object)

    An array of phone numbers in the user's PayPal profile.
  • templates

    array (contains the template object)

    The details for each template. If fields is none, returns only the template name, ID, and default status.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

    Read only.

Additional API information

Error messages

In addition to common HTTP status codes that the REST APIs return, the Invoicing API can return the following errors.

  • AUTHORIZATION_ERROR

    Authorization error occurred. Check your credentials.

  • BUSINESS_ERROR

    Invoicing business error. See the message for a brief description of the error.

  • INTERNAL_SERVICE_ERROR

    An internal service error has occurred. Resend the request at another time. If this error continues, contact PayPal Merchant Technical Support.

  • MALFORMED_REQUEST_ERROR

    JSON request malformed. Correct the JSON request body and resend the request.

  • RESOURCE_NOT_FOUND_ERROR

    Resource not found. The resource was not found.

  • UNKNOWN_ERROR

    Unknown exception occurred. If this error continues, contact PayPal Merchant Technical Support.

  • USER_BUSINESS_ERROR

    User business error. See the message for a brief description of the error.

  • VALIDATION_ERROR

    Invalid request - see details. One or more validation errors have occurred. Review the details for specific validation errors.

Feedback

Have feedback?

Let us know.