Simulation Tests
Last updated: Aug 15th, 7:31am
In API calls to the PayPal sandbox, you can pass specific information in a request to trigger simulated positive and negative test scenarios. The simulated responses mimic live API responses without calling downstream services. You can handle these responses in your code to manage your customer’s experience.
Know before you code
- Complete the steps in Get started to get your sandbox account information from the Developer Dashboard:
- Access token
- Business account credentials
- Personal account credentials
- Make sure you have the most recent version of Postman.
How it works
Use the PayPal sandbox and our specific test scenarios to trigger different API flows and make sure you’ve handled them in your integration. To trigger the simulated response, choose from either of the following trigger methods:
The following sample requests show you how to use each method.
How to use a JSON pointer in the request payload
This sample request shows how to trigger a specific error response by passing a JSON pointer in the request payload.
Trigger | Test value | Simulated error response |
---|---|---|
detail/reference | ERRINV002 | PERMISSION_DENIED |
Request
1curl -X POST \2 https://api-m.sandbox.paypal.com/v2/invoicing/invoices \3 -H 'Authorization: Bearer <Access Token>' \4 -H 'Content-Type: application/json' \5 -d '{6 "detail":7 {8 "reference": "ERRINV002"9 }10}'
Response
1{2 "localizedMessage": "No permission for the requested operation. ",3 "name": "PERMISSION_DENIED",4 "message": "No permission for the requested operation. ",5 "details": [6 {7 "issue": "No permission for the requested operation. "8 }9 ],10 "information_link": "https://developer.paypal.com/docs/archive/permissions-service/",11 "debug_id": "6e07326c281c4"12}
How to use a path parameter in the request URI
This sample request shows how to trigger a specific error response by passing a path parameter in the request URI.
Trigger or test value | Simulated error response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0010 | INVOICE_NOT_FOUND |
Request
1curl -X GET \2 https://api-m.sandbox.paypal.com/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0010 \3 -H 'Authorization: Bearer <Access Token>' \4 -H 'Content-Type: application/json'
Response
1{2 "name": "RESOURCE_NOT_FOUND",3 "message": "The specified resource does not exist.",4 "debug_id": "98b2b9d2d89cb",5 "links": [6 {7 "href": "https://developer.paypal.com/docs/api/invoicing/#errors",8 "rel": "information_link"9 }10 ]11}
Disputes
To run the disputes simulation tests:
Download the Postman collection for the Disputes API:
Use the following test values to trigger negative responses for these disputes actions:
List disputes
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at GET /v1/customer/disputes?disputed_transaction_id={transaction_id}
.
Trigger or test value | Simulated error response |
---|---|
/v1/customer/disputes?disputed_transaction_id=ERRDIS023 | FORBIDDEN |
/v1/customer/disputes?disputed_transaction_id=ERRDIS024 | INVALID_RESOURCE_ID |
/v1/customer/disputes?disputed_transaction_id=ERRDIS025 | NOT_ACCEPTABLE |
/v1/customer/disputes?disputed_transaction_id=ERRDIS026 | UNSUPPORTED_MEDIA_TYPE |
/v1/customer/disputes?disputed_transaction_id=ERRDIS027 | RATE_LIMIT_REACHED |
/v1/customer/disputes?disputed_transaction_id=ERRDIS028 | SERVICE_UNAVAILABLE |
/v1/customer/disputes?disputed_transaction_id=ERRDIS029 | INTERNAL_SERVICE_ERROR |
/v1/customer/disputes?disputed_transaction_id=ERRDIS030 | AUTHORIZATION_ERROR |
/v1/customer/disputes?disputed_transaction_id=ERRDIS031 | VALIDATION_ERROR |
/v1/customer/disputes?disputed_transaction_id=ERRDIS032 | VALIDATION_ERROR |
/v1/customer/disputes?disputed_transaction_id=ERRDIS033 | VALIDATION_ERROR |
/v1/customer/disputes?disputed_transaction_id=ERRDIS034 | VALIDATION_ERROR |
Show dispute details
Negative response test values
Use the JSON pointer method to simulate the following error responses at GET /v1/customer/disputes/{dispute_id}
.
Trigger or test value | Simulated error response |
---|---|
/v1/customer/disputes/ERRDIS015 | FORBIDDEN |
/v1/customer/disputes/ERRDIS016 | INVALID_RESOURCE_ID |
/v1/customer/disputes/ERRDIS017 | NOT_ACCEPTABLE |
/v1/customer/disputes/ERRDIS018 | UNSUPPORTED_MEDIA_TYPE |
/v1/customer/disputes/ERRDIS019 | RATE_LIMIT_REACHED |
/v1/customer/disputes/ERRDIS020 | SERVICE_UNAVAILABLE |
/v1/customer/disputes/ERRDIS021 | INTERNAL_SERVICE_ERROR |
/v1/customer/disputes/ERRDIS022 | AUTHORIZATION_ERROR |
Send message to other party
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/customer/disputes/{dispute_id}/send-message
.
Trigger or test value | Simulated error response |
---|---|
/v1/customer/disputes/ERRDIS091/send-message | FORBIDDEN |
/v1/customer/disputes/ERRDIS092/send-message | INVALID_RESOURCE_ID |
/v1/customer/disputes/ERRDIS093/send-message | NOT_ACCEPTABLE |
/v1/customer/disputes/ERRDIS094/send-message | UNSUPPORTED_MEDIA_TYPE |
/v1/customer/disputes/ERRDIS095/send-message | RATE_LIMIT_REACHED |
/v1/customer/disputes/ERRDIS096/send-message | SERVICE_UNAVAILABLE |
/v1/customer/disputes/ERRDIS097/send-message | INTERNAL_SERVICE_ERROR |
/v1/customer/disputes/ERRDIS098/send-message | AUTHORIZATION_ERROR |
/v1/customer/disputes/ERRDIS099/send-message | UNPROCESSABLE_ENTITY |
Make offer to resolve dispute
Negative response test values
Use the path parameter in the request URI method to simulate the following response at POST /v1/customer/disputes/{dispute_id}/make-offer
.
Trigger or test value | Simulated error response |
---|---|
/v1/customer/disputes/ERRDIS100/make-offer | FORBIDDEN |
/v1/customer/disputes/ERRDIS101/make-offer | INVALID_RESOURCE_ID |
/v1/customer/disputes/ERRDIS102/make-offer | NOT_ACCEPTABLE |
/v1/customer/disputes/ERRDIS103/make-offer | UNSUPPORTED_MEDIA_TYPE |
/v1/customer/disputes/ERRDIS104/make-offer | RATE_LIMIT_REACHED |
/v1/customer/disputes/ERRDIS105/make-offer | SERVICE_UNAVAILABLE |
/v1/customer/disputes/ERRDIS106/make-offer | INTERNAL_SERVICE_ERROR |
/v1/customer/disputes/ERRDIS107/make-offer | AUTHORIZATION_ERROR |
/v1/customer/disputes/ERRDIS108/make-offer | UNPROCESSABLE_ENTITY |
Escalate dispute to claim
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/customer/disputes/{dispute_id}/escalate
.
Trigger or test value | Simulated response |
---|---|
/v1/customer/disputes/ERRDIS082/escalate | FORBIDDEN |
/v1/customer/disputes/ERRDIS083/escalate | INVALID_RESOURCE_ID |
/v1/customer/disputes/ERRDIS084/escalate | NOT_ACCEPTABLE |
/v1/customer/disputes/ERRDIS085/escalate | UNSUPPORTED_MEDIA_TYPE |
/v1/customer/disputes/ERRDIS086/escalate | RATE_LIMIT_REACHED |
/v1/customer/disputes/ERRDIS087/escalate | SERVICE_UNAVAILABLE |
/v1/customer/disputes/ERRDIS088/escalate | INTERNAL_SERVICE_ERROR |
/v1/customer/disputes/ERRDIS089/escalate | AUTHORIZATION_ERROR |
/v1/customer/disputes/ERRDIS090/escalate | UNPROCESSABLE_ENTITY |
Provide evidence
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/customer/disputes/{dispute_id}/provide-evidence
.
Trigger or test value | Simulated response |
---|---|
/v1/customer/disputes/ERRDIS035/provide-evidence | FORBIDDEN |
/v1/customer/disputes/ERRDIS036/provide-evidence | INVALID_RESOURCE_ID |
/v1/customer/disputes/ERRDIS037/provide-evidence | NOT_ACCEPTABLE |
/v1/customer/disputes/ERRDIS038/provide-evidence | UNSUPPORTED_MEDIA_TYPE |
/v1/customer/disputes/ERRDIS039/provide-evidence | RATE_LIMIT_REACHED |
/v1/customer/disputes/ERRDIS040/provide-evidence | SERVICE_UNAVAILABLE |
/v1/customer/disputes/ERRDIS041/provide-evidence | INTERNAL_SERVICE_ERROR |
/v1/customer/disputes/ERRDIS042/provide-evidence | AUTHORIZATION_ERROR |
/v1/customer/disputes/ERRDIS043/provide-evidence | UNPROCESSABLE_ENTITY |
/v1/customer/disputes/ERRDIS044/provide-evidence | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS045/provide-evidence | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS046/provide-evidence | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS047/provide-evidence | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS048/provide-evidence | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS049/provide-evidence | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS050/provide-evidence | VALIDATION_ERROR |
Accept claim
Negative response test values
Use the path parameter in the request URI method to simulate the following response at POST /v1/customer/disputes/{dispute_id}/accept-claim
.
Trigger or test value | Simulated response |
---|---|
/v1/customer/disputes/ERRDIS051/accept-claim | FORBIDDEN |
/v1/customer/disputes/ERRDIS052/accept-claim | INVALID_RESOURCE_ID |
/v1/customer/disputes/ERRDIS053/accept-claim | NOT_ACCEPTABLE |
/v1/customer/disputes/ERRDIS054/accept-claim | UNSUPPORTED_MEDIA_TYPE |
/v1/customer/disputes/ERRDIS055/accept-claim | RATE_LIMIT_REACHED |
/v1/customer/disputes/ERRDIS056/accept-claim | SERVICE_UNAVAILABLE |
/v1/customer/disputes/ERRDIS057/accept-claim | INTERNAL_SERVICE_ERROR |
/v1/customer/disputes/ERRDIS058/accept-claim | AUTHORIZATION_ERROR |
/v1/customer/disputes/ERRDIS059/accept-claim | UNPROCESSABLE_ENTITY |
/v1/customer/disputes/ERRDIS060/accept-claim | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS061/accept-claim | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS062/accept-claim | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS063/accept-claim | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS064/accept-claim | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS065/accept-claim | UNPROCESSABLE_ENTITY |
Acknowledge return item
Negative response test values
Use the path parameter in the request URI method to simulate the following response at POST /v1/customer/disputes/{dispute_id}/acknowledge-return-item
.
Trigger or test value | Simulated response |
---|---|
/v1/customer/disputes/ERRDIS109/acknowledge-return-item | FORBIDDEN |
/v1/customer/disputes/ERRDIS110/acknowledge-return-item | INVALID_RESOURCE_ID |
/v1/customer/disputes/ERRDIS111/acknowledge-return-item | NOT_ACCEPTABLE |
/v1/customer/disputes/ERRDIS112/acknowledge-return-item | UNSUPPORTED_MEDIA_TYPE |
/v1/customer/disputes/ERRDIS113/acknowledge-return-item | RATE_LIMIT_REACHED |
/v1/customer/disputes/ERRDIS114/acknowledge-return-item | SERVICE_UNAVAILABLE |
/v1/customer/disputes/ERRDIS115/acknowledge-return-item | INTERNAL_SERVICE_ERROR |
/v1/customer/disputes/ERRDIS116/acknowledge-return-item | AUTHORIZATION_ERROR |
/v1/customer/disputes/ERRDIS117/acknowledge-return-item | UNPROCESSABLE_ENTITY |
Appeal dispute
Negative response test values
Use the path parameter in the request URI method to simulate the following response at POST /v1/customer/disputes/{dispute_id}/appeal
.
Trigger or test value | Simulated response |
---|---|
/v1/customer/disputes/ERRDIS066/appeal | FORBIDDEN |
/v1/customer/disputes/ERRDIS067/appeal | INVALID_RESOURCE_ID |
/v1/customer/disputes/ERRDIS068/appeal | NOT_ACCEPTABLE |
/v1/customer/disputes/ERRDIS069/appeal | UNSUPPORTED_MEDIA_TYPE |
/v1/customer/disputes/ERRDIS070/appeal | RATE_LIMIT_REACHED |
/v1/customer/disputes/ERRDIS071/appeal | SERVICE_UNAVAILABLE |
/v1/customer/disputes/ERRDIS072/appeal | INTERNAL_SERVICE_ERROR |
/v1/customer/disputes/ERRDIS073/appeal | AUTHORIZATION_ERROR |
/v1/customer/disputes/ERRDIS074/appeal | UNPROCESSABLE_ENTITY |
/v1/customer/disputes/ERRDIS075/appeal | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS076/appeal | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS077/appeal | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS078/appeal | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS079/appeal | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS080/appeal | VALIDATION_ERROR |
/v1/customer/disputes/ERRDIS081/appeal | VALIDATION_ERROR |
Invoicing
To run the invoicing simulation tests:
Download the Postman collection for the Invoicing API:
Use the following test values to trigger positive and negative responses for these invoice actions:
Generate invoice number
Use the path parameter in the request URI method to simulate the following error responses at POST /v2/invoicing/invoices/generate-next-invoice-number
.
Trigger | Test value | Simulated error response |
---|---|---|
reference | ERRINV066 | INTERNAL_SERVER_ERROR |
reference | ERRINV067 | PERMISSION_DENIED |
Create invoices
Use the JSON pointer method to simulate the following error responses at POST v2/invoicing/invoices/
.
Trigger | Test value | Simulated positive response |
---|---|---|
detail.reference | ERRINV001 | INTERNAL_SERVER_ERROR |
detail.reference | ERRINV002 | PERMISSION_DENIED |
detail.reference | ERRINV003 | UNSUPPORTED_MEDIA_TYPE |
detail.reference | ERRINV004 | VALIDATION_ERROR_EMPTY_BODY |
detail.reference | ERRINV005 | INVALID_REQUEST_GENERIC |
detail.reference | ERRINV006 | INVALID_REQUEST_SCHEMA_VIOLATION |
Get invoice
Use the path parameter in the request URI method to simulate the following error responses at GET /v2/invoicing/invoices/{invoice_id}
.
Trigger or test value | Simulated error response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0007 | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0008 | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0009 | UNAUTHORIZED_ACCESS |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0010 | INVOICE_NOT_FOUND |
Delete invoice
Positive response test values
Use the path parameter in the request URI method to simulate the following response at DELETE /v2/invoicing/invoices/{invoice_id}
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0059 | PAYLOAD WITH 200 RESPONSE CODE |
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at DELETE /v2/invoicing/invoices/{invoice_id}
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0055 | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0056 | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0057 | UNAUTHORIZED_ACCESS |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0058 | INVOICE_NOT_FOUND |
Fully update invoice details
Use the path parameter in the request URI method to simulate the following error responses at PUT /v2/invoicing/invoices/{invoice_id}
.
Trigger or test value | Simulated error response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0060 | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0061 | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0062 | UNSUPPORTED_MEDIA_TYPE |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0063 | VALIDATION_ERROR_EMPTY_BODY |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0064 | INVALID_REQUEST_GENERIC |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0065 | INVALID_REQUEST_SCHEMA_VIOLATION |
Cancel sent invoice
Positive response test values
Use the path parameter in the request URI method to simulate the following response at POST /v2/invoicing/invoices/{invoice_id}/cancel
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0029/cancel | PAYLOAD WITH 204 RESPONSE CODE |
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v2/invoicing/invoices/{invoice_id}/cancel
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0024/cancel | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0025/cancel | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0026/cancel | UNAUTHORIZED_ACCESS |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0027/cancel | INVOICE_NOT_FOUND |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0028/cancel | CANT_CANCEL_INVOICE_IN_DRAFT_STATE |
Record payment for invoice
Positive response test values
Use the path parameter in the request URI method to simulate the following response at POST /v2/invoicing/invoices/{invoice_id}/payments
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0037/payments | PAYLOAD WITH 200 RESPONSE CODE |
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v2/invoicing/invoices/{invoice_id}/payments
.
Trigger or test value | Simulated error response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0031/payments | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0032/payments | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0033/payments | UNAUTHORIZED_ACCESS |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0034/payments | INVOICE_NOT_FOUND |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0035/payments | CANT_PAY_AN_PAID_OR_CANCELED_INVOICE |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0036/payments | CANT_PAY_MORE_THAN_INVOICE_AMOUNT |
Delete payment
Positive response test values
Use the path parameter in the request URI method to simulate the following response at DELETE /v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/payments/{transaction_id}
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/payments/EXT-ABCDEFGHERRINV042 | PAYLOAD WITH 200 RESPONSE CODE |
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at DELETE /v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/payments/{transaction_id}
.
Trigger or test value | Simulated error response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/payments/EXT-ABCDEFGHERRINV038 | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/payments/EXT-ABCDEFGHERRINV039 | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/payments/EXT-ABCDEFGHERRINV040 | UNAUTHORIZED_ACCESS |
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/payments/EXT-ABCDEFGHERRINV041 | PAYMENT_OR_INVOICE_NOT_FOUND |
Record refund for invoice
Positive response test values
Use the path parameter in the request URI method to simulate the following response at POST /v2/invoicing/invoices/{invoice_id}/refunds
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0049/refunds | PAYLOAD WITH 200 RESPONSE CODE |
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v2/invoicing/invoices/{invoice_id}/refunds
.
Trigger or test value | Simulated error response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0043/refunds | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0044/refunds | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0045/refunds | UNAUTHORIZED_ACCESS |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0046/refunds | INVOICE_NOT_FOUND |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0047/refunds | CANT_REFUND_A_CANCELED_INVOICE |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0048/refunds | CANT_REFUND_MORE_THAN_PAYMENT_AMOUNT |
Delete refund
Positive response test values
Use the path parameter in the request URI method to simulate the following response at DELETE /v2/invoicing/invoices/{invoice_id}/refunds/{transaction_id}
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV054 | PAYLOAD WITH 200 RESPONSE CODE |
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at DELETE /v2/invoicing/invoices/{invoice_id}/refunds/{transaction_id}/delete
.
Trigger or test value | Simulated error response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV050 | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV051 | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV052 | UNAUTHORIZED_ACCESS |
/v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV053 | REFUND_OR_INVOICE_NOT_FOUND |
Send invoice reminder
Positive response test values
Use the path parameter in the request URI method to simulate the following response at POST /v2/invoicing/invoices/{invoice_id}/remind
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0023/remind | PAYLOAD WITH 200 RESPONSE CODE |
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v2/invoicing/invoices/{invoice_id}/remind
.
Trigger or test value | Simulated error response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0017/remind | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0018/remind | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0019/remind | UNAUTHORIZED_ACCESS |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0020/remind | INVOICE_NOT_FOUND |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0021/remind | CANT_REMIND_INVOICE_IN_DRAFT_STATE |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0022/remind | CANT_REMIND_INVOICE_WITHOUT_BILLING_INFO |
Send invoice
Positive response test values
Use the path parameter in the request URI method to simulate the following response at POST /v2/invoicing/invoices/{invoice_id}/send
.
Trigger or test value | Simulated positive response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0016/send | PAYLOAD WITH 200 RESPONSE CODE |
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v2/invoicing/invoices/{invoice_id}/send
.
Trigger or test value | Simulated error response |
---|---|
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0011/send | INTERNAL_SERVER_ERROR |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0012/send | PERMISSION_DENIED |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0013/send | UNAUTHORIZED_ACCESS |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0014/send | INVOICE_NOT_FOUND |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0015/send | CANT_SEND_INVOICE_WITHOUT_EMAIL |
/v2/invoicing/invoices/INV2-ABCD-1234-EINV-0030/send | CANT_SEND_ALREADY_SENT_INVOICE |
Search invoices
Use the path parameter in the request URI method to simulate the following error responses at POST /v2/invoicing/search-invoices
.
Trigger or test value | Simulated error response |
---|---|
ERRINV068 | INTERNAL_SERVER_ERROR |
ERRINV069 | PERMISSION_DENIED |
ERRINV070 | INVALID_REQUEST |
Payments v2
To simulate errors, you can use the PayPal-Mock-Response
request header in the following Payments v2 REST API calls:
- Show details for authorized payment
- Capture authorized payment
- Void authorized payment
- Show captured payment details
- Refund captured payment
- Show refund details
To simulate a specific error, add a mock_application_codes
value that equals the error code you want to test.
The following sample header tests an authorization that has already been captured in a Capture authorized payment
call:
-H "PayPal-Mock-Response: {"mock_application_codes" : "AUTHORIZATION_ALREADY_CAPTURED"}"
Orders v2
To simulate errors, you can use the PayPal-Mock-Response
request header in the following Orders v2 REST API calls:
To simulate a specific error, add a mock_application_codes
value that equals the error code you want to test.
The following sample header tests a declined instrument in a Capture payment for order
call:
-H "PayPal-Mock-Response: {"mock_application_codes" : "INSTRUMENT_DECLINED"}"
Subscriptions
To run the subscription simulation tests:
Download the Postman collection for the Product, Plan, and Subscriptions APIs:
Use the following test values to trigger positive and negative responses for these subscriptions actions:
Product
Create product
Negative response test values
Use the JSON pointer in the request payload to simulate the following error responses at POST /v1/catalogs/products
.
Trigger | Test value | Simulated error response |
---|---|---|
name | ERRCAT001 | INTERNAL_SERVER_ERROR |
name | ERRCAT002 | NOT_AUTHORIZED |
name | ERRCAT003 | INVALID_REQUEST |
name | ERRCAT004 | INVALID_REQUEST |
name | ERRCAT005 | UNPROCESSABLE_ENTITY |
Get product
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at GET /v1/catalogs/products/{test_value}
.
Trigger or test value | Simulated error response |
---|---|
/v1/catalogs/products/ERRCAT008 | INTERNAL_SERVER_ERROR |
/v1/catalogs/products/ERRCAT009 | NOT_AUTHORIZED |
/v1/catalogs/products/ERRCAT010 | RESOURCE_NOT_FOUND |
List products
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at GET /v1/billing/plans/?&total_required={test_value}
.
Trigger or test value | Simulated error response |
---|---|
/v1/catalogs/products?total_required=ERRCAT006 | INTERNAL_SERVER_ERROR |
/v1/catalogs/products?total_required=ERRCAT007 | NOT_AUTHORIZED |
Update product
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at PATCH /v1/catalog/products/{test_value}
.
Trigger or test value | Simulated error response |
---|---|
/v1/catalogs/products/ERRCAT011 | INTERNAL_SERVER_ERROR |
/v1/catalogs/products/ERRCAT012 | NOT_AUTHORIZED |
/v1/catalogs/products/ERRCAT013 | INVALID_REQUEST |
/v1/catalogs/products/ERRCAT014 | UNPROCESSABLE_ENTITY |
Plan
Create plan
Negative response test values
Use the JSON pointer in the request payload to simulate the following error responses at POST /v1/billing/plans/
.
Trigger | Test value | Simulated error response |
---|---|---|
name | ERRSUB001 | INTERNAL_SERVER_ERROR |
name | ERRSUB002 | NOT_AUTHORIZED |
name | ERRSUB003 | INVALID_REQUEST |
name | ERRSUB004 | UNPROCESSABLE_ENTITY |
Activate plan
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST/v1/billing/plans/{test_value}/activate
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/plans/ERRSUB015/activate | INTERNAL_SERVER_ERROR |
/v1/billing/plans/ERRSUB016/activate | NOT_AUTHORIZED |
/v1/billing/plans/ERRSUB017/activate | RESOURCE_NOT_FOUND |
/v1/billing/plans/ERRSUB018/activate | UNPROCESSABLE_ENTITY |
Deactivate plan
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/billing/plans/{test_value}/deactivate
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/plans/ERRSUB019/deactivate | INTERNAL_SERVER_ERROR |
/v1/billing/plans/ERRSUB020/deactivate | NOT_AUTHORIZED |
/v1/billing/plans/ERRSUB021/deactivate | RESOURCE_NOT_FOUND |
/v1/billing/plans/ERRSUB022/deactivate | UNPROCESSABLE_ENTITY |
Get plan
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at GET /v1/billing/plans/{test_value}
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/plans/ERRSUB008 | INTERNAL_SERVER_ERROR |
/v1/billing/plans/ERRSUB009 | NOT_AUTHORIZED |
/v1/billing/plans/ERRSUB009 | RESOURCE_NOT_FOUND |
List plans
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at GET /v1/billing/plans/?page_size=3&page=1&total_required={test_value}
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/plans?page_size=3&page=1&total_required=ERRSUB005 | INTERNAL_SERVER_ERROR |
/v1/billing/plans?page_size=3&page=1&total_required=ERRSUB006 | NOT_AUTHORIZED |
/v1/billing/plans?page_size=3&page=1&total_required=ERRSUB007 | INVALID_REQUEST |
Update plan
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at PATCH /v1/billing/plans/{test_value}
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/plans/ERRSUB011 | INTERNAL_SERVER_ERROR |
/v1/billing/plans/ERRSUB012 | NOT_AUTHORIZED |
/v1/billing/plans/ERRSUB013 | RESOURCE_NOT_FOUND |
/v1/billing/plans/ERRSUB014 | INVALID_REQUEST |
Change plan pricing
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/billing/plans/{test_value}/update-pricing-schemes
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/plans/ERRSUB023/update-pricing-schemes | INTERNAL_SERVER_ERROR |
/v1/billing/plans/ERRSUB024/update-pricing-schemes | NOT_AUTHORIZED |
/v1/billing/plans/ERRSUB025/update-pricing-schemes | INVALID_REQUEST |
/v1/billing/plans/ERRSUB026/update-pricing-schemes | RESOURCE_NOT_FOUND |
/v1/billing/plans/ERRSUB027/update-pricing-schemes | UNPROCESSABLE_ENTITY |
/v1/billing/plans/ERRSUB028/update-pricing-schemes | UNPROCESSABLE_ENTITY |
/v1/billing/plans/ERRSUB029/update-pricing-schemes | UNPROCESSABLE_ENTITY |
/v1/billing/plans/ERRSUB030/update-pricing-schemes | UNPROCESSABLE_ENTITY |
/v1/billing/plans/ERRSUB031/update-pricing-schemes | UNPROCESSABLE_ENTITY |
Subscription
Create subscription
Negative response test values
Use the JSON pointer in the request payload to simulate the following error responses at POST /v1/billing/subscriptions
.
Trigger | Test value | Simulated error response |
---|---|---|
plan_id | ERRSUB032 | INTERNAL_SERVER_ERROR |
plan_id | ERRSUB033 | NOT_AUTHORIZED |
plan_id | ERRSUB034 | INVALID_REQUEST |
plan_id | ERRSUB035 | INVALID_REQUEST |
plan_id | ERRSUB036 | INVALID_REQUEST |
plan_id | ERRSUB037 | INVALID_REQUEST |
plan_id | ERRSUB038 | INVALID_REQUEST |
plan_id | ERRSUB039 | UNPROCESSABLE_ENTITY |
plan_id | ERRSUB040 | UNPROCESSABLE_ENTITY |
Activate subscriptions
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/billing/subscriptions/{test_value}/activate
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/subscriptions/ERRSUB066/activate | INTERNAL_SERVER_ERROR |
/v1/billing/subscriptions/ERRSUB067/activate | NOT_AUTHORIZED |
/v1/billing/subscriptions/ERRSUB068/activate | RESOURCE_NOT_FOUND |
/v1/billing/subscriptions/ERRSUB069/activate | UNPROCESSABLE_ENTITY |
/v1/billing/subscriptions/ERRSUB070/activate | UNPROCESSABLE_ENTITY |
Get subscription
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at GET /v1/billing/subscriptions/{test_value}
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/subscriptions/ERRSUB044 | INTERNAL_SERVER_ERROR |
/v1/billing/subscriptions/ERRSUB045 | NOT_AUTHORIZED |
/v1/billing/subscriptions/ERRSUB046 | RESOURCE_NOT_FOUND |
Update subscription
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at PATCH /v1/billing/subscriptions/{test_value}
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/subscriptions/ERRSUB047 | INTERNAL_SERVER_ERROR |
/v1/billing/subscriptions/ERRSUB048 | NOT_AUTHORIZED |
/v1/billing/subscriptions/ERRSUB049 | RESOURCE_NOT_FOUND |
/v1/billing/subscriptions/ERRSUB050 | INVALID_REQUEST |
/v1/billing/subscriptions/ERRSUB051 | UNPROCESSABLE_ENTITY |
/v1/billing/subscriptions/ERRSUB052 | UNPROCESSABLE_ENTITY |
Revise subscription
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/billing/subscriptions/{test_value}/revise
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/subscriptions/ERRSUB053/revise | INTERNAL_SERVER_ERROR |
/v1/billing/subscriptions/ERRSUB054/revise | NOT_AUTHORIZED |
/v1/billing/subscriptions/ERRSUB055/revise | INVALID_REQUEST |
/v1/billing/subscriptions/ERRSUB056/revise | UNPROCESSABLE_ENTITY |
Suspend subscription
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/billing/subscriptions/{test_value}/suspend
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/subscriptions/ERRSUB059/suspend | INTERNAL_SERVER_ERROR |
/v1/billing/subscriptions/ERRSUB060/suspend | NOT_AUTHORIZED |
/v1/billing/subscriptions/ERRSUB061/suspend | INVALID_REQUEST |
/v1/billing/subscriptions/ERRSUB062/suspend | UNPROCESSABLE_ENTITY |
Capture subscription
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/billing/subscriptions/{test_value}/capture
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/subscriptions/ERRSUB071/capture | INTERNAL_SERVER_ERROR |
/v1/billing/subscriptions/ERRSUB072/capture | NOT_AUTHORIZED |
/v1/billing/subscriptions/ERRSUB073/capture | RESOURCE_NOT_FOUND |
/v1/billing/subscriptions/ERRSUB074/capture | INVALID_REQUEST |
/v1/billing/subscriptions/ERRSUB075/capture | INVALID_REQUEST |
Get subscription transaction
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at GET /v1/billing/subscriptions/{test_value}/transactions
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/subscriptions/ERRSUB076/transactions | INTERNAL_SERVER_ERROR |
/v1/billing/subscriptions/ERRSUB076/transactions | NOT_AUTHORIZED |
/v1/billing/subscriptions/ERRSUB076/transactions | RESOURCE_NOT_FOUND |
/v1/billing/subscriptions/ERRSUB076/transactions | INVALID_REQUEST |
Cancel subscription
Negative response test values
Use the path parameter in the request URI method to simulate the following error responses at POST /v1/billing/subscriptions/{test_value}/cancel
.
Trigger or test value | Simulated error response |
---|---|
/v1/billing/subscriptions/ERRSUB063/cancel | INTERNAL_SERVER_ERROR |
/v1/billing/subscriptions/ERRSUB064/cancel | NOT_AUTHORIZED |
/v1/billing/subscriptions/ERRSUB065/cancel | RESOURCE_NOT_FOUND |