Simulation Tests

DOCS

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.

TriggerTest valueSimulated error response
detail/referenceERRINV002PERMISSION_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 valueSimulated error response
      /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0010INVOICE_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:

          1. Download the Postman collection for the Disputes API:

          2. 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 valueSimulated error response
          /v1/customer/disputes?disputed_transaction_id=ERRDIS023FORBIDDEN
          /v1/customer/disputes?disputed_transaction_id=ERRDIS024INVALID_RESOURCE_ID
          /v1/customer/disputes?disputed_transaction_id=ERRDIS025NOT_ACCEPTABLE
          /v1/customer/disputes?disputed_transaction_id=ERRDIS026UNSUPPORTED_MEDIA_TYPE
          /v1/customer/disputes?disputed_transaction_id=ERRDIS027RATE_LIMIT_REACHED
          /v1/customer/disputes?disputed_transaction_id=ERRDIS028SERVICE_UNAVAILABLE
          /v1/customer/disputes?disputed_transaction_id=ERRDIS029INTERNAL_SERVICE_ERROR
          /v1/customer/disputes?disputed_transaction_id=ERRDIS030AUTHORIZATION_ERROR
          /v1/customer/disputes?disputed_transaction_id=ERRDIS031VALIDATION_ERROR
          /v1/customer/disputes?disputed_transaction_id=ERRDIS032VALIDATION_ERROR
          /v1/customer/disputes?disputed_transaction_id=ERRDIS033VALIDATION_ERROR
          /v1/customer/disputes?disputed_transaction_id=ERRDIS034VALIDATION_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 valueSimulated error response
          /v1/customer/disputes/ERRDIS015FORBIDDEN
          /v1/customer/disputes/ERRDIS016INVALID_RESOURCE_ID
          /v1/customer/disputes/ERRDIS017NOT_ACCEPTABLE
          /v1/customer/disputes/ERRDIS018UNSUPPORTED_MEDIA_TYPE
          /v1/customer/disputes/ERRDIS019RATE_LIMIT_REACHED
          /v1/customer/disputes/ERRDIS020SERVICE_UNAVAILABLE
          /v1/customer/disputes/ERRDIS021INTERNAL_SERVICE_ERROR
          /v1/customer/disputes/ERRDIS022AUTHORIZATION_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 valueSimulated error response
          /v1/customer/disputes/ERRDIS091/send-messageFORBIDDEN
          /v1/customer/disputes/ERRDIS092/send-messageINVALID_RESOURCE_ID
          /v1/customer/disputes/ERRDIS093/send-messageNOT_ACCEPTABLE
          /v1/customer/disputes/ERRDIS094/send-messageUNSUPPORTED_MEDIA_TYPE
          /v1/customer/disputes/ERRDIS095/send-messageRATE_LIMIT_REACHED
          /v1/customer/disputes/ERRDIS096/send-messageSERVICE_UNAVAILABLE
          /v1/customer/disputes/ERRDIS097/send-messageINTERNAL_SERVICE_ERROR
          /v1/customer/disputes/ERRDIS098/send-messageAUTHORIZATION_ERROR
          /v1/customer/disputes/ERRDIS099/send-messageUNPROCESSABLE_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 valueSimulated error response
          /v1/customer/disputes/ERRDIS100/make-offerFORBIDDEN
          /v1/customer/disputes/ERRDIS101/make-offerINVALID_RESOURCE_ID
          /v1/customer/disputes/ERRDIS102/make-offerNOT_ACCEPTABLE
          /v1/customer/disputes/ERRDIS103/make-offerUNSUPPORTED_MEDIA_TYPE
          /v1/customer/disputes/ERRDIS104/make-offerRATE_LIMIT_REACHED
          /v1/customer/disputes/ERRDIS105/make-offerSERVICE_UNAVAILABLE
          /v1/customer/disputes/ERRDIS106/make-offerINTERNAL_SERVICE_ERROR
          /v1/customer/disputes/ERRDIS107/make-offerAUTHORIZATION_ERROR
          /v1/customer/disputes/ERRDIS108/make-offerUNPROCESSABLE_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 valueSimulated response
          /v1/customer/disputes/ERRDIS082/escalateFORBIDDEN
          /v1/customer/disputes/ERRDIS083/escalateINVALID_RESOURCE_ID
          /v1/customer/disputes/ERRDIS084/escalateNOT_ACCEPTABLE
          /v1/customer/disputes/ERRDIS085/escalateUNSUPPORTED_MEDIA_TYPE
          /v1/customer/disputes/ERRDIS086/escalateRATE_LIMIT_REACHED
          /v1/customer/disputes/ERRDIS087/escalateSERVICE_UNAVAILABLE
          /v1/customer/disputes/ERRDIS088/escalateINTERNAL_SERVICE_ERROR
          /v1/customer/disputes/ERRDIS089/escalateAUTHORIZATION_ERROR
          /v1/customer/disputes/ERRDIS090/escalateUNPROCESSABLE_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 valueSimulated response
          /v1/customer/disputes/ERRDIS035/provide-evidenceFORBIDDEN
          /v1/customer/disputes/ERRDIS036/provide-evidenceINVALID_RESOURCE_ID
          /v1/customer/disputes/ERRDIS037/provide-evidenceNOT_ACCEPTABLE
          /v1/customer/disputes/ERRDIS038/provide-evidenceUNSUPPORTED_MEDIA_TYPE
          /v1/customer/disputes/ERRDIS039/provide-evidenceRATE_LIMIT_REACHED
          /v1/customer/disputes/ERRDIS040/provide-evidenceSERVICE_UNAVAILABLE
          /v1/customer/disputes/ERRDIS041/provide-evidenceINTERNAL_SERVICE_ERROR
          /v1/customer/disputes/ERRDIS042/provide-evidenceAUTHORIZATION_ERROR
          /v1/customer/disputes/ERRDIS043/provide-evidenceUNPROCESSABLE_ENTITY
          /v1/customer/disputes/ERRDIS044/provide-evidenceVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS045/provide-evidenceVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS046/provide-evidenceVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS047/provide-evidenceVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS048/provide-evidenceVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS049/provide-evidenceVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS050/provide-evidenceVALIDATION_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 valueSimulated response
          /v1/customer/disputes/ERRDIS051/accept-claimFORBIDDEN
          /v1/customer/disputes/ERRDIS052/accept-claimINVALID_RESOURCE_ID
          /v1/customer/disputes/ERRDIS053/accept-claimNOT_ACCEPTABLE
          /v1/customer/disputes/ERRDIS054/accept-claimUNSUPPORTED_MEDIA_TYPE
          /v1/customer/disputes/ERRDIS055/accept-claimRATE_LIMIT_REACHED
          /v1/customer/disputes/ERRDIS056/accept-claimSERVICE_UNAVAILABLE
          /v1/customer/disputes/ERRDIS057/accept-claimINTERNAL_SERVICE_ERROR
          /v1/customer/disputes/ERRDIS058/accept-claimAUTHORIZATION_ERROR
          /v1/customer/disputes/ERRDIS059/accept-claimUNPROCESSABLE_ENTITY
          /v1/customer/disputes/ERRDIS060/accept-claimVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS061/accept-claimVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS062/accept-claimVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS063/accept-claimVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS064/accept-claimVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS065/accept-claimUNPROCESSABLE_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 valueSimulated response
          /v1/customer/disputes/ERRDIS109/acknowledge-return-itemFORBIDDEN
          /v1/customer/disputes/ERRDIS110/acknowledge-return-itemINVALID_RESOURCE_ID
          /v1/customer/disputes/ERRDIS111/acknowledge-return-itemNOT_ACCEPTABLE
          /v1/customer/disputes/ERRDIS112/acknowledge-return-itemUNSUPPORTED_MEDIA_TYPE
          /v1/customer/disputes/ERRDIS113/acknowledge-return-itemRATE_LIMIT_REACHED
          /v1/customer/disputes/ERRDIS114/acknowledge-return-itemSERVICE_UNAVAILABLE
          /v1/customer/disputes/ERRDIS115/acknowledge-return-itemINTERNAL_SERVICE_ERROR
          /v1/customer/disputes/ERRDIS116/acknowledge-return-itemAUTHORIZATION_ERROR
          /v1/customer/disputes/ERRDIS117/acknowledge-return-itemUNPROCESSABLE_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 valueSimulated response
          /v1/customer/disputes/ERRDIS066/appealFORBIDDEN
          /v1/customer/disputes/ERRDIS067/appealINVALID_RESOURCE_ID
          /v1/customer/disputes/ERRDIS068/appealNOT_ACCEPTABLE
          /v1/customer/disputes/ERRDIS069/appealUNSUPPORTED_MEDIA_TYPE
          /v1/customer/disputes/ERRDIS070/appealRATE_LIMIT_REACHED
          /v1/customer/disputes/ERRDIS071/appealSERVICE_UNAVAILABLE
          /v1/customer/disputes/ERRDIS072/appealINTERNAL_SERVICE_ERROR
          /v1/customer/disputes/ERRDIS073/appealAUTHORIZATION_ERROR
          /v1/customer/disputes/ERRDIS074/appealUNPROCESSABLE_ENTITY
          /v1/customer/disputes/ERRDIS075/appealVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS076/appealVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS077/appealVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS078/appealVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS079/appealVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS080/appealVALIDATION_ERROR
          /v1/customer/disputes/ERRDIS081/appealVALIDATION_ERROR

          Invoicing

          To run the invoicing simulation tests:

          1. Download the Postman collection for the Invoicing API:

          2. 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.

          TriggerTest valueSimulated error response
          referenceERRINV066INTERNAL_SERVER_ERROR
          referenceERRINV067PERMISSION_DENIED

          Create invoices

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

          TriggerTest valueSimulated positive response
          detail.referenceERRINV001INTERNAL_SERVER_ERROR
          detail.referenceERRINV002PERMISSION_DENIED
          detail.referenceERRINV003UNSUPPORTED_MEDIA_TYPE
          detail.referenceERRINV004VALIDATION_ERROR_EMPTY_BODY
          detail.referenceERRINV005INVALID_REQUEST_GENERIC
          detail.referenceERRINV006INVALID_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 valueSimulated error response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0007INTERNAL_SERVER_ERROR
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0008PERMISSION_DENIED
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0009UNAUTHORIZED_ACCESS
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0010INVOICE_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 valueSimulated positive response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0059PAYLOAD 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 valueSimulated positive response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0055INTERNAL_SERVER_ERROR
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0056PERMISSION_DENIED
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0057UNAUTHORIZED_ACCESS
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0058INVOICE_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 valueSimulated error response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0060INTERNAL_SERVER_ERROR
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0061PERMISSION_DENIED
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0062UNSUPPORTED_MEDIA_TYPE
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0063VALIDATION_ERROR_EMPTY_BODY
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0064INVALID_REQUEST_GENERIC
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0065INVALID_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 valueSimulated positive response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0029/cancelPAYLOAD 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 valueSimulated positive response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0024/cancelINTERNAL_SERVER_ERROR
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0025/cancelPERMISSION_DENIED
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0026/cancelUNAUTHORIZED_ACCESS
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0027/cancelINVOICE_NOT_FOUND
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0028/cancelCANT_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 valueSimulated positive response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0037/paymentsPAYLOAD 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 valueSimulated error response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0031/paymentsINTERNAL_SERVER_ERROR
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0032/paymentsPERMISSION_DENIED
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0033/paymentsUNAUTHORIZED_ACCESS
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0034/paymentsINVOICE_NOT_FOUND
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0035/paymentsCANT_PAY_AN_PAID_OR_CANCELED_INVOICE
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0036/paymentsCANT_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 valueSimulated positive response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0049/refundsPAYLOAD 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 valueSimulated error response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0043/refundsINTERNAL_SERVER_ERROR
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0044/refundsPERMISSION_DENIED
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0045/refundsUNAUTHORIZED_ACCESS
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0046/refundsINVOICE_NOT_FOUND
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0047/refundsCANT_REFUND_A_CANCELED_INVOICE
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0048/refundsCANT_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 valueSimulated positive response
          /v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV054PAYLOAD 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 valueSimulated error response
          /v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV050INTERNAL_SERVER_ERROR
          /v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV051PERMISSION_DENIED
          /v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV052UNAUTHORIZED_ACCESS
          /v2/invoicing/invoices/INV2-ABCD-1234-EFGH-5678/refunds/EXT-ABCDEFGHERRINV053REFUND_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 valueSimulated positive response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0023/remindPAYLOAD 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 valueSimulated error response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0017/remindINTERNAL_SERVER_ERROR
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0018/remindPERMISSION_DENIED
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0019/remindUNAUTHORIZED_ACCESS
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0020/remindINVOICE_NOT_FOUND
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0021/remindCANT_REMIND_INVOICE_IN_DRAFT_STATE
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0022/remindCANT_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 valueSimulated positive response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0016/sendPAYLOAD 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 valueSimulated error response
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0011/sendINTERNAL_SERVER_ERROR
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0012/sendPERMISSION_DENIED
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0013/sendUNAUTHORIZED_ACCESS
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0014/sendINVOICE_NOT_FOUND
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0015/sendCANT_SEND_INVOICE_WITHOUT_EMAIL
          /v2/invoicing/invoices/INV2-ABCD-1234-EINV-0030/sendCANT_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 valueSimulated error response
          ERRINV068INTERNAL_SERVER_ERROR
          ERRINV069PERMISSION_DENIED
          ERRINV070INVALID_REQUEST

          Payments v2

          To simulate errors, you can use the PayPal-Mock-Response request header in the following Payments 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 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:

          1. Download the Postman collection for the Product, Plan, and Subscriptions APIs:

          2. Use the following test values to trigger positive and negative responses for these subscriptions actions:

            Product

            Plan

            Subscription

          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.

          TriggerTest valueSimulated error response
          nameERRCAT001INTERNAL_SERVER_ERROR
          nameERRCAT002NOT_AUTHORIZED
          nameERRCAT003INVALID_REQUEST
          nameERRCAT004INVALID_REQUEST
          nameERRCAT005UNPROCESSABLE_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 valueSimulated error response
          /v1/catalogs/products/ERRCAT008INTERNAL_SERVER_ERROR
          /v1/catalogs/products/ERRCAT009NOT_AUTHORIZED
          /v1/catalogs/products/ERRCAT010RESOURCE_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 valueSimulated error response
          /v1/catalogs/products?total_required=ERRCAT006INTERNAL_SERVER_ERROR
          /v1/catalogs/products?total_required=ERRCAT007NOT_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 valueSimulated error response
          /v1/catalogs/products/ERRCAT011INTERNAL_SERVER_ERROR
          /v1/catalogs/products/ERRCAT012NOT_AUTHORIZED
          /v1/catalogs/products/ERRCAT013INVALID_REQUEST
          /v1/catalogs/products/ERRCAT014UNPROCESSABLE_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/.

          TriggerTest valueSimulated error response
          nameERRSUB001INTERNAL_SERVER_ERROR
          nameERRSUB002NOT_AUTHORIZED
          nameERRSUB003INVALID_REQUEST
          nameERRSUB004UNPROCESSABLE_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 valueSimulated error response
          /v1/billing/plans/ERRSUB015/activateINTERNAL_SERVER_ERROR
          /v1/billing/plans/ERRSUB016/activateNOT_AUTHORIZED
          /v1/billing/plans/ERRSUB017/activateRESOURCE_NOT_FOUND
          /v1/billing/plans/ERRSUB018/activateUNPROCESSABLE_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 valueSimulated error response
          /v1/billing/plans/ERRSUB019/deactivateINTERNAL_SERVER_ERROR
          /v1/billing/plans/ERRSUB020/deactivateNOT_AUTHORIZED
          /v1/billing/plans/ERRSUB021/deactivateRESOURCE_NOT_FOUND
          /v1/billing/plans/ERRSUB022/deactivateUNPROCESSABLE_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 valueSimulated error response
          /v1/billing/plans/ERRSUB008INTERNAL_SERVER_ERROR
          /v1/billing/plans/ERRSUB009NOT_AUTHORIZED
          /v1/billing/plans/ERRSUB009RESOURCE_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 valueSimulated error response
          /v1/billing/plans?page_size=3&page=1&total_required=ERRSUB005INTERNAL_SERVER_ERROR
          /v1/billing/plans?page_size=3&page=1&total_required=ERRSUB006NOT_AUTHORIZED
          /v1/billing/plans?page_size=3&page=1&total_required=ERRSUB007INVALID_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 valueSimulated error response
          /v1/billing/plans/ERRSUB011INTERNAL_SERVER_ERROR
          /v1/billing/plans/ERRSUB012NOT_AUTHORIZED
          /v1/billing/plans/ERRSUB013RESOURCE_NOT_FOUND
          /v1/billing/plans/ERRSUB014INVALID_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 valueSimulated error response
          /v1/billing/plans/ERRSUB023/update-pricing-schemesINTERNAL_SERVER_ERROR
          /v1/billing/plans/ERRSUB024/update-pricing-schemesNOT_AUTHORIZED
          /v1/billing/plans/ERRSUB025/update-pricing-schemesINVALID_REQUEST
          /v1/billing/plans/ERRSUB026/update-pricing-schemesRESOURCE_NOT_FOUND
          /v1/billing/plans/ERRSUB027/update-pricing-schemesUNPROCESSABLE_ENTITY
          /v1/billing/plans/ERRSUB028/update-pricing-schemesUNPROCESSABLE_ENTITY
          /v1/billing/plans/ERRSUB029/update-pricing-schemesUNPROCESSABLE_ENTITY
          /v1/billing/plans/ERRSUB030/update-pricing-schemesUNPROCESSABLE_ENTITY
          /v1/billing/plans/ERRSUB031/update-pricing-schemesUNPROCESSABLE_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.

          TriggerTest valueSimulated error response
          plan_idERRSUB032INTERNAL_SERVER_ERROR
          plan_idERRSUB033NOT_AUTHORIZED
          plan_idERRSUB034INVALID_REQUEST
          plan_idERRSUB035INVALID_REQUEST
          plan_idERRSUB036INVALID_REQUEST
          plan_idERRSUB037INVALID_REQUEST
          plan_idERRSUB038INVALID_REQUEST
          plan_idERRSUB039UNPROCESSABLE_ENTITY
          plan_idERRSUB040UNPROCESSABLE_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 valueSimulated error response
          /v1/billing/subscriptions/ERRSUB066/activateINTERNAL_SERVER_ERROR
          /v1/billing/subscriptions/ERRSUB067/activateNOT_AUTHORIZED
          /v1/billing/subscriptions/ERRSUB068/activateRESOURCE_NOT_FOUND
          /v1/billing/subscriptions/ERRSUB069/activateUNPROCESSABLE_ENTITY
          /v1/billing/subscriptions/ERRSUB070/activateUNPROCESSABLE_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 valueSimulated error response
          /v1/billing/subscriptions/ERRSUB044INTERNAL_SERVER_ERROR
          /v1/billing/subscriptions/ERRSUB045NOT_AUTHORIZED
          /v1/billing/subscriptions/ERRSUB046RESOURCE_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 valueSimulated error response
          /v1/billing/subscriptions/ERRSUB047INTERNAL_SERVER_ERROR
          /v1/billing/subscriptions/ERRSUB048NOT_AUTHORIZED
          /v1/billing/subscriptions/ERRSUB049RESOURCE_NOT_FOUND
          /v1/billing/subscriptions/ERRSUB050INVALID_REQUEST
          /v1/billing/subscriptions/ERRSUB051UNPROCESSABLE_ENTITY
          /v1/billing/subscriptions/ERRSUB052UNPROCESSABLE_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 valueSimulated error response
          /v1/billing/subscriptions/ERRSUB053/reviseINTERNAL_SERVER_ERROR
          /v1/billing/subscriptions/ERRSUB054/reviseNOT_AUTHORIZED
          /v1/billing/subscriptions/ERRSUB055/reviseINVALID_REQUEST
          /v1/billing/subscriptions/ERRSUB056/reviseUNPROCESSABLE_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 valueSimulated error response
          /v1/billing/subscriptions/ERRSUB059/suspendINTERNAL_SERVER_ERROR
          /v1/billing/subscriptions/ERRSUB060/suspendNOT_AUTHORIZED
          /v1/billing/subscriptions/ERRSUB061/suspendINVALID_REQUEST
          /v1/billing/subscriptions/ERRSUB062/suspendUNPROCESSABLE_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 valueSimulated error response
          /v1/billing/subscriptions/ERRSUB071/captureINTERNAL_SERVER_ERROR
          /v1/billing/subscriptions/ERRSUB072/captureNOT_AUTHORIZED
          /v1/billing/subscriptions/ERRSUB073/captureRESOURCE_NOT_FOUND
          /v1/billing/subscriptions/ERRSUB074/captureINVALID_REQUEST
          /v1/billing/subscriptions/ERRSUB075/captureINVALID_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 valueSimulated error response
          /v1/billing/subscriptions/ERRSUB076/transactionsINTERNAL_SERVER_ERROR
          /v1/billing/subscriptions/ERRSUB076/transactionsNOT_AUTHORIZED
          /v1/billing/subscriptions/ERRSUB076/transactionsRESOURCE_NOT_FOUND
          /v1/billing/subscriptions/ERRSUB076/transactionsINVALID_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 valueSimulated error response
          /v1/billing/subscriptions/ERRSUB063/cancelINTERNAL_SERVER_ERROR
          /v1/billing/subscriptions/ERRSUB064/cancelNOT_AUTHORIZED
          /v1/billing/subscriptions/ERRSUB065/cancelRESOURCE_NOT_FOUND

          We use cookies to improve your experience on our site. May we use marketing cookies to show you personalized ads? Manage all cookies