Orders history
info
Once the payment process has begun, sending the history of the customer's store purchases is recommended in order to improve the likelihood of the financing request being accepted.
It is recommended that this be sent asynchronously so as not to delay the loading of the template.
- http
- shell
- python
- php
- C#
POST /orders/:orderId/history HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
Content-Type: application/json
[{
"id": "18857527248912279381",
"amount": 12080,
"due": "",
"status": "cancelled",
"type": "paypal",
"order_date": "2014-03-21T13:56:45+0000",
"currency": "EUR",
"billing": null,
"shipping": {
"first_name": "Django",
"last_name": "Reinhard",
"phone": "616123456",
"alt_phone": "+34917909930",
"street": "Plaza del Angel nº10",
"address_addition": "Cerca de la plaza Santa Ana",
"city": "Madrid",
"state": "Madrid",
"country": "ES",
"postcode": "28012",
"price": 500,
"tax_rate": 2100,
"name": "Planet Express",
"discount": 100
}
}]
$ curl "https://api.aplazame.com/orders/:orderId/history" \
-H "Accept: application/vnd.aplazame.v1+json" \
-H "Authorization: Bearer api_private_key" \
-X POST \
--data-binary '[
{
"id": "18857527248912279381",
"amount": 12080,
"due": "",
"status": "cancelled",
"type": "paypal",
"order_date": "2014-03-21T13:56:45+0000",
"currency": "EUR",
"shipping": {
"first_name": "Django",
"last_name": "Reinhard",
"phone": "616123456",
"alt_phone": "+34917909930",
"street": "Plaza del Angel nº10",
"address_addition": "Cerca de la plaza Santa Ana",
"city": "Madrid",
"state": "Madrid",
"country": "ES",
"postcode": "28012",
"price": 500,
"tax_rate": 2100,
"name": "Planet Express",
"discount": 100
}
}
]'
import aplazame_sdk
payload = [
{
"id": "18857527248912279381",
"amount": 12080,
"due": "",
"status": "cancelled",
"type": "paypal",
"order_date": "2014-03-21T13:56:45+0000",
"currency": "EUR",
"billing": None,
"shipping": {
"first_name": "Django",
"last_name": "Reinhard",
"phone": "616123456",
"alt_phone": "+34917909930",
"street": "Plaza del Angel nº10",
"address_addition": "Cerca de la plaza Santa Ana",
"city": "Madrid",
"state": "Madrid",
"country": "ES",
"postcode": "28012",
"price": 500,
"tax_rate": 2100,
"name": "Planet Express",
"discount": 100
}
}
]
client = aplazame_sdk.Client('api_private_key')
response = client.history(':orderId', payload)
<?php
use Aplazame\Api\Client as AplazameClient;
$payload = [
[
"id" => "18857527248912279381",
"amount" => Aplazame\Serializer\Decimal::fromFloat(120.80)->value,
"due" => "",
"status" => "cancelled",
"type" => "paypal",
"order_date" => Aplazame\Serializer\Date::fromDateTime(new DateTime("2014-03-21 13:56:45"))->value,
"currency" => "EUR",
"billing" => null,
"shipping" => [
"first_name" => "Django",
"last_name" => "Reinhard",
"phone" => "616123456",
"alt_phone" => "+34917909930",
"street" => "Plaza del Angel nº10",
"address_addition" => "Cerca de la plaza Santa Ana",
"city" => "Madrid",
"state" => "Madrid",
"country" => "ES",
"postcode" => "28012",
"price" => Aplazame\Serializer\Decimal::fromFloat(5)->value,
"tax_rate" => Aplazame\Serializer\Decimal::fromFloat(21)->value,
"name" => "Planet Express",
"discount" => Aplazame\Serializer\Decimal::fromFloat(1)->value,
],
],
];
$aplazameClient = new AplazameClient("https://api.aplazame.com", AplazameClient::ENVIRONMENT_PRODUCTION, " api_private_key");
$result = $aplazameClient->post("/orders/{$orderId}/history", $payload);
using Aplazame.Api;
dynamic payload = [
[
"id" => "18857527248912279381",
"amount" => Aplazame.Serializer.DecimalType.FromDouble(120.80),
"due" => "",
"status" => "cancelled",
"type" => "paypal",
"order_date" => Aplazame.Serializer.DateType.FromDateTime(DateTime.Parse("2014-03-21 13:56:45")),
"currency" => "EUR",
"billing" => null,
"shipping" => [
"first_name" => "Django",
"last_name" => "Reinhard",
"phone" => "616123456",
"alt_phone" => "+34917909930",
"street" => "Plaza del Angel nº10",
"address_addition" => "Cerca de la plaza Santa Ana",
"city" => "Madrid",
"state" => "Madrid",
"country" => "ES",
"postcode" => "28012",
"price" => Aplazame.Serializer.DecimalType.FromDouble(5),
"tax_rate" => Aplazame.Serializer.DecimalType.FromDouble(21),
"name" => "Planet Express",
"discount" => Aplazame.Serializer.DecimalType.FromDouble(1),
],
],
];
Client client = new Client("https://api.aplazame.com", Client.EnvironmentProduction, " api_private_key");
dynamic result = client.Post($"/orders/{orderId}/history", payload);
| Parameter | Type | Description |
|---|---|---|
| :orderId | string | Sí |
| id | string | Sí |
| amount | decimal | Sí |
| due | decimal | No |
| status | string | Sí |
| type | string | Sí |
| order_date | string | Sí |
| currency | ISO 4217 | Sí |
| billing | object | No |
| shipping | object | No |
Response
HTTP/1.1 204 No Content
X-Aplazame-Media-Type: aplazame.v1