Orders Download
The purpose of this page is to specify the methods and requirements on downloading and storing orders from OnBuy to the point they are completed and ready for fulfilment / refund or any manual changes made on the portal to be reflected in Hemisphere
Version | Created / Updated by | Notes |
---|---|---|
1.0 | Danail Deltchev | Initial Version |
Downloading orders on OnBuy is fairly straight forward. We have plenty of options to filter by and we want to use the modified date to be able to capture any changes if they happen on the order to save or update on our platform. Judging by our experience so far we should probably have a proper overlap of at least 15 minutes even if this means reading a lot of orders again
API Call: https://docs.api.onbuy.com/?version=latest#f7b70039-26cd-4c14-8f61-63d7f5b50f8b
Parameters:
Name | Type | Required | Details | |||
---|---|---|---|---|---|---|
site_id | integer | YES | target site. Default is 2000 |
Type:
integer
Example:
2000
| | | |
| filter | array | NO | Key | Type | Required | Details |
| | | | status | string | NO | filter by a specified order status
Type:
string
Example:
partially_dispatched
status can be one of the following values: • awaiting_dispatch - The order is awaiting dispatch • dispatched - The order has been dispatched • complete - Not currently in use • cancelled - The order has been cancelled but the refund has failed or is pending • cancelled_by_seller - The order has been cancelled by the seller • cancelled_by_buyer - The order has been cancelled by the buyer • partially_dispatched - The order has been partially dispatched • partially_refunded - The order has been partially refunded • refunded - The order has been successfully refunded in full • all - All statuses apply | | | | | order_ids | array | NO | filter by specified order id(s) Type:
array
Example:
[]
|
| | | | modified_since | string | NO | filter by date at which an order
Type:
string
Example:
foo
|
| | | | previously_exported | boolean | NO | toggle whether to show orders which was modified
Type:
boolean
Example:
0
|
| sort | array | NO | Key | Type | Required | Details |
| | | | created | string | NO | sort by creation date
Type:
string
Example:
asc
created can be one of the following values: ascsort the results in ascending orderdescsort the results in decending order | | | | | modified | string | NO | sort by modified date have already been requested by this endpoint or not. Type:
string
Example:
asc
modified can be one of the following values: asc - sort the results in ascending order desc - sort the results in descending order |
Current understanding is that we are going to be getting ready orders passed through and they can’t be just cancelled by the buyer at any point. The way we should handle statuses is as follows:
OnBuy Status | Details | WAP Status | WAP Notes |
---|---|---|---|
awaiting_dispatch | The order is awaiting dispatch | Ready for Billing | Initial status indicating this is the first interaction with this order and is still to be processed |
dispatched | The order has been dispatched | Shipped | Meaning the whole order has been shipped |
complete | Not currently in use | Incomplete | In case we receive such an order (with the relevant order_error) |
cancelled | The order has been cancelled but the refund has failed or is pending | If new - Cancelled, if already present - no change | Previous status is to be kept and only MP status updated to have traceability there is still pending action on it |
cancelled_by_seller | The order has been cancelled by the seller | Cancelled | |
cancelled_by_buyer | The order has been cancelled by the buyer | Cancelled | |
partially_dispatched | The order has been partially dispatched | If new - Ready for Billing, if already present - no change | Relevant status is expected to be stored on the order_item (TBC) |
partially_refunded | The order has been partially refunded | If new - Dispatched, if already present - no change | Expectation is that refunds are happening only after a shipment has been done. |
Relevant refund record to be matched or stored | |||
refunded | The order has been successfully refunded in full | Cancelled | Relevant refund record to be matched or stored |
Orders Response:
Example JSON:
{
"results": [
{
"order_id": "T7GXTT",
"onbuy_internal_reference": 1562776,
"date": "2020-10-06 08:46:16",
"updated_at": "2020-10-06 08:46:16",
"cancelled_at": null,
"shipped_at": null,
"status": "Awaiting Dispatch",
"site_id": 2000,
"site_name": "OnBuy UK",
"price_subtotal": "350.00",
"price_delivery": "0.00",
"price_total": "350.00",
"price_discount": "0.00",
"sales_fee_ex_VAT": "31.50",
"sales_fee_inc_VAT": "37.80",
"currency_code": "GBP",
"dispatched": false,
"delivery_service": "Standard",
"delivery_tag": "1-1",
"stripe_transaction_id": null,
"paypal_capture_id": null,
"buyer": {
"name": "Danail Deltchev",
"email": "testorders@onbuy.com",
"phone": "01202 048 630",
"ip_address": "31.13.221.124"
},
"billing_address": {
"name": "Danail Deltchev",
"line_1": "Unit J7",
"line_2": "The Fulcrum",
"line_3": "Vantage Way",
"town": "Poole",
"county": "Dorset",
"postcode": "NN4 9BX",
"country": "United Kingdom",
"country_code": "GB"
},
"delivery_address": {
"name": "Danail Deltchev",
"line_1": "Unit J7",
"line_2": "The Fulcrum",
"line_3": "Vantage Way",
"town": "Poole",
"county": "Dorset",
"postcode": "NN4 9BX",
"country": "United Kingdom",
"country_code": "GB"
},
"fee": {
"boost_marketing_fee_excluding_vat": "0.00",
"category_fee_excluding_vat": "31.50",
"delivery_fee_excluding_vat": "0.00",
"total_fee_excluding_vat": "31.50",
"vat_rate": "20.00",
"total_fee_including_vat": "37.80"
},
"products": [
{
"onbuy_internal_reference": 1523318,
"name": "My Baby car",
"sku": "123123123",
"condition": "New",
"condition_id": 1,
"quantity": 1,
"quantity_dispatched": 0,
"unit_price": "350.00",
"total_price": "350.00",
"expected_dispatch_date": "2020-10-07 22:59:59",
"expected_delivery_date": "2020-10-10 22:59:59 - 2020-10-13 22:59:59",
"opc": "P67PCPZ"
}
]
}
],
"metadata": {
"limit": 20,
"offset": 0,
"total_rows": 1,
"filters": {
"status": "awaiting_dispatch"
}
}
}
Fields and Specifics
Field Name | WAP Mapping | WAP Notes | |
---|---|---|---|
order_id | orders > Marketplace Order ID | ||
onbuy_internal_reference | orders > Selling Manager Record ID | ||
date | orders > Order Created Time | ||
updated_at | N/A | ||
cancelled_at | N/A | ||
shipped_at | orders > Billing Shipped Time | ||
status | orders > marketplace Status | For Mapping to our statuses please refer to the table above | |
site_id | N/A | ||
site_name | N/A | ||
price_subtotal | orders > subtotal | ||
price_delivery | orders > Shipping Service Cost | ||
price_total | orders > total | ||
price_discount | orders > discount | New field that we need to add on order level as well to track as information overall | |
sales_fee_ex_VAT | N/A | ||
sales_fee_inc_VAT | orders > external trans fee or credit | ||
currency_code | orders > currency | ||
dispatched | N/A | Mapping is done via status field | |
delivery_service | orders > Shipping service | ||
delivery_tag | N/A | ||
stripe_transaction_id | order_payment > transaction ID | ||
paypal_capture_id | orders > External Trans ID | ||
buyer | name | orders > Buyer User ID | |
orders > email | |||
phone | orders > Billing phone |
&
orders > billing phone | | | | ip_address | N/A | | | billing_address | name | orders > Billing name | | | | line_1 | orders > BillingStreet1 | | | | line_2 | orders > BillingStreet2 | Concatenate with line_3 | | | line_3 | orders > BillingStreet2 | Concatenate with line_2 | | | town | orders > Billing City | | | | county | orders > Billing State Region | | | | postcode | orders > Billing Postcode | | | | country | orders > Billing Country Name | | | | country | orders > Billing Country Code | | | delivery_address | name | orders > Shipping Buyer name | | | | line_1 | orders > ShippingStreet1 | | | | line_2 | orders > ShippingStreet2 | Concatenate with line_3 | | | line_3 | orders > ShippingStreet2 | Concatenate with line_2 | | | town | orders > Shipping City | | | | county | orders > Shipping State Region | | | | postcode | orders > Shipping Postcode | | | | country | orders > Shipping Country Name | | | | country | orders > Shipping Country Code | | | fee | boost_marketing_fee_excluding_vat | N/A | | | | category_fee_excluding_vat | N/A | | | | delivery_fee_excluding_vat | N/A | | | | total_fee_excluding_vat | N/A | | | | vat_rate | N/A | | | | total_fee_including_vat | N/A | | | products | onbuy_internal_reference | order_item > Order Item Line ID | | | | name | order_item > Item Title | | | | sku | order_item > item sku | | | | condition | N/A | | | | condition_id | N/A | | | | quantity | order_item > item quantity | | | | quantity_dispatched | | | | | unit_price | order_item > item trans price | | | | total_price | N/A | | | | expected_dispatch_date | orders > Expected dispatch date | This is a field that should be created by the Amazon Prime integration In case of multiple items we should store the most recent date, the most urgent one | | | expected_delivery_date | N/A | | | | opc | order_item > ChannelItemId | |
Actions:
- We should be getting orders with modified date since the previous run of the script (with some minutes overlap) and once we successfully complete the work (storing the orders) we should store a record in the order_read table
- If there are no records in the order_read table we should look for orders updated in the last 30 days