Refund a Transaction
POST/v2/orders/:orderID/transactions/:transactionID/refund
There are two ways to refund; through your payment gateway and mark it refunded in Commerce Manager, or directly through Commerce Manager or API.
- Mark as Refunded: You can manually mark a transaction as refunded. Before you can mark the order as refunded, you need to handle the actual refund on your side with your payment provider. Mark as Refunded is a full refund made to the transaction.
- Refund through Composable Commerce: You can process a full or partial refund to a supported payment provider directly from Commerce Manager or API by providing the refund amount. When you start the refund process, the request is directly sent to the payment gateway.
If you use manual gateway for partial or full refund, you need to handle the actual refund on your side with your payment provider.
Request
Path Parameters
The UUID of the order.
The UUID of the transaction you want to refund.
- application/json
Body
data object
The amount value to be refunded. If this field is not provided, it will be considered as manual refund (Mark as Refunded) and the refund process must be manually handled via payment provider. If the amount value is same as payment value, then it will be treated as a full refund and sent to the payment provider to process refund automatically.
options object
Provides comments about the refund. It is used by PayPal Express.
Responses
- 200
- 401
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
data object
The ID of the transaction.
The payment gateway reference.
A custom name associated with the payment method.
A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend you not to include personal information in this field.
Possible values: [adyen
, authorize_net
, braintree
, card_connect
, cyber_source
, elastic_path_payments_stripe
, manual
, paypal_express_checkout
, stripe
, stripe_connect
, stripe_payment_intents
]
The name of the payment gateway used.
The amount for this transaction.
The refunded amount.
The transaction currency.
The type of transaction, such as purchase
, capture
, authorize
or refund
.
The status provided by the gateway for this transaction, such as complete
or failed
.
relationships object
order object
data object
Represents the type of the object being returned. It is always order
.
The ID of the order.
meta object
display_price object
The raw total of this cart.
The currency set for this cart.
The tax inclusive formatted total based on the currency.
display_refunded_amount object
The raw total of this cart.
The currency set for this cart.
The tax inclusive formatted total based on the currency.
timestamps object
The date this was created.
The date this was last updated.
{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"reference": "string",
"name": "string",
"custom_reference": "string",
"gateway": "adyen",
"amount": 0,
"refunded_amount": 0,
"currency": "string",
"transaction-type": "string",
"status": "string",
"relationships": {
"order": {
"data": {
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
},
"meta": {
"display_price": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"display_refunded_amount": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"timestamps": {
"created_at": "string"
}
}
}
}
Unauthorized
- application/json
- Schema
- Example (from schema)
- Example
Schema
[
null
]
{
"errors": {
"status": 401,
"title": "Unauthorized"
}
}