Order Details
How to get a list of your orders?
You can send a GET
request to /openapi/v2/orders
to get a list of all your orders, their statuses, when they were created and their latest update.
You can also use the following filters to define your search. If no filter is set up, by default the list is sorted by “updatedAt”: “desc”. By updated it means that any action within the order has happenned (eg. orderorderline status change, new file is attached or orderline was refunded).
filter[status][]
: array[string] -> possible status are placed, confirmed, shipped, return_requested, return_accepted, return_declined, canceled. You can also filter by several statuses at once. Example:filter[status][]=shipped&filter[status][]=placed
filter[origin]
: order origin. Example: DE_MAIN, ES_MAIN, IT_MAIN.filter[destination]
: order destination. Example: DE_MAIN, ES_MAIN, IT_MAIN.filter[created][from]
: string($date-time): 2021-04-01T00:01:01+00:00filter[created][to]
: string($date-time): 2021-04-01T00:01:01+00:00filter[updated][from]
: string($date-time): 2021-04-01T00:01:01+00:00filter[updated][to]
: string($date-time): 2021-04-01T00:01:01+00:00offset
: integerlimit
: integer - default value 20 (limit + offset max 10000)sort[createdAt]
: asc or desc.
Note: $datetime
format.
Example: This request will return a list of your orders in status placed or shipped created between 2021-04-01 10:00:00 and 2021-04-13 12:00:00 sorting in ascending order.
https://app-order-management.sandbox.infra.metro-markets.cloud/openapi/v2/orders?filter%5Bstatus%5D%5B%5D=placed&filter%5Bstatus%5D%5B%5D=shipped&filter%5Bcreated%5D%5Bfrom%5D=2021-04-01T12%3A00%3A00%2B00%3A00&filter%5Bcreated%5D%5Bto%5D=2021-04-13T12%3A00%3A00%2B00%3A00&sort%5BcreatedAt%5D=asc
Response:
You will need the orderId
to get the detailed information about the order.
{
"items": [
{
"orderId": "ef6cad08-4f2c-4c39-b65e-1134afa630bc",
"status": "placed",
"updatedAt": "2021-04-01T13:32:53+00:00",
"createdAt": "2021-04-01T13:32:48+00:00"
},
{
"orderId": "66b59abd-9c24-4458-9183-173a667e0330",
"status": "shipped",
"updatedAt": "2021-04-12T14:46:20+00:00",
"createdAt": "2021-04-12T14:46:13+00:00"
}
],
"totalCount": 2
}
How to get the detailed information about an specific order?
Once you have the orderId
you can send a GET
request /openapi/v2/orders/{orderId}
and you will get all information about the order with all orderlines.
In the swagger documentation you can see a response example and in Model
you can see more information about the parameters.
Here we will just highlight some of them:
- payment
-
method": “open_invoice”:
"payment": { "method": "open_invoice", "accountHolder": "RatePAY GmbH", // static value of Marketplace account in the RatePay "accountBank": "Commerzbank AG Berlin", // static value of Marketplace account in the RatePay "accountBic": "COBADEBBXXX", // static value of Marketplace account in the RatePay "accountIban": "DE50100400000201630100", // static value of Marketplace account in the RatePay "paymentReference": "DN0199729L9", //dynamic value, Ratepay ID id that unique per transaction, you need it when generating the invoice "dueDate": "2021-05-06", //dynamic value, date of transaction expiration, YYYY-MM-DD "dueDuration": "P14D"// static value of transaction duration, it means 14 days "paymentSystem": null // It's not used at the moment and always null }
-
method": “credit_card”:
"payment": { "paymentSystem": null, // It's not used at the moment and always null "method": "credit_card" },
-
method": “direct_debit”:
"payment": { "method": "direct_debit", "paymentSystem": null, "accountHolder": "RatePAY GmbH", "accountBank": "Commerzbank AG Berlin", "accountBic": "COBADEBBXXX", "accountIban": "DE50100400000201630100", "paymentReference": "DN0192388G7", "dueDate": "2021-04-29", "dueDuration": "P14D" },
-
method": “paypal”:
"payment": { "method": "paypal" },
-
method": “sofort”:
"payment": { "method": "sofort" },
-
method": “iDEAL”:
"payment": { "method": "ideal", "paymentSystem": null },
-
buyerDetails
- type: Consumer / Entrepreneur
- companyVat: is a proof that the company is registered for VAT and identifies the company for VAT related transactions (as usually reflected in finance documents for cross boarder shipments). Value can be empty.
- taxNumber: identifies entity to the inland revenue, which is separate from VAT related transactions. According to legal requirements, invoices for purchases within Spain, must have tax reference. You will receive this value with default title “NIF, CIF, NIE". Value can be empty.
- id: it is a public buyer ID that you can use it to have a history of all orders of a buyer.
- eInvoice: it´s used to create invoices for B2B buyers in Italy.
- buyerDetails/address/shipping/stateOrProvince and buyerDetails/address/billing/starteOrProvince: used for Italy.
- email: anonymous e-mail. You can use it to send emails to the buyer.
-
salesChannel
- platform: it will be implemented in the future. Now it returns “unknown”.
-
financialDetails: it provides the breakdown of the price (Net, Gross and Vat).
-
orderLines: each item which has been ordered is reflected in an
orderLine
-
taxRate: it´s the VAT.
-
returnReason:
value title 1 Have changed my mind 2 Delayed delivery 3 It does not work 4 Packaging is intact, contents damaged 5 Packaging and contents damaged 6 Wrong delivery 7 Parts of the order are missing 8 Does not correspond to the description / the photos 9 I found a better price 10 Delivery is not possible -
splits: it´s used to handle partial actions, for instance returns. Example of an one orderline wich quantity was = 5, but buyer returns 3 items. Then we split orderLines with the new quantity and status.
"splitOrderLineId": "ebe7063b-e03a-4d06-9a9a-a359379514b7", // original orderLineId "status": "shipped", "quantity": 2, ..... "splitOrderLineId": "1332d20c-8de8-4f0f-8b27-ab61eddec5a1", // new orderLineId containing the partial return. Actions of this orderline need to be done using this splitOrderLineId "status": "return_requested", "quantity": 3,
-
-