Simulate Negative Responses with Test Values

Note: If you do not use the specific test values, the service returns the actual API responses.

You can use the test values-based method to test the following APIs:

Set up your development environment

Before you can use test values to simulate negative responses, you must set up your development environment. After you get a token that lets you access protected REST API resources, you create sandbox accounts to test your web and mobile apps. For details, see Get Started.

Then, return to this page to use test values to simulate negative responses.

Invoke negative testing

1. Set the test values in the request field.
2. Send your request to the endpoint you'd like to test.

Note: Test values are case sensitive.

Example request

To trigger the SENDER_EMAIL_UNCONFIRMED simulation response, set the items[0]/note value to ERRPYO002 in the POST v1/payments/payouts call.

curl -X POST https://api.sandbox.paypal.com/v1/payments/payouts \
  -H "content-type: application/json" \
  -H "Authorization: Bearer Access-Token" \
  -d '{
  "sender_batch_header": {
    "sender_batch_id": "1524086406556",
    "email_subject": "This email is related to simulation"
  },
  "items": [
  {
    "recipient_type": "EMAIL",
    "receiver": "payouts-simulator-receiver@paypal.com",
    "note": "ERRPYO002",
    "sender_item_id": "15240864065560",
    "amount": {
      "currency": "USD",
      "value": "1.00"
    }
  }]
}'

Example response

{
  "name": "SENDER_EMAIL_UNCONFIRMED",
  "message": "Authorization error occurred",
  "debug_id": "ca787bdf80d7a",
  "information_link": "https://developer.paypal.com/docs/api/payments.payouts-batch/#errors"
}

For the negative case test codes, see Test values.

Feedback