CreateAndSendInvoice API Operation
Last updated: Aug 15th, 5:58am
Creates an invoice and sends it to a customer.
Example
This example creates and sends an invoice using CreateAndSendInvoice
.
1curl https://svcs.sandbox.paypal.com/Invoice/CreateAndSendInvoice \2 -s \3 --insecure \4 -H "X-PAYPAL-SECURITY-USERID: <var>Your_API_username</var>" \5 -H "X-PAYPAL-SECURITY-PASSWORD: <var>Your_API_password</var>" \6 -H "X-PAYPAL-SECURITY-SIGNATURE: <var>Your_API_signature</var>" \7 -H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" \8 -H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" \9 -H "X-PAYPAL-APPLICATION-ID: <var>Your_AppID</var>" \10 -d requestEnvelope.errorLanguage=en_US \11 -d invoice.merchantEmail=merchant%40domain.com \12 -d invoice.payerEmail=jbui-us-business2%40paypal.com \13 -d invoice.currencyCode=USD \14 -d invoice.itemList.item(0).name=Banana+Leaf+--+001 \15 -d invoice.itemList.item(0).description=Banana+Leaf \16 -d invoice.itemList.item(0).quantity=1 \17 -d invoice.itemList.item(0).unitPrice=1 \18 -d invoice.itemList.item(0).taxName=Tax1 \19 -d invoice.itemList.item(0).taxRate=10.25 \20 -d invoice.paymentTerms=Net10 \21 -d invoice.logoUrl=https%3A%2F%2Fexample.com%2FYour_logo.jpg
CreateAndSendInvoiceRequest Message
Use the CreateAndSendInvoiceRequest
message to create a new invoice and send it to a customer. The requester should authenticate the caller and verify that the merchant requesting the invoice has an existing PayPal account in good standing. Once the invoice is created, PayPal sends it to the specified payer, who is notified of the pending invoice.
RequestEnvelope Fields
Field | Description |
---|---|
|
|
|
|
CreateAndSendInvoiceRequest Fields
Field | Description |
---|---|
|
|
|
|
InvoiceType Fields
Field | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To specify
If the
If the
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BusinessInfoType Fields
Field | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
If the payer has a PayPal account, this field is ignored and the payer's language is used. Specify the You can specify one of these values:
|
|
|
|
|
|
|
BaseAddress Fields
Field | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InvoiceItemListType Fields
Field | Description |
---|---|
|
|
InvoiceItemType Fields
Field | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateAndSendInvoiceResponse Message
The CreateAndSendInvoiceResponse
message contains information returned in response to a CreateAndSendInvoiceRequest
message. The response contains an invoice ID and the URL to the invoice on the PayPal system, and indicates whether the invoice was sent successfully.
ResponseEnvelope Fields
Field | Description |
---|---|
|
|
|
|
|
|
|
|
CreateAndSendInvoiceResponse Fields
Field | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
PPFault Message
The PPFaultMessage
returns ErrorData
and the ResponseEnvelope
information to your application if an error occurs.
FaultMessage Fields
Field | Description |
---|---|
|
|
|
|
ErrorData Fields
Field | Description |
---|---|
|
|
|
|
|
|
| This field is not used. |
|
|
|
|
|
|
| This field is not used. |
ResponseEnvelope Fields
Field | Description |
---|---|
|
|
|
|
|
|
|
|
CreateAndSendInvoice API Errors
Code | Message |
---|---|
520002 | Internal error. |
520003 | Authentication failed. API credentials are incorrect. |
520009 | Account is restricted. |
570045 | The number of items exceeds this allowed limit. |
570046 | The due date occurs before the invoice date. |
570048 | A tax name can only be associated with one unique tax rate on a single invoice; the following tax name is associated to different rates on this invoice. |
570049 | The total amount for the invoice cannot be negative. |
570050 | The merchant's PayPal account cannot be the same as the payer's account; merchant and payer email addresses presently link to the same account. |
570051 | Invoice cannot have more than 10 different taxes. |
570054 | Invalid token. |
570058 | Authentication failed. User account is not confirmed. |
571009 | You cannot send this invoice because payer email is not specified. |
570059 | Invoice number is too long. |
580022 | This error code corresponds to validation error messages that deal with errors of supplied parameters. |
580045 | Merchant does not have a PayPal account associated with this email address. |
580046 | An invoice already exists for the merchant with this invoice number. |