For Tech Specialists
- Home
- All courses
- For Tech Specialists
- Introduction Course for eCommerce Tech Specialists
- Home
- Courses
- For Tech Specialists
- Introduction Course for eCommerce Tech Specialists
API methods to work with orders from stores and shipments
The main API methods to work with orders from stores and shipments. With their help, you can retrieve, add, and update orders.
1. order.list
This method allows receiving a list of orders from the store. It returns four orders by default.
Response structure:
{
"return_code": int,
"return_message": string,
"result":{
"orders_count": int,
"order":[ array
{
"id": string,
"order_id": string,
"customer":[ array
{
"id": string,
"email": string,
"first_name": string,
"last_name": string
}
],
"create_at": string,
"currency":[ array
{
"name": string,
"iso3": string,
"code": deprecated,
"symbol_left": string,
"symbol_right": string,
"rate": decimal
}
],
"billing_address":[ array
{
"id": string,
"type": string,
"first_name": string,
"last_name": string,
"postcode": string,
"address1": string,
"address2": string,
"phone": string,
"city": string,
"country":[ array
{
"code2": string,
"code3": string,
"name": string
}
],
"state":[ array
{
"code": string,
"name": string
}
],
"company": string,
"fax": string,
"website": string,
"gender": string,
"region": string,
"default": string,
"tax_id": string
}
],
"shipping_address":[ array
{
"id": string,
"type": string,
"first_name": string,
"last_name": string,
"postcode": string,
"address1": string,
"address2": string,
"phone": string,
"city": string,
"country":[ array
{
"code2": string,
"code3": string,
"name": string
}
],
"state":[ array
{
"code": string,
"name": string
}
],
"company": string,
"fax": string,
"website": string,
"gender": string,
"region": string,
"default": string,
"tax_id": string
}
],
"payment_method":[ array
{
"name": string
}
],
"shipping_method":[ array
{
"name": string
}
],
"shipping_methods":[ array
{
"name": string
}
],
"status":[ array
{
"id": string,
"name": string,
"history":[ array
{
"history":[ array
{
"id": string,
"name": string,
"modified_time": string,
"notify": string,
"comment": string
}
...
]
}
],
"refund_info":[ array
{
"shipping": decimal,
"fee": decimal,
"total_refunded": decimal,
"tax": decimal,
"time": string,
"comment": string,
"refunded_items":[ array
{
"items":[ array
{
"product_id": string,
"variant_id": string,
"qty": int,
"refund": decimal
},
...
]
}
]
}
],
}
],
"totals":[ array
{
"total": decimal,
"subtotal": decimal,
"shipping": decimal,
"tax": decimal,
"discount": decimal
}
],
"total":[array
{
"subtotal_ex_tax": decimal,
"wrapping_ex_tax": decimal,
"shipping_ex_tax": decimal,
"total_discount": decimal,
"total_tax": decimal,
"total": decimal,
"additional_attributes": [array
{
"shipping_discount_ex_tax": decimal,
"subtotal_discount_ex_tax": decimal,
"subtotal_tax": decimal,
"wrapping_tax": decimal,
"shipping_tax": decimal
}
]
}
],
"order_products":[ array
{
"product":[ array
{
"product_id": string,
"order_product_id": string,
"model": string,
"name": string,
"price": decimal,
"quantity": int,
"total_price": decimal,
"tax_percent": decimal,
"tax_value": decimal,
"variant_id": string
}
]
}
],
"modified_at": string,
"finished_time": string,
"comment": string,
"store_id": string
}
...
]
}
}
2.order.add
This method allows adding orders.
Response structure:
{
"return_code": int,
"return_message": string,
"result":{
"order_id": string
}
}
3. order.update
This method allows updating existing orders that were made by customers.
Response structure:
{
"return_code": int,
"return_message": string,
"result":{
"updated_items": int
}
}
4. order.shipment.list
This method allows retrieving the shipments associated with an order.
Response structure:
{
"return_code": int,
"return_message": string,
"result":{
"shipment_count": int,
"shipment":[ array
{
"id": string,
"order_id": string,
"tracking_numbers":[ array
{
"tracking_number": string,
"carrier_id": string
},
...
],
"created_at": string,
"items":[ array
{
"product":[ array
{
"product_id": string,
"model": string,
"name": string,
"price": decimal,
"quantity": int,
}
]
}
],
}
...
]
}
}
5. order.shipment.update
This method allows updating the shipments associated with an order.
Response structure:
{
"return_code": int,
"return_message": string,
"result":{
"updated_items": int
}
}
The whole list of API methods to work with orders from stores and shipments: Order