Void order
caution
Void requests are only accepted for confirmed orders.
An order accepts several partial voids only if the sum of the amount does not exceed the total of the original order. If the total amount is void, the order will be canceled.
01 - Check voids
- http
- shell
- python
- php
- C#
GET /orders/:orderId/void HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
$ curl "https://api.aplazame.com/orders/:orderId/void" \
-H "Accept: application/vnd.aplazame.v1+json" \
-H "Authorization: Bearer api_private_key"
import aplazame_sdk
client = aplazame_sdk.Client('api_private_key')
response = client.void_check(':orderId')
<?php
use Aplazame\Api\Client as AplazameClient;
$aplazameClient = new AplazameClient("https://api.aplazame.com", AplazameClient::ENVIRONMENT_PRODUCTION, " api_private_key");
$result = $aplazameClient->get("/orders/{$orderId}/void");
using Aplazame.Api;
Client client = new Client("https://api.aplazame.com", Client.EnvironmentProduction, " api_private_key");
dynamic result = client.Get($"/orders/{orderId}/void");
| Parameter | Type | Required | Description |
|---|---|---|---|
| :orderId | string | Sí | Order ID. |
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Aplazame-Media-Type: aplazame.v1
{
"remaining_amount":60020,
"results":[
{
"amount":1000,
"id":"7b596c68e9044737a838d54b9e7971a3",
"created":"2020-10-09T13:56:09.043797+02:00"
},
{
"amount":500,
"id":"e07b9d47a72c4c7d8c9fc0c0bb2ba9b9",
"created":"2020-10-09T13:59:05.697921+02:00"
}
]
}
| Parameter | Type | Description |
|---|---|---|
| remaining_amount | decimal | Remaining capture amount |
| results | collection | List of voids |
02 - Request void
- http
- shell
- python
- php
- C#
POST /orders/:orderId/void HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
{
"amount": 10050
}
$ curl "https://api.aplazame.com/orders/:orderId/void" \
-H "Accept: application/vnd.aplazame.v1+json" \
-H "Authorization: Bearer api_private_key" \
-X POST \
-d "amount=10050"
import aplazame_sdk
client = aplazame_sdk.Client('api_private_key')
response = client.void(':orderId', 10050)
<?php
use Aplazame\Api\Client as AplazameClient;
$aplazameClient = new AplazameClient("https://api.aplazame.com", AplazameClient::ENVIRONMENT_PRODUCTION, " api_private_key");
$result = $aplazameClient->post("/orders/{$orderId}/void", ["amount" => Aplazame\Serializer\Decimal::fromFloat(100.50)->value]);
using Aplazame.Api;
Client client = new Client("https://api.aplazame.com", Client.EnvironmentProduction, " api_private_key");
dynamic result = client.Post($"/orders/{orderId}/void", new {amount = Aplazame.Serializer.DecimalType.FromDouble(100.50)});
| Parameter | Type | Required | Description |
|---|---|---|---|
| :orderId | string | Sí | Order ID. |
| amount | decimal | Sí | Amount to void. |
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Aplazame-Media-Type: aplazame.v1
{
"remaining_amount":60020,
"results":[
{
"amount":1000,
"id":"7b596c68e9044737a838d54b9e7971a3",
"created":"2020-10-09T13:56:09.043797+02:00"
},
{
"amount":500,
"id":"e07b9d47a72c4c7d8c9fc0c0bb2ba9b9",
"created":"2020-10-09T13:59:05.697921+02:00"
}
]
}
| Parameter | Type | Description |
|---|---|---|
| remaining_amount | decimal | Remaining capture amount |
| results | collection | List of voids |