Anular pedido
precaución
Sólo se aceptan anulaciones para pedidos confirmados.
Un pedido acepta varias anulaciones parciales siempre que el sumatorio del importe de las mismas no supere el total del pedido original. Si se anula el importe total, el pedido será cancelado.
01 - Comprobar anulaciones
- 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");
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
| :orderId | string | Sí | ID del pedido. |
Respuesta
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"
}
]
}
| Parámetro | Tipo | Descripción |
|---|---|---|
| remaining_amount | decimal | Cantidad restante del pedido. |
| results | collection | Listado de anulaciones. |
02 - Solicitar anulación
- 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)});
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
| :orderId | string | Sí | ID del pedido. |
| amount | decimal | Sí | Importe a anular. |
Respuesta
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"
}
]
}
| Parámetro | Tipo | Descripción |
|---|---|---|
| remaining_amount | decimal | Cantidad restante del pedido. |
| results | collection | Listado de anulaciones. |