diff --git a/docs/api/11-api-orders/history.mdx b/docs/api/11-api-orders/history.mdx deleted file mode 100644 index b29f65b..0000000 --- a/docs/api/11-api-orders/history.mdx +++ /dev/null @@ -1,231 +0,0 @@ ---- -title: Historial -sidebar_position: 10 -keywords: [orders history, list, index] ---- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# Historial de pedidos {#history} - -:::info -Una vez iniciado el proceso de pago, se recomienda realizar el envío del historial de compra del cliente en el comercio para mejorar la concesión de la solicitud de financiación. -::: - -Se recomienda realizar el envío de manera asíncrona para no retrasar la carga de la plantilla. - - - - -```http -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 -``` -```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 - } -}] -``` - - - -```shell -$ 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 - } - } - ]' -``` - - - -```python -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 - "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); -``` - - - -```csharp -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); -``` - - - -|Parámetro | Tipo | Descripción| -|---------|---------|---------| -:orderId | string | Sí. | `id` del pedido -id | string | Sí. | `id` del pedido -amount | [decimal](../../api-reference#decimals) | Sí. | Importe del pedido -due | [decimal](../../api-reference#decimals) | No. | Importe total del pedido -status | string | Sí. | Estado del pedido; Las opciones son `pending`, `cancelled`, `processing` y `complete` -type | string | Sí. | Tipo de pedido -order_date | string | Sí. | Fecha del pedido -currency | [ISO 4217](https://es.wikipedia.org/wiki/ISO_4217) | Sí. | Código de la moneda del pedido -[billing](../../checkout-creation/#billing) | object | No. | Dirección de facturación. -[shipping](../../checkout-creation/#shipping) | object | No. | Información de envío. - -#### Response - -```http -HTTP/1.1 204 No Content -X-Aplazame-Media-Type: aplazame.v1 -``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/api/11-api-orders/history.mdx b/i18n/en/docusaurus-plugin-content-docs/current/api/11-api-orders/history.mdx deleted file mode 100644 index 56b9fe2..0000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/api/11-api-orders/history.mdx +++ /dev/null @@ -1,231 +0,0 @@ ---- -title: History -sidebar_position: 10 -keywords: [orders history, history, list, index] ---- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# 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 -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 -``` -```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 - } -}] -``` - - - -```shell -$ 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 - } - } - ]' -``` - - - -```python -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 - "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); -``` - - - -```csharp -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); -``` - - - -|Parámetro | Tipo | Descripción| -|---------|---------|---------| -:orderId | string | | Your order `id` -id | string | | Your order `id` -amount | [decimal](../../api-reference#decimals) | | Order amount -due | [decimal](../../api-reference#decimals) | No | Total order amount due -status | string | | "Order status; the choices are `pending`, `cancelled`, `processing` and `complete` -type | string | | Order type -order_date | string | | Date of the order -currency | [ISO 4217](https://es.wikipedia.org/wiki/ISO_4217) | | Currency code of the order -[billing](../../checkout-creation/#billing) | object | No | Billing address -[shipping](../../checkout-creation/#shipping) | object | No | Shipping info - -#### Response - -```http -HTTP/1.1 204 No Content -X-Aplazame-Media-Type: aplazame.v1 -```