1curl -v -X POST 'https://api-m.sandbox.paypal.com/v2/invoicing/invoices' \2 -H 'Content-Type: application/json' \3 -H 'Authorization: Bearer ACCESS-TOKEN' \4 -H 'PayPal-Auth-Assertion: PAYPAL-AUTH-ASSERTION' \5 -H 'PayPal-Partner-Attribution-Id: BN-CODE' \6 -d '{7 "detail": {8 "invoice_number": "123",9 "reference": "deal-ref",10 "invoice_date": "2028-11-22",11 "currency_code": "USD",12 "note": "Thank you for your business.",13 "term": "No refunds after 30 days.",14 "memo": "This is a long contract",15 "payment_term": {16 "term_type": "DUE_ON_DATE_SPECIFIED",17 "due_date": "2028-11-22"18 }19 },20 "invoicer": {21 "name": {22 "given_name": "David",23 "surname": "Larusso"24 },25 "address": {26 "address_line_1": "1234 First Street",27 "address_line_2": "337673 Hillside Court",28 "admin_area_2": "Anytown",29 "admin_area_1": "CA",30 "postal_code": "98765",31 "country_code": "US"32 },33 "email_address": "merchant@example.com",34 "phones": [35 {36 "country_code": "001",37 "national_number": "4085551234",38 "phone_type": "MOBILE"39 }40 ],41 "website": "https://example.com",42 "tax_id": "XX-XXXXXXX",43 "logo_url": "https://example.com/logo.PNG",44 "additional_notes": "example note"45 },46 "primary_recipients": [47 {48 "billing_info": {49 "name": {50 "given_name": "Stephanie",51 "surname": "Meyers"52 },53 "address": {54 "address_line_1": "1234 Main Street",55 "admin_area_2": "Anytown",56 "admin_area_1": "CA",57 "postal_code": "98765",58 "country_code": "US"59 },60 "email_address": "payer@example.com",61 "phones": [62 {63 "country_code": "001",64 "national_number": "4884551234",65 "phone_type": "HOME"66 }67 ],68 "additional_info_value": "add-info"69 },70 "shipping_info": {71 "name": {72 "given_name": "Stephanie",73 "surname": "Meyers"74 },75 "address": {76 "address_line_1": "1234 Main Street",77 "admin_area_2": "Anytown",78 "admin_area_1": "CA",79 "postal_code": "98765",80 "country_code": "US"81 }82 }83 }84 ],85 "items": [86 {87 "name": "Yoga mat",88 "description": "Elastic mat to practice yoga.",89 "quantity": "1",90 "unit_amount": {91 "currency_code": "USD",92 "value": "50.00"93 },94 "tax": {95 "name": "Sales Tax",96 "percent": "7.25"97 },98 "discount": {99 "percent": "5"100 },101 "unit_of_measure": "QUANTITY"102 },103 {104 "name": "Yoga t-shirt",105 "quantity": "1",106 "unit_amount": {107 "currency_code": "USD",108 "value": "10.00"109 },110 "tax": {111 "name": "Sales Tax",112 "percent": "7.25"113 },114 "discount": {115 "amount": {116 "currency_code": "USD",117 "value": "5.00"118 }119 },120 "unit_of_measure": "QUANTITY"121 }122 ],123 "configuration": {124 "partial_payment": {125 "allow_partial_payment": true,126 "minimum_amount_due": {127 "currency_code": "USD",128 "value": "20.00"129 }130 },131 "allow_tip": true,132 "tax_calculated_after_discount": true,133 "tax_inclusive": false,134 "template_id": ""135 },136 "amount": {137 "breakdown": {138 "custom": {139 "label": "Packing Charges",140 "amount": {141 "currency_code": "USD",142 "value": "10.00"143 }144 },145 "shipping": {146 "amount": {147 "currency_code": "USD",148 "value": "10.00"149 },150 "tax": {151 "name": "Sales Tax",152 "percent": "7.25"153 }154 },155 "discount": {156 "invoice_discount": {157 "percent": "5"158 }159 }160 }161 }162 }'
This sample request creates an invoice:
- From sender David Larusso, including address, email address, and phone number.
- To recipient Stephanie Meyers, including address, email address, and phone number.
- For one $50 yoga mat including sales tax.
- For one $10 t-shirt including sales tax.
- With $20 minimum partial payments enabled.
- With an optional tip.
- With $10 packing charges and $10 shipping charges including sales tax.
- With a 5% invoice discount.