Orders
This page provides comprehensive information and documentation on a set of API methods specifically designed to handle orders, ordem items, cancellation plans, and customer address.
Orders
An Order represents a purchase order made by a customer. It contains the details of the products that the customer has purchased. The Order can be read by the seller. Other actions such as updating and deleting the Order are not allowed.
Schema
{
"id": "uuid",
"number": "string",
"shipping_address": "uuid (Ref: Customer Address)",
"billing_address": "uuid (Ref: Customer Address)",
"date_placed": "datetime",
"status": "enum(Approve Waiting > 100, Approved > 200, Package Waiting > 300, Packaged > 400, Shipped > 500, Delivered > 600, Cancellation Waiting > 700, Cancelled > 800, Rejected > 900)",
"currency": "enum(TRY, USD, EUR, EGP, GBP, MAD, PLN, SAR, RON, UAH, CZK, HUF, RUB, BGN, IQD, KWD, BHD, OMR, QAR, AED, NGN)",
"amount": "decimal",
"discount_amount": "decimal",
"shipping_amount": "decimal",
"shipping_tax_rate": "decimal",
"refund_amount": "decimal",
"discount_refund_amount": "decimal",
"shipping_refund_amount": "decimal",
"invoice_number": "string",
"invoice_date": "datetime",
"e_archive_url": "string",
"tracking_number": "string",
"shipping_company": "string",
"cargo_company": "string",
"has_gift_box": "boolean",
"gift_box_note": "string",
"language_code": "string",
"notes": "string",
"delivery_range": "datetime",
"shipping_option_slug": "string",
"extra_field": "object",
"cancel_status": "enum(Waiting, confirmation Waiting, Confirmed, Approved, Rejected, Waiting for Payment, Manuel Refund Need, Completed)",
"shipping_interest_amount": "decimal"
}
Retrieve ORI01
curl -X GET "https://example.com/api/i1/orders/" \
-H "Content-Type: application/json" \
-H "Authentication: Bearer {TOKEN}"
Example Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "e819386c-b406-43dc-86c9-212ff633afe2",
"number": "45243493",
"datasource": "7371e321-9ae4-418d-8472-f4d13ce3da8d",
"shipping_address": "a4c0eb06-9ad5-40a1-adc2-d4ea4a9aed32",
"billing_address": "a4c0eb06-9ad5-40a1-adc2-d4ea4a9aed32",
"date_placed": "2019-01-01T00:00:00Z",
"status": 100,
"currency": "usd",
"amount": "629.00",
"discount_amount": "0.00",
"shipping_amount": "0.00",
"shipping_tax_rate": null,
"refund_amount": "0.00",
"discount_refund_amount": "0.00",
"shipping_refund_amount": "0.00",
"invoice_number": null,
"invoice_date": null,
"e_archive_url": null,
"tracking_number": null,
"shipping_company": null,
"cargo_company": null,
"has_gift_box": false,
"gift_box_note": null,
"language_code": null,
"notes": null,
"delivery_range": null,
"shipping_option_slug": null,
"extra_field": {},
"cancel_status": null,
"shipping_interest_amount": "0.00"
}
]
}
Available Query Parameters
Key | Type |
---|---|
number | string |
status | integer |
number__contains | string |
number__icontains | string (case-insensitive) |
date_placed__gte | datetime |
date_placed__gt | datetime |
date_placed__lte | datetime |
date_placed__lt | datetime |
amount__lt | decimal |
amount__gt | decimal |
amount__lte | decimal |
amount__gte | decimal |
discount_amount__lt | decimal |
discount_amount__gt | decimal |
discount_amount__lte | decimal |
discount_amount__gte | decimal |
currency | string |
has_gift_box | boolean |
created_at__gte | datetime |
created_at__gt | datetime |
created_at__lte | datetime |
created_at__lt | datetime |
updated_at__gte | datetime |
updated_at__gt | datetime |
updated_at__lte | datetime |
updated_at__lt | datetime |
Possible HTTP Status Codes
- 200 OK: Orders retrieved successfully.
- 401 Unauthorized: Invalid authentication header (missing, invalid value, etc.).
- 415 Unsupported Media Type: Invalid content-type header (missing, invalid format, etc.).
- 500 Internal Server Error: Unexpected server error.
Order Items
An Order Item is a line item on an order. It represents a single item, such as a product, that is part of the order. The Order Items can be read and reject by the seller. Other actions such as update and delete are not allowed.
Schema
{
"id": "uuid",
"order": "uuid (Ref: Order ID)",
"sku": "string (Ref: Product Offer SKU)",
"status": "enum(Approve Waiting > 100, Approved > 200, Package Waiting > 300, Packaged > 400, Shipped > 500, Delivered > 600, Cancellation Waiting > 700, Cancelled > 800, Rejected > 900)",
"price_currency": "enum(TRY, USD, EUR, EGP, GBP, MAD, PLN, SAR, RON, UAH, CZK, HUF, RUB, BGN, IQD, KWD, BHD, OMR, QAR, AED, NGN)",
"price": "decimal",
"tax_rate": "decimal",
"invoice_number": "string",
"invoice_date": "datetime",
"e_archive_url": "string",
"tracking_number": "string",
"shipping_company": "string",
"retail_price": "decimal",
"extra_field": "object",
"estimated_delivery_date": "datetime",
"discount_amount": "decimal",
"shipped_date": "datetime",
"delivered_date": "datetime",
"cancel_status": "enum(Waiting, confirmation Waiting, Confirmed, Approved, Rejected, Waiting for Payment, Manuel Refund Need, Completed)"
}
Retrieve ORI02
curl -X GET "https://example.com/api/i1/order-items/" \
-H "Content-Type: application/json" \
-H "Authentication: Bearer {TOKEN}"
Example Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "33a11761-43bc-41d4-8f7f-1e860028367b",
"order": "e819386c-b406-43dc-86c9-212ff633afe2",
"sku": "SP-A",
"status": 600,
"price_currency": "usd",
"price": "629.00",
"tax_rate": "0.00",
"invoice_number": null,
"invoice_date": null,
"e_archive_url": null,
"tracking_number": "5c0095dab3c087befe04c0d5a0155d3e",
"shipping_company": "hbexpress",
"retail_price": null,
"extra_field": {},
"estimated_delivery_date": null,
"discount_amount": "0.00",
"shipped_date": "2019-01-01T00:00:00Z",
"delivered_date": "2019-01-01T00:00:00Z",
"cancel_status": null
}
]
}
Available Query Parameters
Key | Type |
---|---|
order__number | string |
order__status | integer |
ordernumbercontains | string |
ordernumbericontains | string (case-insensitive) |
status | integer |
orderdate_placedgte | datetime |
orderdate_placedgt | datetime |
orderdate_placedlte | datetime |
orderdate_placedlt | datetime |
price__lt | decimal |
price__gt | decimal |
price__lte | decimal |
price__gte | decimal |
retail_price__lt | decimal |
retail_price__gt | decimal |
retail_price__lte | decimal |
retail_price__gte | decimal |
discount_amount__lt | decimal |
discount_amount__gt | decimal |
discount_amount__lte | decimal |
discount_amount__gte | decimal |
price_currency | string |
created_at__gte | datetime |
created_at__gt | datetime |
created_at__lte | datetime |
created_at__lt | datetime |
updated_at__gte | datetime |
updated_at__gt | datetime |
updated_at__lte | datetime |
updated_at__lt | datetime |
Possible HTTP Status Codes
- 200 OK: Order Items retrieved successfully.
- 401 Unauthorized: Invalid authentication header (missing, invalid value, etc.).
- 415 Unsupported Media Type: Invalid content-type header (missing, invalid format, etc.).
- 500 Internal Server Error: Unexpected server error.
Reject ORI03
Sellers may reject an order item if they are unable to fulfill it. This will cancel the order item and notify the customer. Please note that packaged orders cannot be rejected. The Packages can be read, by the seller. Other actions such as update and delete are not allowed.
The Order Items can be read and reject by the seller. Other actions such as update and delete are not allowed.
curl -X POST 'https://example.com/api/i1/order-items/{orderitem_id}/reject/' \
-H 'Authorization: Bearer {TOKEN}' \
-H 'Content-Type: application/json'
Possible HTTP Status Codes
- 204 No Content: Order Item rejected successfully.
- 400 Bad Request: Invalid request body (missing required fields, invalid format, etc.).
- 406 Not Acceptable: Invalid request headers (invalid format, etc.).
- 401 Unauthorized: Invalid authentication header (missing, invalid value, etc.).
- 415 Unsupported Media Type: Invalid content-type header (missing, invalid format, etc.).
- 500 Internal Server Error: Unexpected server error.
Cancellation Plans
Schema
{
"id": "uuid",
"order": "uuid (Ref: Order ID)",
"order_items": "list(uuid) (Ref: Order Item ID)",
"shipping_refund_amount": "decimal",
"refund_amount": "decimal",
"discount_refund_amount": "decimal",
"status": "enum(completed, waiting, waiting_supplier, approved, confirmation_waiting, confirmed, cancelled, failed, rejected, waiting_for_payment, manuel_refund_need)",
"plan_type": "enum(refund, cancel)",
"invoice_number": "string",
"payment_plan": "json"
}
Retrieve CPI01
curl -X GET "https://example.com/api/i1/cancellation-plans/" \
-H "Content-Type: application/json" \
-H "Authentication: Bearer {TOKEN}"
Example Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "f0cf73ee-8e1e-4025-a03d-8499af3ee493",
"shipping_refund_amount": "1.00",
"refund_amount": "1.00",
"discount_refund_amount": "1.00",
"status": "waiting",
"plan_type": "cancel",
"invoice_number": "1234",
"payment_plan": {},
"order": "6e5877a9-5a03-48e6-8425-d4be178de83e",
"order_items": [
"f35de315-61b5-4b13-b101-82c3f873bd1f",
"5481430a-fb72-4d07-bb1d-81dcb9461c5d"
]
}
]
}
Available Query Parameters
Key | Type |
---|---|
created_at__date | date |
order__number | string |
order | uuid |
order_items | uuid |
shipping_refund_amount | decimal |
refund_amount | decimal |
discount_refund_amount | decimal |
status | enum |
plan_type | enum |
invoice_number | string |
payment_plan | json |
Possible HTTP Status Codes
- 200 OK: Cancellation plans retrieved successfully.
- 401 Unauthorized: Invalid authentication header (missing, invalid value, etc.).
- 415 Unsupported Media Type: Invalid content-type header (missing, invalid format, etc.).
- 500 Internal Server Error: Unexpected server error.
Customer Address
Schema
{
"id": "uuid",
"email": "string",
"phone_number": "string",
"first_name": "string",
"last_name": "string",
"line": "string",
"is_active": "boolean",
"postcode": "string",
"notes": "string",
"company_name": "string",
"tax_office": "string",
"tax_no": "string",
"e_bill_taxpayer": "boolean",
"identity_number": "string",
"country": "uuid",
"city": "uuid",
"township": "uuid",
"district": "uuid"
}
Retrieve OCA01
curl -X GET "https://example.com/api/i1/customer-addresses/" \
-H "Content-Type: application/json" \
-H "Authentication: Bearer {TOKEN}"
Example Response:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "4c785dc6-0c69-4f84-aaa8-a34a932db75c",
"email": "akinon@akinon.com",
"phone_number": "05555555555",
"first_name": "Akinon",
"last_name": "Akinon",
"line": "Address Text",
"is_active": true,
"postcode": "34000",
"notes": "note...",
"company_name": null,
"tax_office": null,
"tax_no": null,
"e_bill_taxpayer": false,
"identity_number": "11111111111",
"country": "b08eb673-dcd4-483c-a8b9-59ed76b64a1b",
"city": "2e1adb7c-e1e8-471a-a483-0257d52fb0bc",
"township": "13a22409-e32b-4109-99bc-598ddc62c477",
"district": "35feab7e-4832-4d31-8448-2cbcd89092ea"
}
]
}
Available Query Parameters
Key | Type |
---|---|
id | uuid |
string | |
phone_number | string |
first_name | string |
last_name | string |
line | string |
is_active | boolean |
postcode | string |
notes | string |
company_name | string |
tax_office | string |
tax_no | string |
e_bill_taxpayer | boolean |
country | uuid |
city | uuid |
township | uuid |
district | uuid |
identity_number | string |
Possible HTTP Status Codes
- 200 OK: Customer addresses retrieved successfully.
- 401 Unauthorized: Invalid authentication header (missing, invalid value, etc.).
- 415 Unsupported Media Type: Invalid content-type header (missing, invalid format, etc.).
- 500 Internal Server Error: Unexpected server error.