Skip to main content
Use test values to simulate error responses with the PayPal Invoicing API and verify that your application handles different scenarios correctly.

Prerequisites

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 at POST /v2/invoicing/invoices/generate-next-invoice-number to simulate the following error responses.

Create invoices

Use the JSON pointer method at POST /v2/invoicing/invoices/ to simulate the following error responses.

Get invoice

Use the path parameter in the request URI at GET /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 at DELETE /v2/invoicing/invoices/{invoice_id}.

Success

Error

Update the invoice

Use the path parameter in the request URI to simulate the following error response at PUT /v2/invoicing/invoices/{invoice_id}.

Cancel a sent invoice

Use the path parameter in the request URI to simulate the following response at POST /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 at POST /v2/invoicing/invoices/{invoice_id}/payments.

Success

Error

Delete payment

Use the path parameter in the request URI to simulate the following response at DELETE /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 at POST /v2/invoicing/invoices/{invoice_id}/refunds:

Success

Error

Delete refund

Use the path parameter in the request URI to simulate the following response at DELETE /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 at POST /v2/invoicing/invoices/{invoice_id}/remind.

Success

Error

Send invoice

Use the path parameter in the request URI to simulate the following response at POST /v2/invoicing/invoices/{invoice_id}/send.

Success

Error

Search invoices

Use the path parameter in the request URI to simulate the following error responses at POST /v2/invoicing/search-invoices.