Refund Transaction
This route is used when you want to refund a Paid Transaction. Only the transaction_id
of the transaction is required for the refund to be effective, passed in the PATH of the endpoint.
Note
Only transactions with paid
status can be refunded.
POSTv1/refund/:transaction_id
Request Path Variable
Attribute | Type | Description |
---|---|---|
transaction_id | string | Transaction ID to be refunded. |
Attention
It is necessary to save the transaction_id
that Marlim returns in transaction requests in your application. Only with this id will it be possible to proceed with the refund.
Request Body Params
Attribute | Type | Description |
---|---|---|
amount | number | Optional parameter if you want to refund a value smaller than the total paid (partial refund). If this parameter is omitted, the amount refunded will be the total amount paid previously (full refund). |
Samples
- Status Refunded (Full)
- Status Refunded (Partial)
- Previously Refunded Transaction
- Transaction Not Found
curl -X POST "https://api.wu.global.marlim.co/v1/refund/55554444" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
-d '{}'
{
"status": "refunded",
"nsu": "55554444",
"order_id": "123456789",
"date_created": "2022-05-04T02:00:00.000Z",
"date_updated": "2022-05-04T03:00:00.000Z",
"net_value": 300000,
"authorized_amount": 320341,
"paid_amount": 0,
"refunded_amount": 320341,
"installments": "3",
"transaction_id": "55554444",
"card_holder_name": "Lord Darth Vader",
"card_brand": "amex",
"card_first_digits": "777788",
"card_last_digits": "4444",
"acquirer_status_code": "0000"
}
curl -X POST "https://api.wu.global.marlim.co/v1/refund/66667777" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
-d '{
"amount": 300000
}'
{
"amount": "refunded",
"nsu": "55554444",
"order_id": "123456789",
"date_created": "2022-05-04T02:00:00.000Z",
"date_updated": "2022-05-04T03:00:00.000Z",
"net_value": 300000,
"authorized_amount": 320341,
"paid_amount": 20341,
"refunded_amount": 300000,
"installments": "3",
"transaction_id": "55554444",
"card_holder_name": "Lord Darth Vader",
"card_brand": "amex",
"card_first_digits": "777788",
"card_last_digits": "4444",
"acquirer_status_code": "0000"
}
curl -X POST "https://api.wu.global.marlim.co/v1/refund/55554444" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
-d '{}'
{
"errors": {
"type": "transaction",
"message": "Transaction with ID '55554444' is already refunded."
}
}
curl -X POST "https://api.wu.global.marlim.co/v1/refund/12345678" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
-d '{}'
{
"errors": {
"type": "transaction",
"message": "Transaction with ID '12345678' was not found."
}
}