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 the Invoicing Overview and the Invoicing Integration Guide.
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..
The invoice details which includes all information of the invoice like items, billing information.
OK
{- "detail": {
- "currency_code": "USD",
- "invoice_number": "#123",
- "reference": "deal-ref",
- "invoice_date": "2018-11-12",
- "note": "Thank you for your business.",
- "term": "No refunds after 30 days.",
- "memo": "This is a long contract",
- "payment_term": {
- "term_type": "NET_10",
- "due_date": "2018-11-22"
}
}, - "invoicer": {
- "name": {
- "given_name": "David",
- "surname": "Larusso"
}, - "address": {
- "address_line_1": "1234 First Street",
- "address_line_2": "337673 Hillside Court",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "merchant@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4085551234",
- "phone_type": "MOBILE"
}
], - "website": "www.test.com",
- "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy- Jb5SeuGj185MNNw6g",
- "additional_notes": "2-4"
}, - "primary_recipients": [
- {
- "billing_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "bill-me@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4884551234",
- "phone_type": "HOME"
}
], - "additional_info_value": "add-info"
}, - "shipping_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}
}
}
], - "items": [
- {
- "name": "Yoga Mat",
- "description": "Elastic mat to practice yoga.",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "50.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25"
}, - "discount": {
- "percent": "5"
}, - "unit_of_measure": "QUANTITY"
}, - {
- "name": "Yoga t-shirt",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25"
}, - "discount": {
- "amount": {
- "currency_code": "USD",
- "value": "5.00"
}
}, - "unit_of_measure": "QUANTITY"
}
], - "configuration": {
- "partial_payment": {
- "allow_partial_payment": true,
- "minimum_amount_due": {
- "currency_code": "USD",
- "value": "20.00"
}
}, - "allow_tip": true,
- "tax_calculated_after_discount": true,
- "tax_inclusive": false,
- "template_id": "TEMP-19V05281TU309413B"
}, - "amount": {
- "breakdown": {
- "custom": {
- "label": "Packing Charges",
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}
}, - "shipping": {
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25"
}
}, - "discount": {
- "invoice_discount": {
- "percent": "5"
}
}
}
}
}
{- "id": "INV2-Z56S-5LLA-Q52L-CPZ5",
- "status": "DRAFT",
- "detail": {
- "invoice_number": "#123",
- "reference": "deal-ref",
- "invoice_date": "2018-11-12",
- "currency_code": "USD",
- "note": "Thank you for your business.",
- "term": "No refunds after 30 days.",
- "memo": "This is a long contract",
- "payment_term": {
- "term_type": "NET_10",
- "due_date": "2018-11-22"
}, - "metadata": {
- "create_time": "2018-11-12T08:00:20Z",
}
}, - "invoicer": {
- "name": {
- "given_name": "David",
- "surname": "Larusso"
}, - "address": {
- "address_line_1": "1234 First Street",
- "address_line_2": "337673 Hillside Court",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "merchant@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4085551234",
- "phone_type": "MOBILE"
}
], - "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
- "additional_notes": "2-4"
}, - "primary_recipients": [
- {
- "billing_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "bill-me@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4884551234",
- "phone_type": "HOME"
}
], - "additional_info_value": "add-info"
}, - "shipping_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}
}
}
], - "items": [
- {
- "name": "Yoga Mat",
- "description": "Elastic mat to practice yoga.",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "50.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "3.27"
}
}, - "discount": {
- "percent": "5",
- "amount": {
- "currency_code": "USD",
- "value": "2.5"
}
}, - "unit_of_measure": "QUANTITY"
}, - {
- "name": "Yoga T Shirt",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "0.34"
}
}, - "discount": {
- "amount": {
- "currency_code": "USD",
- "value": "5.00"
}
}, - "unit_of_measure": "QUANTITY"
}
], - "configuration": {
- "partial_payment": {
- "allow_partial_payment": true,
- "minimum_amount_due": {
- "currency_code": "USD",
- "value": "20.00"
}
}, - "allow_tip": true,
- "tax_calculated_after_discount": true,
- "tax_inclusive": false,
- "template_id": "TEMP-19V05281TU309413B"
}, - "amount": {
- "currency_code": "USD",
- "value": "74.21",
- "breakdown": {
- "item_total": {
- "currency_code": "USD",
- "value": "60.00"
}, - "custom": {
- "label": "Packing Charges",
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}
}, - "shipping": {
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "0.73"
}
}
}, - "discount": {
- "item_discount": {
- "currency_code": "USD",
- "value": "-7.50"
}, - "invoice_discount": {
- "percent": "5",
- "amount": {
- "currency_code": "USD",
- "value": "-2.63"
}
}
}, - "tax_total": {
- "currency_code": "USD",
- "value": "4.34"
}
}
}, - "due_amount": {
- "currency_code": "USD",
- "value": "74.21"
}, - "links": [
- {
- "rel": "self",
- "method": "GET"
}, - {
- "rel": "send",
- "method": "POST"
}, - {
- "rel": "replace",
- "method": "PUT"
}, - {
- "rel": "delete",
- "method": "DELETE"
}, - {
- "rel": "record-payment",
- "method": "POST"
}, - {
- "rel": "qr-code",
- "method": "POST"
}
]
}
Lists invoices. To filter the invoices that appear in the response, you can specify one or more optional query parameters.
A successful request returns the HTTP 200 OK
status code and a JSON response body that lists invoices with details.
curl -v -X GET https://api-m.sandbox.paypal.com/v2/invoicing/invoices?total_required=true \ -H 'Authorization: Bearer zekwhYgsYYI0zDg0p_Nf5v78VelCfYR0' \ -H 'Content-Type: application/json'
{- "total_items": 2,
- "total_pages": 1,
- "items": [
- {
- "id": "INV2-Z56S-5LLA-Q52L-CPZ5",
- "status": "DRAFT",
- "detail": {
- "invoice_number": "#123",
- "reference": "deal-ref",
- "invoice_date": "2018-11-12",
- "currency_code": "USD",
- "note": "Thank you for your business.",
- "term": "No refunds after 30 days.",
- "memo": "This is a long contract",
- "payment_term": {
- "term_type": "NET_10",
- "due_date": "2018-11-22"
}, - "metadata": {
- "create_time": "2018-11-12T08:00:20Z",
}
}, - "invoicer": {
- "email_address": "merchant@example.com"
}, - "primary_recipients": [
- {
- "billing_info": {
- "email_address": "bill-me@example.com"
}
}
], - "amount": {
- "currency_code": "USD",
- "value": "74.21"
}, - "links": [
- {
- "rel": "self",
- "method": "GET"
}, - {
- "rel": "send",
- "method": "POST"
}, - {
- "rel": "replace",
- "method": "PUT"
}, - {
- "rel": "delete",
- "method": "DELETE"
}
]
}, - {
- "id": "INV2-NP6M-C9A8-ZBDA-3TEX",
- "status": "SCHEDULED",
- "detail": {
- "invoice_number": "0001",
- "invoice_date": "2018-05-14",
- "currency_code": "USD",
- "payment_term": {
- "due_date": "2018-05-15"
}, - "metadata": {
- "create_time": "2018-05-15T17:24:12Z"
}
}, - "invoicer": {
- "email_address": "merchant@example.com"
}, - "primary_recipients": [
- {
- "billing_info": {
- "email_address": "recipient@example.com"
}
}
], - "amount": {
- "currency_code": "USD",
- "value": "32.00"
}, - "links": [
- {
- "rel": "self",
- "method": "GET"
}, - {
- "rel": "replace",
- "method": "PUT"
}, - {
- "rel": "delete",
- "method": "DELETE"
}, - {
- "rel": "record-payment",
- "method": "POST"
}
]
}
], - "links": [
- {
- "rel": "self",
- "method": "GET"
}
]
}
Sends or schedules an invoice, by ID, to be sent to a customer. The action depends on the invoice issue date:
send_to_invoicer
body parameter to false
. To send the invoice through a share link and not through PayPal, set the send_to_recipient
parameter to false
in the notification
object. The send_to_recipient
parameter does not apply to a future issue date because the invoice is scheduled to be sent through PayPal on that date.Notes:
- After you send an invoice, resending it has no effect.
- To send a notification for updates, update the invoice and set the
send_to_recipient
body parameter totrue
.
The email or SMS notification to send to the payer when they send an invoice..
A successful request returns the HTTP 202 Accepted
status code with no JSON response body, when the invoice issue date is in future.
{- "send_to_invoicer": true
}
{- "links": [
- {
- "href": "string",
- "rel": "string",
- "method": "GET"
}
]
}
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.
The email or SMS notification that will be sent to the payer for reminder.
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
{- "subject": "Reminder: Payment due for the invoice #ABC-123",
- "note": "Please pay before the due date to avoid incurring late payment charges which will be adjusted in the next bill generated.",
- "send_to_invoicer": true,
- "additional_recipients": [
- "customer-a@example.com",
- "customer@example.com"
]
}
Cancels a sent invoice, by ID, and, optionally, sends a notification about the cancellation to the payer, merchant, and CC: emails.
The email or SMS notification that will be sent to the payer on cancellation.
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
{- "subject": "Invoice Cancelled",
- "note": "Cancelling the invoice",
- "send_to_invoicer": true,
- "send_to_recipient": true,
- "additional_recipients": [
- "user@example.com"
]
}
Records a payment for the invoice. If no payment is due, the invoice is marked as PAID
. Otherwise, the invoice is marked as PARTIALLY PAID
.
The details of the payment to record against the invoice.
payment_id | string <= 22 characters The ID for a PayPal payment transaction. Required for the | ||||||||||||||||||
note | string <= 2000 characters A note associated with an external cash or check payment. | ||||||||||||||||||
payment_date | string <ppaas_date_notime_v2> (date_no_time) = 10 characters ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|... The stand-alone date, in Internet date and time format. To represent special legal values, such as a date of birth, you should use dates with no associated time or time-zone data. Whenever possible, use the standard | ||||||||||||||||||
method required | string (payment_method) The payment mode or method through which the invoicer can accept the payment.
| ||||||||||||||||||
object (Money) The currency and amount for a financial transaction, such as a balance or payment due. | |||||||||||||||||||
object (contact_information) The contact information of the user. Includes name and address. |
A successful request returns the HTTP 200 Created
status code and a reference to the recorded payment.
{- "method": "BANK_TRANSFER",
- "payment_date": "2018-05-01",
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}
}
{- "payment_id": "EXTR-86F38350LX4353815"
}
Deletes an external payment, by invoice ID and transaction ID.
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
curl -v -X DELETE https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5/payments/EXTR-86F38350LX4353815 \ -H 'Authorization: Bearer zekwhYgsYYI0zDg0p_Nf5v78VelCfYR0'
Records a refund for the invoice. If all payments are refunded, the invoice is marked as REFUNDED
. Otherwise, the invoice is marked as PARTIALLY REFUNDED
.
The details of the refund to record against the invoice.
refund_date | string <ppaas_date_notime_v2> (date_no_time) = 10 characters ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|... The stand-alone date, in Internet date and time format. To represent special legal values, such as a date of birth, you should use dates with no associated time or time-zone data. Whenever possible, use the standard | ||||||||||||||||||
object (Money) The currency and amount for a financial transaction, such as a balance or payment due. | |||||||||||||||||||
method required | string (payment_method) The payment mode or method through which the invoicer can accept the payments.
|
A successful request returns the HTTP 200 Created
status code and a reference to the recorded refund.
{- "method": "BANK_TRANSFER",
- "refund_date": "2018-05-21",
- "amount": {
- "currency_code": "USD",
- "value": "5.00"
}
}
{- "refund_id": "EXTR-2LG703375E477444T"
}
Deletes an external refund, by invoice ID and transaction ID.
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
curl -v -X DELETE https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-333R-YUQL-YNNN-D7WF/refunds/EXTR-2LG703375E477444T \ -H 'Authorization: Bearer zekwhYgsYYI0zDg0p_Nf5v78VelCfYR0'
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.
Optional configuration parameters to adjust QR code width, height and the encoded URL.
A successful request returns the HTTP 200 OK
status code and a JSON response body that shows the QR code as a PNG image.
{- "width": 400,
- "height": 400
}
"--95dbdbed-7536-4c24-b5ca-bcdbc0006612 Content-Disposition: form-data; name=\"image\" Content-Type: application/octet-stream iVBORw0KGgoAAAANSUhEUgAAAJYAAACWAQAAAAAUekxPAAABxUlEQVR42u2WMY7kIBBFq0VA1n0BS1yDjCvZF7DxBdxXIuMaSFzAzgiQaz6t9mxLm1AbrCYYy4H1AlT1f9XHxH89lX7Z/2KJKN3CMIW6FCInYplLPtisoU6FTyHzti6RN5tPm+5ixrtTp0uP8g8s744eMS1yxvikNEOJz966GPTLaOL1fmjaxfAkaLCy2t2Hl10sPUIaNY1araFhCat3TbODDPkZ68Ii1sqfX62c1rzP62W8uWG0aiMaxSyvpS4hez2MzXkZg+FL4NNCwku/XtZ8g/Be550+Pe9jWj0x41rt1ngZyxzYa+NpmDjNMlYx1yhhs2glM8vY3IQ3qGWz9Tqvk7F3cGyYNd3KQDKGSWFGDjFNIZ8yhuWgR8gb5jR8+9bJ8rPUCd3oYbY4VcQqaWSYWRGcdnhnSS+D6lhKJIE5+JrTXtaquDtzuuypXrV0stRKwLAUzFodnYjxERP28ihtLw8WsbQE7JbxCD9SmxMxfsUYpiZ7lxYWMewltzuqKMz4n13tYi3vl6jW2FJQynBH+Za7Zie6sZRhNVXLTkqTmGUE5xSRu5dv3Qz3uYdj0bwkFLGWfxxoJMXx28tO9vu/9oPYF0bR/hBeOiwMAAAAAElFTkSuQmCC --95dbdbed-7536-4c24-b5ca-bcdbc0006612--"
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
.
A successful request returns the HTTP 200 OK
status code and a JSON response body that shows the next invoice number.
curl -v -X POST https://api-m.sandbox.paypal.com/v2/invoicing/generate-next-invoice-number \ -H 'Authorization: Bearer zekwhYgsYYI0zDg0p_Nf5v78VelCfYR0' \ -H 'Content-Type: application/json'
{- "invoice_number": "ee0044"
}
Shows details for an invoice, by ID.
A successful request returns the HTTP 200 OK
status code and a JSON response body that shows invoice details.
curl -v -X GET https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5 \ -H 'Authorization: Bearer zekwhYgsYYI0zDg0p_Nf5v78VelCfYR0' \ -H 'Content-Type: application/json'
{- "id": "INV2-Z56S-5LLA-Q52L-CPZ5",
- "status": "DRAFT",
- "detail": {
- "invoice_number": "#123",
- "reference": "deal-ref",
- "invoice_date": "2018-11-12",
- "currency_code": "USD",
- "note": "Thank you for your business.",
- "term": "No refunds after 30 days.",
- "memo": "This is a long contract",
- "payment_term": {
- "term_type": "NET_10",
- "due_date": "2018-11-22"
}, - "metadata": {
- "create_time": "2018-11-12T08:00:20Z",
}
}, - "invoicer": {
- "name": {
- "given_name": "David",
- "surname": "Larusso"
}, - "address": {
- "address_line_1": "1234 First Street",
- "address_line_2": "337673 Hillside Court",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "merchant@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4085551234",
- "phone_type": "MOBILE"
}
], - "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
- "additional_notes": "2-4"
}, - "primary_recipients": [
- {
- "billing_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "bill-me@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4884551234",
- "phone_type": "HOME"
}
], - "additional_info_value": "add-info"
}, - "shipping_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}
}
}
], - "items": [
- {
- "name": "Yoga Mat",
- "description": "Elastic mat to practice yoga.",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "50.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "3.27"
}
}, - "discount": {
- "percent": "5",
- "amount": {
- "currency_code": "USD",
- "value": "2.5"
}
}, - "unit_of_measure": "QUANTITY"
}, - {
- "name": "Yoga T Shirt",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "0.34"
}
}, - "discount": {
- "amount": {
- "currency_code": "USD",
- "value": "5.00"
}
}, - "unit_of_measure": "QUANTITY"
}
], - "configuration": {
- "partial_payment": {
- "allow_partial_payment": true,
- "minimum_amount_due": {
- "currency_code": "USD",
- "value": "20.00"
}
}, - "allow_tip": true,
- "tax_calculated_after_discount": true,
- "tax_inclusive": false,
- "template_id": "TEMP-19V05281TU309413B"
}, - "amount": {
- "currency_code": "USD",
- "value": "74.21",
- "breakdown": {
- "item_total": {
- "currency_code": "USD",
- "value": "60.00"
}, - "custom": {
- "label": "Packing Charges",
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}
}, - "shipping": {
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "0.73"
}
}
}, - "discount": {
- "item_discount": {
- "currency_code": "USD",
- "value": "-7.50"
}, - "invoice_discount": {
- "percent": "5",
- "amount": {
- "currency_code": "USD",
- "value": "-2.63"
}
}
}, - "tax_total": {
- "currency_code": "USD",
- "value": "4.34"
}
}
}, - "due_amount": {
- "currency_code": "USD",
- "value": "74.21"
}, - "links": [
- {
- "rel": "self",
- "method": "GET"
}, - {
- "rel": "send",
- "method": "POST"
}, - {
- "rel": "replace",
- "method": "PUT"
}, - {
- "rel": "delete",
- "method": "DELETE"
}, - {
- "rel": "record-payment",
- "method": "POST"
}, - {
- "rel": "qr-code",
- "method": "POST"
}
]
}
Fully updates an invoice, by ID. In the JSON request body, include a complete invoice
object. This call does not support partial updates.
A representation of changes to make in the invoice.
A successful request returns the HTTP 200 OK
status code. A JSON response body that shows invoice details is returned if you set prefer=return=representation
.
{- "detail": {
- "currency_code": "USD",
- "invoice_number": "#123",
- "reference": "deal-refernce-update",
- "invoice_date": "2018-11-12",
- "note": "Thank you for your business.",
- "term": "No refunds after 30 days.",
- "memo": "This is a long contract",
- "payment_term": {
- "term_type": "NET_10",
- "due_date": "2018-11-22"
}
}, - "id": "INV2-C82X-JNN9-Y6S5-CNXW",
- "status": "DRAFT",
- "invoicer": {
- "name": {
- "given_name": "David",
- "surname": "Larusso"
}, - "address": {
- "address_line_1": "1234 First Street",
- "address_line_2": "337673 Hillside Court",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "merchant@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4085551234",
- "phone_type": "MOBILE"
}
], - "website": "www.test.com",
- "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
- "additional_notes": "2-4"
}, - "primary_recipients": [
- {
- "billing_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "bill-me@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4884551234",
- "phone_type": "HOME"
}
], - "additional_info_value": "add-info"
}, - "shipping_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}
}
}
], - "items": [
- {
- "name": "Yoga Mat",
- "description": "Elastic mat to practice yoga.",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "50.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "3.27"
}
}, - "discount": {
- "percent": "5",
- "amount": {
- "currency_code": "USD",
- "value": "2.5"
}
}, - "unit_of_measure": "QUANTITY"
}, - {
- "name": "Yoga t-shirt",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "0.34"
}
}, - "discount": {
- "amount": {
- "currency_code": "USD",
- "value": "5.00"
}
}, - "unit_of_measure": "QUANTITY"
}
], - "configuration": {
- "partial_payment": {
- "allow_partial_payment": true,
- "minimum_amount_due": {
- "currency_code": "USD",
- "value": "20.00"
}
}, - "allow_tip": true,
- "tax_calculated_after_discount": true,
- "tax_inclusive": false,
- "template_id": "TEMP-19V05281TU309413B"
}, - "amount": {
- "currency_code": "USD",
- "value": "74.21",
- "breakdown": {
- "item_total": {
- "currency_code": "USD",
- "value": "60.00"
}, - "custom": {
- "label": "Packing Charges",
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}
}, - "shipping": {
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "0.73"
}
}
}, - "discount": {
- "item_discount": {
- "currency_code": "USD",
- "value": "-7.50"
}, - "invoice_discount": {
- "percent": "5",
- "amount": {
- "currency_code": "USD",
- "value": "-2.63"
}
}
}, - "tax_total": {
- "currency_code": "USD",
- "value": "4.34"
}
}
}
}
{- "id": "INV2-C82X-JNN9-Y6S5-CNXW",
- "status": "DRAFT",
- "detail": {
- "invoice_number": "#123",
- "reference": "deal-refernce-update",
- "invoice_date": "2018-11-12",
- "currency_code": "USD",
- "note": "Thank you for your business.",
- "term": "No refunds after 30 days.",
- "memo": "This is a long contract",
- "payment_term": {
- "term_type": "NET_10",
- "due_date": "2018-11-22"
}, - "metadata": {
- "create_time": "2018-11-12T08:00:20Z",
}
}, - "invoicer": {
- "name": {
- "given_name": "David",
- "surname": "Larusso"
}, - "address": {
- "address_line_1": "1234 First Street",
- "address_line_2": "337673 Hillside Court",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "merchant@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4085551234",
- "phone_type": "MOBILE"
}
], - "tax_id": "ABcNkWSfb5ICTt73nD3QON1fnnpgNKBy-Jb5SeuGj185MNNw6g",
- "additional_notes": "2-4"
}, - "primary_recipients": [
- {
- "billing_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}, - "email_address": "bill-me@example.com",
- "phones": [
- {
- "country_code": "001",
- "national_number": "4884551234",
- "phone_type": "HOME"
}
], - "additional_info_value": "add-info"
}, - "shipping_info": {
- "name": {
- "given_name": "Stephanie",
- "surname": "Meyers"
}, - "address": {
- "address_line_1": "1234 Main Street",
- "admin_area_2": "Anytown",
- "admin_area_1": "CA",
- "postal_code": "98765",
- "country_code": "US"
}
}
}
], - "items": [
- {
- "name": "Yoga Mat",
- "description": "Elastic mat to practice yoga.",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "50.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "3.27"
}
}, - "discount": {
- "percent": "5",
- "amount": {
- "currency_code": "USD",
- "value": "2.5"
}
}, - "unit_of_measure": "QUANTITY"
}, - {
- "name": "Yoga t-shirt",
- "quantity": "1",
- "unit_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "0.34"
}
}, - "discount": {
- "amount": {
- "currency_code": "USD",
- "value": "5.00"
}
}, - "unit_of_measure": "QUANTITY"
}
], - "configuration": {
- "partial_payment": {
- "allow_partial_payment": true,
- "minimum_amount_due": {
- "currency_code": "USD",
- "value": "20.00"
}
}, - "allow_tip": true,
- "tax_calculated_after_discount": true,
- "tax_inclusive": false,
- "template_id": "TEMP-19V05281TU309413B"
}, - "amount": {
- "currency_code": "USD",
- "value": "74.21",
- "breakdown": {
- "item_total": {
- "currency_code": "USD",
- "value": "60.00"
}, - "custom": {
- "label": "Packing Charges",
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}
}, - "shipping": {
- "amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "tax": {
- "name": "Sales Tax",
- "percent": "7.25",
- "amount": {
- "currency_code": "USD",
- "value": "0.73"
}
}
}, - "discount": {
- "item_discount": {
- "currency_code": "USD",
- "value": "-7.50"
}, - "invoice_discount": {
- "percent": "5",
- "amount": {
- "currency_code": "USD",
- "value": "-2.63"
}
}
}, - "tax_total": {
- "currency_code": "USD",
- "value": "4.34"
}
}
}, - "due_amount": {
- "currency_code": "USD",
- "value": "74.21"
}, - "links": [
- {
- "rel": "self",
- "method": "GET"
}, - {
- "rel": "send",
- "method": "POST"
}, - {
- "rel": "replace",
- "method": "PUT"
}, - {
- "rel": "delete",
- "method": "DELETE"
}
]
}
Deletes a draft or scheduled invoice, by ID. Deletes invoices in the draft or scheduled state only. 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.
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
curl -v -X DELETE https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-Z56S-5LLA-Q52L-CPZ5 \ -H 'Authorization: Bearer zekwhYgsYYI0zDg0p_Nf5v78VelCfYR0'