Skip to main content

Refund orders

caution

Refund requests are only accepted for confirmed orders.

To make a refund, It will be done in one way or another depending on the type of operation

Check remaining amount​

Refund online financing

An order accepts several partial returns only if the sum of the amount does not exceed the total of the original order. If the total amount is refunded, the order will be canceled.

Each partial refund operation affects the amount of future loan instalments. The amount of the refund will be reflected in the store’s commercial transactions and may include a refund of the amount to the buyer.

01 - Check remaining amount​

GET /orders/:orderId/refund HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
ParameterTypeRequiredDescription
:orderIdstringSíOrder ID.

Response​

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Aplazame-Media-Type: aplazame.v1
{
"remaining_amount": 70070
}

02 - Request refund​

POST /orders/:orderId/refund HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
{
"amount": 10050
}
ParameterTypeRequiredDescription
:orderIdstringSíOrder ID.
amountdecimalSíAmount to refund.

Response​

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Aplazame-Media-Type: aplazame.v1
{
"remaining_amount": 60020
}
ParameterTypeDescription
remaining_amountdecimalRemaining capture amount
resultscollectionList of voids

Check remaining amount​

The refund is made at the capture level within an order. Being possible the refund of several captures.

A capture of an order accepts several partial refunds only if the sum of the amount does not exceed the total of the original capture.

{
"id": "db654bf752a84b7eaf6fcb7ab5801f60",
"amount": 10050,
"pending_amount": 0,
"accrual_date": "2019-06-21",
"credit_to_customer": 0,
"completed": false,
"completed_but_defaults": false,
"created": "2019-06-21T16:52:07.733892+02:00"
}
ParameterTypeRequiredDescription
idstringSíYour refund ID.
amountdecimalSíRefund amount.
pending_amountdecimalSíRemaining capture amount.
accrual_datestringSíEffective date of refund.
credit_to_customerdecimalSíRefund amount to customer.
completedbooleanSíOrder completed.
completed_but_defaultsbooleanSíOrder completed but with defaults.
createdstringSíDate of refund.

01 - Check remaining amount​

GET /orders/:orderId/captures/:captureId/refunds HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
ParameterTypeRequiredDescription
:orderIdstringSíOrder ID.
:captureIdstringSíID de la captura.

Response​

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Aplazame-Media-Type: aplazame.v1
{
"amount": 70070,
"id": "cf04aa87a6364f14b164e48a84e99936",
"created": "2019-06-21T16:51:19.494155+02:00",
"refunds": [],
"refunded_amount": 0,
"remaining_amount": 70070
}
ParameterTypeDescription
amountdecimalCapture amount
idstringYour capture id
createdstringDate of the capture
refundsobjectRefunds on capture done
refunded_amountdecimalRefunded capture amount
remaining_amountdecimalRemaining capture amount (It will always be 0)

02 - Request refund​

POST /orders/:orderId/captures/:captureId/refunds HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
{
"amount": 10050
}
ParameterTypeRequiredDescription
:orderIdstringSíOrder ID.
:captureIdstringSíCapture ID.
amountdecimalSíAmount to refund.

Response​

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Aplazame-Media-Type: aplazame.v1
{
"amount": 70070,
"id": "cf04aa87a6364f14b164e48a84e99936",
"created": "2019-06-21T16:51:19.494155+02:00",
"refunds": [
{
"id": "db654bf752a84b7eaf6fcb7ab5801f60",
"amount": 10050,
"pending_amount": 60020,
"accrual_date": "2019-06-21",
"credit_to_customer": 0,
"completed": false,
"completed_but_defaults": false,
"created": "2019-06-21T16:52:07.733892+02:00"
}
],
"refunded_amount": 10050,
"remaining_amount": 60020
}
ParameterTypeDescription
amountdecimalCapture amount.
idstringYour capture ID.
createdstringDate of the capture.
refundsobjectRefunds on capture done.
refunded_amountdecimalRemaining capture amount.
remaining_amountdecimalRemaining capture amount.