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