Test and go live

APICurrentLast updated: May 18th 2022, @ 4:02:27 pm


You can run negative tests on your integration to manage the responses you give to your customers.

Know before you code

  • Before you trigger a simulation, you'll need to you need to get an access token.
  • Use Postman to explore and test PayPal APIs.

Simulation methods

To trigger a simulation for the Payouts API, use a JSON pointer in the request payload or use a path parameter in the request URI.

Use a JSON pointer in the request payload

TriggerTest valueSimulated response
items[0]/noteERRPYO002SENDER_EMAIL_UNCONFIRMED

JSON pointer request

curl -X POST https://api-m.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"
    }
  }]
}'

JSON pointer response

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

Use a path parameter in the request URI

TriggerTest valueSimulated response
/v1/payments/payoutsERRPYO015CLOSED_MARKET

Path parameter request

curl -X GET https://api-m.sandbox.paypal.com/v1/payments/payouts/ERRPYO015 \
  -H "content-type: application/json" \
  -H "Authorization: Bearer <Access-Token>"

Path parameter response

{
  "batch_header":
  {
    "payout_batch_id": "DQCP2UAJCBMNY",
    "batch_status": "SUCCESS",
    "time_created": "2017-08-21T11:22:33Z",
    "time_completed": "2017-08-21T11:22:54Z",
    "sender_batch_header":
    {
      "email_subject": "user test case"
    },
    "amount":
    {
      "currency": "USD",
      "value": "190.0"
    },
    "fees":
    {
      "currency": "USD",
      "value": "0.0"
    }
  },
  "items": [
  {
    "payout_item_id": "RWD4Y3H9VV8BA",
    "transaction_status": "FAILED",
    "payout_item_fee":
    {
      "currency": "USD",
      "value": "0.0"
    },
    "payout_batch_id": "DQCP2UAJCBMNY",
    "payout_item":
    {
      "recipient_type": "EMAIL",
      "amount":
      {
        "currency": "USD",
        "value": "190.0"
      },
      "note": "payout to  receiver",
      "receiver": "receiver@example.com",
      "sender_item_id": "MSI-2727"
    },
    "time_processed": "2017-08-21T11:22:44Z",
    "errors":
    {
      "name": "CLOSED_MARKET",
      "message": "Market closed and transaction is between 2 different countries",
      "information_link": "https://developer.paypal.com/docs/api/payments.payouts-batch/v1/#errors",
      "details": []
    },
    "links": [
    {
      "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts-item/RWD4Y3H9VV8BA",
      "rel": "item",
      "method": "GET",
      "encType": "application/json"
    }]
  }],
  "links": [
  {
    "href": "https://api-m.sandbox.paypal.com/v1/payments/payouts/DQCP2UAJCBMNY",
    "rel": "self",
    "method": "GET",
    "encType": "application/json"
  }]
}

Test values

Use the listed test values to trigger positive and negative responses for these payouts actions:

Note: Test values are case sensitive.

Create payout

Positive response test values

Use the JSON pointer method to simulate this response at POST v1/payments/payouts/.

TriggerTest valueSimulated response
items[0]/notePOSPYO001PAYLOAD WITH 201 RESPONSE CODE
items[0]/notePOSPYO003PAYLOAD WITH 201 RESPONSE CODE FOR VENMO RECEIVER

Negative response test values

Use the JSON pointer method to simulate these error responses at POST v1/payments/payouts.

TriggerTest valueSimulated response
items[0]/noteERRPYO001SENDER_RESTRICTED
items[0]/noteERRPYO002SENDER_EMAIL_UNCONFIRMED
items[0]/noteERRPYO003AUTHORIZATION_ERROR
items[0]/noteERRPYO005INSUFFICIENT_FUNDS
items[0]/noteERRPYO006INTERNAL_ERROR
items[0]/noteERRPYO010VALIDATION_ERROR
items[0]/noteERRPYO011REQUIRED_SCOPE_MISSING
items[0]/noteERRPYO012SENDER_LOCKED
items[0]/sender_batch_idERRPYO013VALIDATION_ERROR FOR VENMO NOTE MISSING
items[0]/noteERRPYO014USER_BUSINESS_ERROR
items[0]/noteERRPYO035RATE_LIMIT_VALIDATION
items[0]/noteERRPYO036REQUEST_TIMEOUT_EXCEEDED
items[0]/noteERRPYO037SYNC_MODE_NOT_APPLICABLE
items[0]/noteERRPYO038NON_HOLDING_CURRENCY
items[0]/noteERRPYO039PREVIOUS_REQUEST_IN_PROGRESS
items[0]/noteERRPYO040CIP_NOT_VERIFIED

Show payout details

Positive response test values

Use the path parameter in the request URI method to simulate this response at GET v1/payments/payouts.

Trigger or test valueSimulated response
/v1/payments/payouts/POSPYO002PAYLOAD WITH 200 RESPONSE CODE

Negative response test values

Use the path parameter in the request URI method to simulate these error responses at GET v1/payments/payouts.

Trigger or test valueSimulated response
/v1/payments/payouts/ERRPYOB005ACCOUNT_RESTRICTED
/v1/payments/payouts/ERRPYOB006ACCOUNT_UNCONFIRMED_EMAIL
/v1/payments/payouts/ERRPYOB007APPROVER_DENIED
/v1/payments/payouts/ERRPYOB008GAMER_FAILED_COUNTRY_OF_RESIDENCE_CHECK
/v1/payments/payouts/ERRPYOB009GAMER_FAILED_FUNDING_SOURCE_CHECK
/v1/payments/payouts/ERRPYOB010GAMING_INVALID_PAYMENT_FLOW
/v1/payments/payouts/ERRPYOB011NON_HOLDING_CURRENCY
/v1/payments/payouts/ERRPYOB012PENDING_RECIPIENT_NON_HOLDING_CURRENCY_PAYMENT_PREFERENCE
/v1/payments/payouts/ERRPYOB013SENDER_STATE_RESTRICTED
/v1/payments/payouts/ERRPYOB014SPENDING_LIMIT_EXCEEDED
/v1/payments/payouts/ERRPYOB015TRANSACTION_DECLINED_BY_TRAVEL_RULE
/v1/payments/payouts/ERRPYO015CLOSED_MARKET
/v1/payments/payouts/ERRPYO016CURRENCY_COMPLIANCE
/v1/payments/payouts/ERRPYO017CURRENCY_NOT_SUPPORTED_FOR_RECEIVER
/v1/payments/payouts/ERRPYO018DUPLICATE_ITEM
/v1/payments/payouts/ERRPYO019RECEIVER_ACCOUNT_LOCKED
/v1/payments/payouts/ERRPYO020RECEIVER_COUNTRY_NOT_ALLOWED
/v1/payments/payouts/ERRPYO021RECEIVER_UNCONFIRMED
/v1/payments/payouts/ERRPYO022RECEIVER_UNREGISTERED
/v1/payments/payouts/ERRPYO023RECEIVER_YOUTH_ACCOUNT
/v1/payments/payouts/ERRPYO024RECEIVING_LIMIT_EXCEEDED
/v1/payments/payouts/ERRPYO025REGULATORY_BLOCKED
/v1/payments/payouts/ERRPYO026REGULATORY_PENDING
/v1/payments/payouts/ERRPYO027RISK_DECLINE
/v1/payments/payouts/ERRPYO028SELF_PAY_NOT_ALLOWED
/v1/payments/payouts/ERRPYO029TRANSACTION_LIMIT_EXCEEDED
/v1/payments/payouts/ERRPYO030UNDEFINED
/v1/payments/payouts/ERRPYO031ZERO_AMOUNT
/v1/payments/payouts/ERRPYO032INVALID_RESOURCE_ID
/v1/payments/payouts/ERRPYO033INTERNAL_ERROR
/v1/payments/payouts/ERRPYO034INVALID_EMAIL
/v1/payments/payouts/ERRPYO060RECEIVER_ACCOUNT_LIMITATION

Cancel payout item

Positive response test values

Use the path parameter in the request URI method to simulate this response at POST v1/payments/payouts-item/payouts_item_id/cancel.

Trigger or test valueSimulated response
/v1/payments/payouts-item/POSPOI002/cancelPAYLOAD WITH 200 RESPONSE CODE

Negative response test values

Use the path parameter in the request URI method to simulate these error responses at POST v1/payments/payouts-item/payouts_item_id/cancel.

Trigger or test valueSimulated response
/v1/payments/payouts-item/ERRPOI001/cancelINVALID_RESOURCE_ID
/v1/payments/payouts-item/ERRPYO004/cancelBATCH_NOT_COMPLETED
/v1/payments/payouts-item/ERRPYO007/cancelITEM_ALREADY_CANCELLED
/v1/payments/payouts-item/ERRPYO008/cancelITEM_CANCELLATION_FAILED
/v1/payments/payouts-item/ERRPYO009/cancelITEM_INCORRECT_STATUS

Show payout item details

Positive response test values

Use the path parameter in the request URI method to simulate this response at GET v1/payments/payouts-item/payouts_item_id.

Trigger or test valueSimulated response
/v1/payments/payouts-item/POSPOI001PAYLOAD WITH 200 RESPONSE CODE

Negative response test values

Use the path parameter in the request URI method to simulate these error responses at GET v1/payments/payouts-item/payouts_item_id.

Trigger or test valueSimulated response
/v1/payments/payouts-item/ERRPYO041CLOSED_MARKET
/v1/payments/payouts-item/ERRPYO042CURRENCY_COMPLIANCE
/v1/payments/payouts-item/ERRPYO043CURRENCY_NOT_SUPPORTED_FOR_RECEIVER
/v1/payments/payouts-item/ERRPYO044RECEIVER_ACCOUNT_LOCKED
/v1/payments/payouts-item/ERRPYO045RECEIVER_COUNTRY_NOT_ALLOWED
/v1/payments/payouts-item/ERRPYO046RECEIVER_UNCONFIRMED
/v1/payments/payouts-item/ERRPYO047RECEIVER_UNREGISTERED
/v1/payments/payouts-item/ERRPYO048RECEIVER_YOUTH_ACCOUNT
/v1/payments/payouts-item/ERRPYO049RECEIVING_LIMIT_EXCEEDED
/v1/payments/payouts-item/ERRPYO050REGULATORY_BLOCKED
/v1/payments/payouts-item/ERRPYO051REGULATORY_PENDING
/v1/payments/payouts-item/ERRPYO052RISK_DECLINE
/v1/payments/payouts-item/ERRPYO053SELF_PAY_NOT_ALLOWED
/v1/payments/payouts-item/ERRPYO054TRANSACTION_LIMIT_EXCEEDED
/v1/payments/payouts-item/ERRPYO055UNDEFINED
/v1/payments/payouts-item/ERRPYO056ZERO_AMOUNT
/v1/payments/payouts-item/ERRPYO057INVALID_RESOURCE_ID
/v1/payments/payouts-item/ERRPYO058INTERNAL_ERROR
/v1/payments/payouts-item/ERRPYO059INVALID_EMAIL
/v1/payments/payouts-item/ERRPYO061RECEIVER_ACCOUNT_LIMITATION
/v1/payments/payouts-items/ERRPYOB016ACCOUNT_RESTRICTED
/v1/payments/payouts-items/ERRPYOB017ACCOUNT_UNCONFIRMED_EMAIL
/v1/payments/payouts-items/ERRPYOB018APPROVER_DENIED
/v1/payments/payouts-items/ERRPYOB019GAMER_FAILED_COUNTRY_OF_RESIDENCE_CHECK
/v1/payments/payouts-items/ERRPYOB020GAMER_FAILED_FUNDING_SOURCE_CHECK
/v1/payments/payouts-items/ERRPYOB021GAMING_INVALID_PAYMENT_FLOW
/v1/payments/payouts-items/ERRPYOB022NON_HOLDING_CURRENCY
/v1/payments/payouts-items/ERRPYOB023PENDING_RECIPIENT_NON_HOLDING_CURRENCY_PAYMENT_PREFERENCE
/v1/payments/payouts-items/ERRPYOB024SENDER_STATE_RESTRICTED
/v1/payments/payouts-items/ERRPYOB025SPENDING_LIMIT_EXCEEDED
/v1/payments/payouts-items/ERRPYOB026TRANSACTION_DECLINED_BY_TRAVEL_RULE

Batch processing

Batch status test values

Use the path parameter in the request URI method to simulate these error responses at GET v1/payments/payouts/payout_batch_id.

Trigger or test valueSimulated response
/v1/payments/payouts/ERRPYOB001SUCCESS
/v1/payments/payouts/ERRPYOB002PENDING
/v1/payments/payouts/ERRPYOB003PROCESSING
/v1/payments/payouts/ERRPYOB004DENIED

Webhooks with failed payouts

Webhook resources don't contain error objects. If you receive a webhook for a failed payout and would like to understand why the payout failed, do a GET request on the object. For more details, see Webhook event names.

Rate limiting

The rate limit number for Payouts API POST calls is 400.

PayPal’s primary focus is site availability and security in support of merchants.

While we do not publish a rate limiting policy, we might temporarily rate limit if we identify traffic that appears to be abusive. We rate limit until we are confident that the activity is not problematic for PayPal, merchants, or customers.

To ensure maximum protection and site stability, we constantly evaluate traffic as it surges and subsides to adjust our policies. If you or your customers receive the HTTP 429 Unprocessable Entity - RATE_LIMIT_REACHED status code, too many requests were sent, and that might indicate anomalous traffic, so we rate limit to ensure site stability.

If this policy negatively affects your integration, contact Merchant Technical Support.

Tips to avoid rate limiting:

Go live with your integration

Deploying your code to the live environment takes only a few steps.

  1. Change the base URL for all your REST API calls from https://api-m.sandbox.paypal.com to https://api-m.paypal.com.

  2. Change the references to your sandbox API credentials to the live credentials. To get live API credentials, create a live REST API.

    Tip: Remember to change the sandbox client ID in the JavaScript SDK call in your HTML.

  3. If you created or updated pages on a website, move that code from the test environment to the live environment.

See also