Search

Are you looking for test card numbers?

Would you like to contact support?

Risk-management icon

Test a chargeback scenario

Simulate chargebacks by submitting dispute reason codes in your payment request.

To verify your Disputes API integration, you can test a chargeback scenario. First, you create a test payment with a chargeback reason of your choice. Then, you capture that transaction and wait for the notification webhook. When you receive the notification, the chargeback is created and you can use the information from your test transaction to test the Disputes API.

  1. In your test environment, submit a payment request with the holderName set to any of the following values, depending on the scenario you want to simulate:

    • Chargeback:{reason_code}: A chargeback with a specific reason code. For a list of available reason codes, refer to Dispute reason codes.
    • Chargeback: A chargeback without an explicit reason code.
    • Chargeback Reversed: A ChargebackReversed status without an explicit reason code.
    • Second Chargeback: A SecondChargeback status without an explicit reason code.

    For example, submit the /payments request below to simulate a chargeback with reason code 10.4:

    /payments request
    {
      "amount": {
        "currency": "EUR",
        "value": 1000
      },
      "reference": "YOUR_ORDER_NUMBER",
      "{hint:If using /authorise endpoint, change object to card}paymentMethod{/hint}": {
        "type": "scheme",
        "number": "4111111111111111",
        "expiryMonth": "03",
        "expiryYear": "2030",
        "holderName": "chargeback:10.4",
        "cvc": "737"
      },
      "returnUrl": "https://your-company.com/...",
      "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
    }

    You receive a response containing pspReference, our unique identifier for the payment.

  2. Capture the payment with a /capture request, specifying:

    • originalReference: The pspReference of the payment.
    • modificationAmount: The value and currency specified in the payment request.
    /capture request
     {
       "{hint:The pspReference of the payment}originalReference{/hint}": "8515785619639602",
       "modificationAmount": {
         "value": 1000,
         "currency": "EUR"
       },
       "reference": "Your modification reference",
       "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
     }

    You receive a response containing:

    • pspReference: The PSP reference associated with this capture request. Note that this is different from the PSP reference associated with the original payment request.

    The payment will then go through SentforSettle, Settled, and finally the Chargeback status. This process can take up to 24 hours to complete.

  3. Wait for the notification. In this example, you will receive a NOTIFICATION_OF_CHARGEBACK. This notification contains a pspReference, which is the unique identifier for the dispute. For example:

    {
    "live":"false",
    "notificationItems":[
      {
         "NotificationRequestItem":{
            "additionalData":{
               "chargebackReasonCode":"10.4",
               "modificationMerchantReferences":"",
               "chargebackSchemeCode":"visa",
               "defensePeriodEndsAt":"2020-11-29T01:30:57+01:00",
               "autoDefended":"false"
            },
            "amount":{
               "currency":"EUR",
               "value":1000
            },
            "eventCode":"NOTIFICATION_OF_CHARGEBACK",
            "eventDate":"2020-11-11T01:30:57+01:00",
            "merchantAccountCode":"YOUR_MERCHANT_ACCOUNT",
            "merchantReference":"YOUR_ORDER_NUMBER",
            "originalReference":"8515785619639602",
            "paymentMethod":"visa",
            "pspReference":"9915555555555555",
            "reason":"Other Fraud-Card Absent Environment",
            "success":"true"
         }
      }
    ]
    }
  4. After the chargeback is created, use the Disputes API and follow the steps to retrieve defense reasons request, upload dispute defense documents, and defend the dispute.