Prerequisites
- Get your access token.
- Use Postman to test the PayPal APIs.
- Use the sandbox environment.
Simulation methods
You can simulate responses in two ways: JSON pointer method or the path parameter method.JSON pointer method
The following sample code shows a simulated request with a test value and the sandbox response.
Request [expandable]
Response
Path parameter method
Use test value in the request URI. This simulates a response.
The following sample code shows a simulated request with a test value and the sandbox response.
Request
Response
Test values
Note: Test values are case sensitive.The following test values simulate different responses for each Invoicing API operation. Each operation shows where to insert the test value and the response you can expect.
Generate invoice number
Use the path parameter in the request URI atPOST /v2/invoicing/invoices/generate-next-invoice-number to simulate the following error responses.
Create invoices
Use the JSON pointer method atPOST /v2/invoicing/invoices/ to simulate the following error responses.
Get invoice
Use the path parameter in the request URI atGET /v2/invoicing/invoices/{invoice_id} to simulate the following error responses.
Delete invoice
Use the path parameter in the request URI to simulate the following response atDELETE /v2/invoicing/invoices/{invoice_id}.
Success
Error
Update the invoice
Use the path parameter in the request URI to simulate the following error response atPUT /v2/invoicing/invoices/{invoice_id}.
Cancel a sent invoice
Use the path parameter in the request URI to simulate the following response atPOST /v2/invoicing/invoices/{invoice_id}/cancel.
Success
Error
Record payment for invoice
Use the path parameter in the request URI to simulate the following response atPOST /v2/invoicing/invoices/{invoice_id}/payments.
Success
Error
Delete payment
Use the path parameter in the request URI to simulate the following response atDELETE /v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/payments/{transaction_id}.
Success
Error
Record refund for invoice
Use the path parameter in the request URI to simulate the following response atPOST /v2/invoicing/invoices/{invoice_id}/refunds:
Success
Error
Delete refund
Use the path parameter in the request URI to simulate the following response atDELETE /v2/invoicing/invoices/{invoice_id}/refunds/{transaction_id}.
Success
Error
Send invoice reminder
Use the path parameter in the request URI to simulate the following response atPOST /v2/invoicing/invoices/{invoice_id}/remind.
Success
Error
Send invoice
Use the path parameter in the request URI to simulate the following response atPOST /v2/invoicing/invoices/{invoice_id}/send.
Success
Error
Search invoices
Use the path parameter in the request URI to simulate the following error responses atPOST /v2/invoicing/search-invoices.