Captura del pedido Sólo se aceptan solicitudes de una captura para el producto pago en 15 días y el pedido ha de estar confirmado.
Se ha de realizar una captura cuando se proceda al envío del producto o productos por el total del valor de los mismos. El importe de la captura debe corresponder al importe total del pedido menos el importe total de los artículos anulados.
{
"amount" : 10050 ,
"id" : "cf04aa87a6364f14b164e48a84e99936" ,
"created" : "2019-06-21T16:51:19.494155+02:00" ,
"refunds" : [ ] ,
"refunded_amount" : 0 ,
"remaining_amount" : 0
}
Parámetro
Tipo
Requerido
Descripción
amount
decimal
si
Importe de la captura
id
string
si
id
de la captura
created
string
si
Fecha de la captura
refunds
object
no
Devoluciones realizadas a la captura.
refunded_amount
decimal
si
Cantidad devuelta de la captura
remaining_amount
decimal
si
Cantidad restante de la captura (Siempre será 0)
01. Detalle de la capturaGET /orders/:orderId /captures HTTP/1.1
application/vnd.aplazame.v1+json
Bearer api_private_key
api.aplazame.com
$ curl "https://api.aplazame.com/orders/:orderId/captures" \
-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. get_capture_refund( ':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 } /captures" ) ;
using Aplazame. Api ;
Client client = new Client ( "https://api.aplazame.com" , Client. EnvironmentProduction, "api_private_key " ) ;
dynamic result = client. Get ( $"/orders/ { orderId } /captures" ) ;
Parámetro
Tipo
Requerido
Descripción
:orderId
string
si
ID del pedido.
Respuesta
HTTP/1.1 200 OK
application/json; charset=utf-8
aplazame.v1
{
"remaining_capture_amount" : 60020 ,
"results" : [
{
"amount" : 10050 ,
"id" : "cf04aa87a6364f14b164e48a84e99936" ,
"created" : "2019-06-21T16:51:19.494155+02:00" ,
"refunds" : [ ] ,
"refunded_amount" : 0 ,
"remaining_amount" : 10050
}
]
}
Parámetro
Tipo
Descripción
remaining_capture_amount
decimal
Cantidad restante del pedido sin capturar (Siempre será 0)
results
object
Capturas del pedido
02. Solicitar capturaPOST /orders/:orderId /captures HTTP/1.1
application/vnd.aplazame.v1+json
Bearer api_private_key
api.aplazame.com
{
"amount": 10050
}
$ curl "https://api.aplazame.com/orders/:orderId/captures" \
-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. capture_refund( ':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 } /captures" , [ "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 } /captures" , new { amount = Aplazame. Serializer. DecimalType. FromDouble ( 100.50 ) } ) ;
Parámetro
Tipo
Requerido
Descripción
:orderId
string
si
ID del pedido.
amount
decimal
si
Importe a capturar
Respuesta
HTTP/1.1 200 OK
application/json; charset=utf-8
aplazame.v1
{
"remaining_capture_amount" : 49970 ,
"amount" : 10050 ,
"id" : "cf04aa87a6364f14b164e48a84e99936" ,
"created" : "2019-06-21T16:51:19.494155+02:00" ,
"refunds" : [ ] ,
"refunded_amount" : 0 ,
"remaining_amount" : 10050
}
Parámetro
Tipo
Descripción
remaining_capture_amount
decimal
Cantidad restante del pedido sin capturar (Siempre será 0)
amount
decimal
Importe de la captura
id
string
id
de la captura
created
string
Fecha de la captura
refunds
object
Devoluciones realizadas a la captura.
refunded_amount
decimal
Cantidad devuelta de la captura
remaining_amount
decimal
Cantidad restante de la captura (Siempre será 0)