Payments

Simulate a payment

Changed on

Drive a sandbox payment to a terminal status immediately, whatever its amount and payment method. Sandbox only: a production API key is rejected with 403 FORBIDDEN, and a production payment id is not visible to a sandbox key, so it returns 404. REFUNDED marks the payment paid if it is not already and then issues a full refund, which follows the sandbox refund matrix: a payment whose amount ends in .02 fails with 400 PSP_REFUND_FAILED; DISPUTED marks it paid if it is not already and then moves it to CHARGEBACK, which is a chargeback and not a MED.

post/v1/payments/{paymentId}/simulate

Request

Path parameters

paymentIdstring uuid required

The sandbox payment ID to simulate.

Headers

X-Idempotency-Keystring

Optional for this endpoint. Honoured when sent — replay and payload check apply — but omitting it is not rejected.

Request body

status'PAID' | 'CANCELLED' | 'EXPIRED' | 'REFUNDED' | 'DISPUTED'

Terminal outcome to apply. Defaults to PAID when the body is empty or omitted.

Response

The payment after the simulated transition.

Example response

{
  "payment": {
    "coupon": {
      "code": "BLACK10"
    }
  }
}

Changes

    • warning

      added the new FREE enum value to the / response property for the response status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property / to the response with the status