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