Skip to main content
POST
Cancel or Refund with Transaction (two cards)
This request acts on one card of a payment created with Create Payment (two cards), using the id of that card’s transaction from payment_method.payment_methods[].transactions:
  • Cancels the card if it is only authorized.
  • Refunds the card if it was charged. The refund is capped at that card’s amount minus what was already refunded on it.
The response is 201 with the payment in the v2 shape.
While a card has an open chargeback, refunds are rejected with INVALID_STATUS.
This request requires an X-Idempotency-Key. See Authentication for details.

Authorizations

public-api-key
string
header
default:<Your public-api-key>
required
private-secret-key
string
header
default:<Your private-secret-key>
required

Headers

X-Idempotency-Key
string<uuid>
required

Unique key for this request. Required on every v2 payment request. Retry an unclear outcome with the same key. Without it the request is rejected with 400 INVALID_PARAMETERS: "The header 'x-idempotency-key' is required."

Path Parameters

payment_id
string<uuid>
required

The id of the payment returned by POST /v2/payments.

transaction_id
string<uuid>
required

The id of the card transaction to operate on, from payment_method.payment_methods[].transactions[].

Body

application/json
description
string

Description of the cancellation or refund. (MAX 255; MIN 3).

reason
enum<string>

Reason for the operation. Possible values are DUPLICATE, FRAUDULENT and REQUESTED_BY_CUSTOMER.

Available options:
DUPLICATE,
FRAUDULENT,
REQUESTED_BY_CUSTOMER
merchant_reference
string

Identification of the payment transaction defined by the merchant. If no merchant_reference is defined, the merchant_order_id of the payment will be associated to the transaction. (MAX 255; MIN 3).

amount
object

Optional. Amount to refund on this card.

customer_payer
object

Specifies customer object for payments.

payment_method
object

Specifies payment method object for payments.

Response

The payment after the operation, in the v2 shape

A payment funded by two cards.

id
string<uuid>
account_id
string<uuid>
description
string
country
string
status
string

Aggregated status of the payment. See Pay with two cards.

sub_status
string

Aggregated sub status, for example APPROVED, AUTHORIZED, PARTIALLY_CAPTURED, PARTIALLY_REFUNDED, REFUND_RETRY_IN_PROCESS or CANCEL_RETRY_IN_PROCESS.

merchant_order_id
string
merchant_reference
string
created_at
string<date-time>
updated_at
string<date-time>
split_payment_methods
boolean

true for a payment funded by two cards.

payment_methods_count
integer

Number of cards that fund the payment: 2.

sdk_action_required
boolean

true when the SDK must continue the payment, for example to run a 3DS challenge.

amount
object

Total of the payment.

checkout
object
payment_method
object
customer_payer
object

The payer, as sent in the request.

additional_data
object | null
callback_url
string
workflow
enum<string>
Available options:
DIRECT,
REDIRECT,
SDK_CHECKOUT
metadata
object[]