On this page
No Headings
Last updated: June 10, 2026
Estimated time: 10 minutes
After completing this quickstart you will have:
Created a draft invoice in your sandbox account
Sent the invoice to a sandbox customer email address
Confirmed the invoice status has changed to UNPAID
POST request to create a draft invoice.POST request to send the invoice.UNPAID in your sandbox account.Start building with the Invoicing API using this quick-start guide to create, send, and manage invoices programmatically.
Open the PayPal Developer Dashboard, then create or select an app. Copy the Client ID and Secret. Use these credentials to generate an access token, and include that token in the Authorization header for every request.
Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with your sandbox app
credentials from the dashboard.
curl -X POST https://api-m.sandbox.paypal.com/v1/oauth2/token \
-H "Accept: application/json" \
-H "Accept-Language: en_US" \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d "grant_type=client_credentials"200 OK.ACCESS-TOKEN value from the response body. You'll use this value in Steps 2 and 3.Create a draft invoice in a single API call. The invoice is not visible to your customer yet. This step generates the invoice with all required details, such as customer, items, and amount, before sending to the customer. The invoice workflow is: Draft → Sent → Viewed → Paid (or Cancelled/Overdue).
This example creates a draft invoice. Save the returned id, then call the send invoice endpoint when you're ready to request payment.
ACCESS-TOKEN with your token from Step 1. - Replace
[email protected] with your sandbox personal account email.curl -X POST https://api-m.sandbox.paypal.com/v2/invoicing/invoices \
-H "Authorization: Bearer ACCESS-TOKEN" \
-H "Content-Type: application/json" \
-d '{
"detail": {
"currency_code": "USD",
"note": "Thanks for your business"
},
"invoicer": {
"name": {
"given_name": "Jane",
"surname": "Doe"
}
},
"primary_recipients": [
{
"billing_info": {
"email_address": "[email protected]"
}
}
],
"items": [
{
"name": "Website design",
"quantity": "1",
"unit_amount": {
"currency_code": "USD",
"value": "500.00"
}
}
]
}'201 Created.href link with your invoice ID (INV2-XXXX-XXXX-XXXX-XXXX).Draft status.In your sandbox account, send the draft invoice you created in the previous step. This moves the invoice from DRAFT to SENT status, and PayPal sends a secure payment link in the email to your customer. Use the id from step 2 and pass it as the invoice_id path parameter. To change details in the sent invoice, update the specific details using the PUT method and send_to_recipient: true to notify the customer. After you send an invoice, it cannot be deleted and can only be canceled to mark it as no longer active.
curl -v -X POST https://api-m.sandbox.paypal.com/v2/invoicing/invoices/{invoice_id}/send \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"send_to_recipient": true,
"send_to_invoicer": true
}'200 OK.UNPAID in your sandbox account.You should see:
UNPAID.If verification fails, see Troubleshooting.