Big Commerce Get Orders
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Date | Version | Name | Applied changes |
---|---|---|---|
09.08.2023 | v1.0 | Bogomil Pavlov | First Publish |
09.11.2023 | v1.1 | Bogomil Pavlov | We do not want to store payment rows on pending orders |
16.11.2023 | v1.2 | Bogomil Pavlov | Add additional calculation to get single discounted order item price |
24.11.2023 | v1.3 | Bogomil Pavlov | Mapping and calculation changes |
01.12.2023 | v1.4 | Bogomil Pavlov | Giftwraps handle changes |
19.12.2023 | v1.5 | Bogomil Pavlov | Total Tax calculation changes |
11.01.2023 | v1.6 | Bogomil Pavlov | Payment Method Mapping Changes |
All validations, triggers and standardizations are as per Order management general requirements
Get Orders
When we are getting the orders we are able to specify the min_date_modified
which will allow us to have one cron for new and modified orders.
The first run of the cron should look back with 90 days and if we have a record in last_date_run table we want to overlap with 1 hour.
API Call: GET https://api.bigcommerce.com/stores/{store_hash}/v2/orders
Docs: https://developer.bigcommerce.com/docs/rest-management/orders#get-all-orders
Parameters:
min_date_modified
Minimum date the order was modified in RFC-2822 or ISO-8601.
Supported formats: RFC-2822: Thu, 20 Apr 2017 11:32:00 -0400
or ISO-8601: 2017-04-20T11:32:00.000-04:00
Sample Request: GET https://api.bigcommerce.com/stores/oduzegjfvn/v2/orders?min_date_modified=2023-07-01T11:32:00.000
Sample Response:Status 200 OK
[
{
"id": 100,
"customer_id": 0,
"date_created": "Wed, 30 Aug 2023 21:10:12 +0000",
"date_modified": "Wed, 30 Aug 2023 21:10:26 +0000",
"date_shipped": "",
"status_id": 0,
"status": "Incomplete",
"subtotal_ex_tax": "50.0000",
"subtotal_inc_tax": "50.0000",
"subtotal_tax": "0.0000",
"base_shipping_cost": "0.0000",
"shipping_cost_ex_tax": "0.0000",
"shipping_cost_inc_tax": "0.0000",
"shipping_cost_tax": "0.0000",
"shipping_cost_tax_class_id": 2,
"base_handling_cost": "0.0000",
"handling_cost_ex_tax": "0.0000",
"handling_cost_inc_tax": "0.0000",
"handling_cost_tax": "0.0000",
"handling_cost_tax_class_id": 2,
"base_wrapping_cost": "0.0000",
"wrapping_cost_ex_tax": "0.0000",
"wrapping_cost_inc_tax": "0.0000",
"wrapping_cost_tax": "0.0000",
"wrapping_cost_tax_class_id": 3,
"total_ex_tax": "50.0000",
"total_inc_tax": "50.0000",
"total_tax": "0.0000",
"items_total": 1,
"items_shipped": 0,
"payment_method": "",
"payment_provider_id": null,
"payment_status": "",
"refunded_amount": "0.0000",
"order_is_digital": false,
"store_credit_amount": "0.0000",
"gift_certificate_amount": "0.0000",
"ip_address": "87.120.199.15",
"ip_address_v6": "",
"geoip_country": "Bulgaria",
"geoip_country_iso2": "BG",
"currency_id": 1,
"currency_code": "BGN",
"currency_exchange_rate": "1.0000000000",
"default_currency_id": 1,
"default_currency_code": "BGN",
"staff_notes": "",
"customer_message": "",
"discount_amount": "0.0000",
"coupon_discount": "0.0000",
"shipping_address_count": 1,
"is_deleted": true,
"ebay_order_id": "0",
"cart_id": "d314b691-f277-496e-b26d-e4a4854392fe",
"billing_address": {
"first_name": "Богомил",
"last_name": "Павлов",
"company": "Бебе-Мама 2019 ООД",
"street_1": "Гродно 10, test, test, test, test",
"street_2": "test",
"city": "София",
"state": "",
"zip": "1000",
"country": "Bulgaria",
"country_iso2": "BG",
"phone": "+359896352803",
"email": "bogomilpavlov@yahoo.com",
"form_fields": []
},
"is_email_opt_in": false,
"credit_card_type": null,
"order_source": "www",
"channel_id": 1,
"external_source": "",
"consignments": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/100/consignments",
"resource": "/orders/100/consignments"
},
"products": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/100/products",
"resource": "/orders/100/products"
},
"shipping_addresses": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/100/shipping_addresses",
"resource": "/orders/100/shipping_addresses"
},
"coupons": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/100/coupons",
"resource": "/orders/100/coupons"
},
"external_id": null,
"external_merchant_id": null,
"tax_provider_id": "BasicTaxProvider",
"customer_locale": "en",
"external_order_id": "",
"store_default_currency_code": "BGN",
"store_default_to_transactional_exchange_rate": "1.0000000000",
"custom_status": "Incomplete"
},
{
"id": 101,
"customer_id": 0,
"date_created": "Wed, 30 Aug 2023 21:10:27 +0000",
"date_modified": "Wed, 30 Aug 2023 21:11:13 +0000",
"date_shipped": "",
"status_id": 0,
"status": "Incomplete",
"subtotal_ex_tax": "50.0000",
"subtotal_inc_tax": "50.0000",
"subtotal_tax": "0.0000",
"base_shipping_cost": "0.0000",
"shipping_cost_ex_tax": "0.0000",
"shipping_cost_inc_tax": "0.0000",
"shipping_cost_tax": "0.0000",
"shipping_cost_tax_class_id": 2,
"base_handling_cost": "0.0000",
"handling_cost_ex_tax": "0.0000",
"handling_cost_inc_tax": "0.0000",
"handling_cost_tax": "0.0000",
"handling_cost_tax_class_id": 2,
"base_wrapping_cost": "0.0000",
"wrapping_cost_ex_tax": "0.0000",
"wrapping_cost_inc_tax": "0.0000",
"wrapping_cost_tax": "0.0000",
"wrapping_cost_tax_class_id": 3,
"total_ex_tax": "50.0000",
"total_inc_tax": "50.0000",
"total_tax": "0.0000",
"items_total": 1,
"items_shipped": 0,
"payment_method": "Test Payment Provider",
"payment_provider_id": "",
"payment_status": "declined",
"refunded_amount": "0.0000",
"order_is_digital": false,
"store_credit_amount": "0.0000",
"gift_certificate_amount": "0.0000",
"ip_address": "87.120.199.15",
"ip_address_v6": "",
"geoip_country": "Bulgaria",
"geoip_country_iso2": "BG",
"currency_id": 1,
"currency_code": "BGN",
"currency_exchange_rate": "1.0000000000",
"default_currency_id": 1,
"default_currency_code": "BGN",
"staff_notes": "",
"customer_message": "",
"discount_amount": "0.0000",
"coupon_discount": "0.0000",
"shipping_address_count": 1,
"is_deleted": true,
"ebay_order_id": "0",
"cart_id": "d314b691-f277-496e-b26d-e4a4854392fe",
"billing_address": {
"first_name": "Богомил",
"last_name": "Павлов",
"company": "Бебе-Мама 2019 ООД",
"street_1": "Гродно 10, test, test, test, test",
"street_2": "test",
"city": "София",
"state": "",
"zip": "1000",
"country": "Bulgaria",
"country_iso2": "BG",
"phone": "+359896352803",
"email": "bogomilpavlov@yahoo.com",
"form_fields": []
},
"is_email_opt_in": false,
"credit_card_type": "master",
"order_source": "www",
"channel_id": 1,
"external_source": "",
"consignments": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/101/consignments",
"resource": "/orders/101/consignments"
},
"products": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/101/products",
"resource": "/orders/101/products"
},
"shipping_addresses": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/101/shipping_addresses",
"resource": "/orders/101/shipping_addresses"
},
"coupons": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/101/coupons",
"resource": "/orders/101/coupons"
},
"external_id": null,
"external_merchant_id": null,
"tax_provider_id": "BasicTaxProvider",
"customer_locale": "en",
"external_order_id": "",
"store_default_currency_code": "BGN",
"store_default_to_transactional_exchange_rate": "1.0000000000",
"custom_status": "Incomplete"
},
{
"id": 102,
"customer_id": 0,
"date_created": "Wed, 30 Aug 2023 21:11:13 +0000",
"date_modified": "Wed, 30 Aug 2023 21:11:14 +0000",
"date_shipped": "",
"status_id": 7,
"status": "Awaiting Payment",
"subtotal_ex_tax": "50.0000",
"subtotal_inc_tax": "50.0000",
"subtotal_tax": "0.0000",
"base_shipping_cost": "0.0000",
"shipping_cost_ex_tax": "0.0000",
"shipping_cost_inc_tax": "0.0000",
"shipping_cost_tax": "0.0000",
"shipping_cost_tax_class_id": 2,
"base_handling_cost": "0.0000",
"handling_cost_ex_tax": "0.0000",
"handling_cost_inc_tax": "0.0000",
"handling_cost_tax": "0.0000",
"handling_cost_tax_class_id": 2,
"base_wrapping_cost": "0.0000",
"wrapping_cost_ex_tax": "0.0000",
"wrapping_cost_inc_tax": "0.0000",
"wrapping_cost_tax": "0.0000",
"wrapping_cost_tax_class_id": 3,
"total_ex_tax": "50.0000",
"total_inc_tax": "50.0000",
"total_tax": "0.0000",
"items_total": 1,
"items_shipped": 0,
"payment_method": "Cash on Delivery",
"payment_provider_id": null,
"payment_status": "",
"refunded_amount": "0.0000",
"order_is_digital": false,
"store_credit_amount": "0.0000",
"gift_certificate_amount": "0.0000",
"ip_address": "87.120.199.15",
"ip_address_v6": "",
"geoip_country": "Bulgaria",
"geoip_country_iso2": "BG",
"currency_id": 1,
"currency_code": "BGN",
"currency_exchange_rate": "1.0000000000",
"default_currency_id": 1,
"default_currency_code": "BGN",
"staff_notes": "",
"customer_message": "",
"discount_amount": "0.0000",
"coupon_discount": "0.0000",
"shipping_address_count": 1,
"is_deleted": false,
"ebay_order_id": "0",
"cart_id": "d314b691-f277-496e-b26d-e4a4854392fe",
"billing_address": {
"first_name": "Богомил",
"last_name": "Павлов",
"company": "Бебе-Мама 2019 ООД",
"street_1": "Гродно 10, test, test, test, test",
"street_2": "test",
"city": "София",
"state": "",
"zip": "1000",
"country": "Bulgaria",
"country_iso2": "BG",
"phone": "+359896352803",
"email": "bogomilpavlov@yahoo.com",
"form_fields": []
},
"is_email_opt_in": false,
"credit_card_type": null,
"order_source": "www",
"channel_id": 1,
"external_source": "",
"consignments": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/102/consignments",
"resource": "/orders/102/consignments"
},
"products": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/102/products",
"resource": "/orders/102/products"
},
"shipping_addresses": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/102/shipping_addresses",
"resource": "/orders/102/shipping_addresses"
},
"coupons": {
"url": "https://api.bigcommerce.com/stores/7wvlgjnwb1/v2/orders/102/coupons",
"resource": "/orders/102/coupons"
},
"external_id": null,
"external_merchant_id": null,
"tax_provider_id": "BasicTaxProvider",
"customer_locale": "en",
"external_order_id": "",
"store_default_currency_code": "BGN",
"store_default_to_transactional_exchange_rate": "1.0000000000",
"custom_status": "Awaiting Payment"
}
]
Mapping:
Big Commerce Field | Hemi Field | Comment | ||
---|---|---|---|---|
order |
||||
id |
Orders > Marketplace Order ID | |||
customer_id |
Orders > Buyer User ID | |||
date_created |
Orders > Order Created Time | Store as unix | ||
date_modified |
N/A | |||
date_shipped |
Orders > Shipping Shipped Time | Store as Unix | ||
status_id |
N/A | |||
status |
Orders > Marketplace status | Refer to order status mapping | ||
subtotal_ex_tax |
N/A | |||
subtotal_inc_tax |
N/A | <v1.3>Since the sub total amount we are receiving is not deducting any discount we want to calculate it internally. |
The way we will be calculating the subtotal amount is to sum all discounted_total_inc_tax from the products payload.
SUM(discounted_total_inc_tax) </v1.3> |
| | subtotal_tax
| | N/A | |
| | base_shipping_cost
| | N/A | |
| | shipping_cost_ex_tax
| | N/A | |
| | shipping_cost_inc_tax
| | Orders > Shipping Service Cost | |
| | shipping_cost_tax
| | Orders > Total Shipping Marketplace VAT | |
| | shipping_cost_tax_class_id
| | N/A | |
| | base_handling_cost
| | N/A | |
| | handling_cost_ex_tax
| | N/A | |
| | handling_cost_inc_tax
| | <v1.4>N/A</v1.4> | |
| | handling_cost_tax_class_id
| | N/A | |
| | base_wrapping_cost
| | N/A | |
| | wrapping_cost_ex_tax
| | N/A | |
| | wrapping_cost_inc_tax
| | <v1.4>Orders > Total Gift Wrapping Cost</v1.4> | <v1.4>The new field needs to be under Taxes and Fees tab</v1.4> |
| | wrapping_cost_tax
| | <v1.4>Orders > Total Gift Wrapping Cost VAT</v1.4> | <v1.4>The new field needs to be under Taxes and Fees tab</v1.4> |
| | wrapping_cost_tax_class_id
| | N/A | |
| | total_ex_tax
| | N/A | |
| | total_inc_tax
| | Orders > Оrder Тotal Аmount | |
| | total_tax
| | Orders > Total Marketplace VAT | |
| | items_total
| | N/A | |
| | items_shipped
| | N/A | |
| | payment_method
| | <v1.6>Orders > Order Payment Method</v1.6> | |
| | payment_provider_id
| | <v1.6>Orders > External Trans ID</v1.6> | |
| | payment_status
| | N/A | |
| | refunded_amount
| | N/A | |
| | order_is_digital
| | N/A | |
| | store_credit_amount
| | N/A | |
| | gift_certificate_amount
| | N/A | |
| | ip_address
| | N/A | |
| | ip_address_v6
| | N/A | |
| | geoip_country
| | N/A | |
| | geoip_country_iso2
| | N/A | |
| | currency_id
| | N/A | |
| | currency_code
| | Orders > Order Currency | |
| | currency_exchange_rate
| | N/A | |
| | default_currency_id
| | N/A | |
| | default_currency_code
| | N/A | |
| | staff_notes
| | N/A | |
| | customer_message
| | Orders > Note | |
| | discount_amount
| | Orders > Discount Value | <v1.3>We want to SUM all Product in Order > Discount Amount and add the VAT on top</v1.3>
However for Order > Discount Type we want to have 3 cases
Case #1 - If we have only discount_amount
we want to have Discount Type = “Promotion“
Case #2 - If we have only coupon_discount
we want to have Discount Type = “Coupon“
Case #3 - If we have coupon_discount and discount_amount
we want to have Discount Type = “Mixed“ |
| | coupon_discount
| | Orders > Discount Value | |
| | shipping_address_count
| | N/A | |
| | is_deleted
| | N/A | |
| | ebay_order_id
| | N/A | |
| | cart_id
| | Order Payment > Transaction Id | For the payment type row |
| | billing_address
| | | |
| | | first_name
| Orders > Billing Name | Concatenate with last_name |
| | | last_name
| Orders > Billing Name | Concatenate with first_name |
| | | company
| Orders > Company Name | Under Billing Tab |
| | | street_1
| Orders > Billing Street 1 | |
| | | street_2
| Orders > Billing Street 2 | |
| | | city
| Orders > Billing City Name | |
| | | state
| Orders > Billing State Province | |
| | | zip
| Orders > Billing Postal Code | |
| | | country
| Orders > Billing Country Name | |
| | | country_iso2
| Orders > Billing Country Code | |
| | | phone
| Orders > Billing Phone | |
| | | email
| N/A | |
| | | form_fields
| N/A | |
| | is_email_opt_in
| | N/A | |
| | credit_card_type
| | N/A | |
| | order_source
| | N/A | |
| | channel_id
| | N/A | |
| | external_source
| | N/A | |
| | consignments
| | | |
| | | link
| N/A | |
| | products
| | | |
| | | link
| | The actual link is the request used to get order products |
| | shipping_addresses
| | | |
| | | link
| | The actual link is the request used to get shipping address |
| | coupons
| | | |
| | | link
| | The actual link is the request used to get coupons |
| | external_id
| | Orders > Selling Manager SalesRecordNumber | |
| | external_merchant_id
| | N/A | |
| | tax_provider_id
| | N/A | |
| | customer_locale
| | N/A | |
| | external_order_id
| | N/A | |
| | store_default_currency_code
| | N/A | |
| | store_default_to_transactional_exchange_rate
| | N/A | |
| | custom_status
| | N/A | |
From the response we will have to make 3 additional request using the products, shipping_addresses
and coupons
links.
Get Products
API Call: GET https://api.bigcommerce.com/stores/oduzegjfvn/v2/orders/100/products
Docs: https://developer.bigcommerce.com/docs/rest-management/orders/order-products#list-order-products
Sample Response: Status 200 OK
{
"products": {
"product": [
{
"id": 19,
"order_id": 115,
"product_id": 86,
"variant_id": 66,
"order_pickup_method_id": 0,
"order_address_id": 16,
"name": "[Sample] Able Brewing System",
"name_customer": "[Sample] Able Brewing System",
"name_merchant": "[Sample] Able Brewing System",
"sku": "ABS",
"upc": "",
"type": "physical",
"base_price": 225,
"price_ex_tax": 217.875,
"price_inc_tax": 261.45,
"price_tax": 43.575,
"base_total": 225,
"total_ex_tax": 217.875,
"total_inc_tax": 261.45,
"total_tax": 36.45,
"weight": 1,
"width": 10,
"height": 10,
"depth": 10,
"quantity": 1,
"base_cost_price": 0,
"cost_price_inc_tax": 0,
"cost_price_ex_tax": 0,
"cost_price_tax": 0,
"is_refunded": false,
"quantity_refunded": 0,
"refund_amount": 0,
"return_id": 0,
"wrapping_id": 0,
"wrapping_name": "",
"base_wrapping_cost": 0,
"wrapping_cost_ex_tax": 0,
"wrapping_cost_inc_tax": 0,
"wrapping_cost_tax": 0,
"wrapping_message": "",
"quantity_shipped": 0,
"event_name": "NULL",
"event_date": "",
"fixed_shipping_cost": 0,
"ebay_item_id": "",
"ebay_transaction_id": "",
"option_set_id": "NULL",
"parent_order_product_id": "NULL",
"is_bundled_product": false,
"bin_picking_number": "",
"external_id": "NULL",
"fulfillment_source": "",
"brand": "",
"gift_certificate_id": "NULL",
"applied_discounts": {
"discount": [
{
"id": "coupon",
"amount": 20.25,
"name": "CouponTest",
"code": "CouponTest",
"target": "product"
},
{
"id": 3,
"amount": 22.5,
"name": "Test",
"code": "NULL",
"target": "order"
}
]
},
"product_options": "",
"configurable_fields": "",
"discounted_total_inc_tax":"261.45"
},
{
"id": 20,
"order_id": 115,
"product_id": 103,
"variant_id": 71,
"order_pickup_method_id": 0,
"order_address_id": 16,
"name": "[Sample] Canvas Laundry Cart",
"name_customer": "[Sample] Canvas Laundry Cart",
"name_merchant": "[Sample] Canvas Laundry Cart",
"sku": "CLC",
"upc": "",
"type": "physical",
"base_price": 200,
"price_ex_tax": 193.6667,
"price_inc_tax": 232.4,
"price_tax": 38.7333,
"base_total": 200,
"total_ex_tax": 193.6667,
"total_inc_tax": 232.4,
"total_tax": 32.4,
"weight": 1,
"width": 0,
"height": 0,
"depth": 0,
"quantity": 1,
"base_cost_price": 0,
"cost_price_inc_tax": 0,
"cost_price_ex_tax": 0,
"cost_price_tax": 0,
"is_refunded": false,
"quantity_refunded": 0,
"refund_amount": 0,
"return_id": 0,
"wrapping_id": 0,
"wrapping_name": "",
"base_wrapping_cost": 0,
"wrapping_cost_ex_tax": 0,
"wrapping_cost_inc_tax": 0,
"wrapping_cost_tax": 0,
"wrapping_message": "",
"quantity_shipped": 0,
"event_name": "NULL",
"event_date": "",
"fixed_shipping_cost": 0,
"ebay_item_id": "",
"ebay_transaction_id": "",
"option_set_id": "NULL",
"parent_order_product_id": "NULL",
"is_bundled_product": false,
"bin_picking_number": "",
"external_id": "NULL",
"fulfillment_source": "",
"brand": "OFS",
"gift_certificate_id": "NULL",
"applied_discounts": {
"discount": [
{
"id": "coupon",
"amount": 18,
"name": "CouponTest",
"code": "CouponTest",
"target": "product"
},
{
"id": 3,
"amount": 20,
"name": "Test",
"code": "NULL",
"target": "order"
}
]
},
"product_options": "",
"configurable_fields": "",
"discounted_total_inc_tax":"261.45"
}
]
}
}
Mapping:
Big Commerce Field | Hemi Field | Comment | |||
---|---|---|---|---|---|
product |
|||||
id |
Product In Order > Item Order Line ID | ||||
order_id |
N/A | ||||
product_id |
Product In Order > Channel Item Id | ||||
variant_id |
N/A | ||||
order_pickup_method_id |
N/A | ||||
order_address_id |
Orders > Shipping Address ID | Please note this field is on Order Level however we will get it from the products. | |||
If for some reason we have different order_address_id s we want to get the first one and store and Order Error that there is more than one order_address_id |
|||||
name |
Product In Order > Item Title | ||||
name_customer |
N/A | ||||
name_merchant |
N/A | ||||
sku |
Product In Order > SKU | ||||
upc |
Product In Order > EAN | ||||
type |
N/A | ||||
base_price |
N/A | ||||
price_ex_tax |
N/A | ||||
price_inc_tax |
N/A | Based on Product In Order > Marketplace VAT Item Price and Product In Order > Item Price we want to calculate the percentage and store it in Product In Order > Marketplace VAT Percent | |||
price_tax |
N/A | ||||
base_total |
N/A | ||||
total_ex_tax |
N/A | ||||
total_inc_tax |
N/A | <v1.3>The discount amount is returned from BC without tax thus we want to calculate it based on the: | |||
total_inc_tax - discounted_total_inc_tax</v1.3> | |||||
total_tax |
<v1.5>Product In Order > Marketplace VAT Item Price | The total_tax need to be divided by the quantity in order to get the Tax per single quantity.</v1.5> |
|||
weight |
Product In Order > Weight | We want to convert this in grams when storing in Hemi | |||
width |
Product In Order > Width | ||||
height |
Product In Order > Height | ||||
depth |
Product In Order > Length | ||||
quantity |
Product In Order > Quantity | ||||
base_cost_price |
N/A | ||||
cost_price_inc_tax |
Product In Order > Original Price | ||||
cost_price_ex_tax |
N/A | ||||
cost_price_tax |
N/A | ||||
is_refunded |
N/A | ||||
quantity_refunded |
N/A | ||||
refund_amount |
N/A | ||||
return_id |
Orders > Return Id | Please note this field is on Order Level however we will get it from the products. | |||
If for some reason we have different return_id s we want to get the first one and store and Order Error that there is more than one return_id |
|||||
wrapping_id |
N/A | ||||
wrapping_name |
N/A | ||||
base_wrapping_cost |
N/A | ||||
wrapping_cost_ex_tax |
N/A | ||||
wrapping_cost_inc_tax |
<v1.4>Product In Order > Gift Wrapping Cost</v1.4> | Please note this will be the total Gift WrapCost for all of the quantities so we would like always to divide it based on the quantity. | |||
wrapping_cost_inc_tax / quantity <v1.4>The new field needs to be under Taxes and Fees tab</v1.4> |
|||||
wrapping_cost_tax |
<v1.4>Product In Order > Gift Wrapping Cost VAT</v1.4> | Please note this will be the total Gift WrapCost for all of the quantities so we would like always to divide it based on the quantity. | |||
wrapping_cost_tax / quantity <v1.4>The new field needs to be under Taxes and Fees tab</v1.4> |
|||||
wrapping_message |
N/A | ||||
quantity_shipped |
Based on this we will know how many items are shipped. |
We want to track and update the order item statuses based on the quantity_shipped
and quantity_refunded
|
| | event_name
| | | N/A | |
| | event_date
| | | N/A | |
| | fixed_shipping_cost
| | | N/A | |
| | ebay_item_id
| | | N/A | |
| | ebay_transaction_id
| | | N/A | |
| | option_set_id
| | | N/A | |
| | parent_order_product_id
| | | N/A | |
| | is_bundled_product
| | | N/A | |
| | bin_picking_number
| | | N/A | |
| | external_id
| | | N/A | |
| | fulfillment_source
| | | N/A | |
| | brand
| | | N/A | |
| | gift_certificate_id
| | | N/A | |
| | applied_discounts
| | | | |
| | | discount
| | | |
| | | | id
| | |
| | | | amount
| Product In Order > Discount Amount | <v1.3>The discount amount is returned from BC without tax thus we want to calculate it based on the:
total_inc_tax - discounted_total_inc_tax</v1.3> |
| | | | name
| | |
| | | | code
| | |
| | | | target
| | |
| | product_options
| | | N/A | |
| | configurable_fields
| | | N/A | |
| | discounted_total_inc_tax
| | | Product in Order > Item Price | <v1.3>This is the total item price without the discount and with tax which we want to divide by the quantity, in order to get the single item discount price with tax.
discounted_total_inc_tax
/quantity
</1.3> |
Get Shipping Address
API Call: GET https://api.bigcommerce.com/stores/oduzegjfvn/v2/orders/100/shipping_addresses
Sample Response: Status 200 OK
{
"addresses": {
"address": {
"id": 1,
"order_id": 100,
"first_name": "Bogomil",
"last_name": "Pavlov",
"company": "Bebe-Mama 2019",
"street_1": "Goriubliane",
"street_2": "Grodno 10",
"city": "Sofia",
"zip": 1000,
"country": "Bulgaria",
"country_iso2": "BG",
"state": "Sofia",
"email": "bogomil@hemi.ai",
"phone": 896352803,
"items_total": 1,
"items_shipped": 0,
"shipping_method": "Free Shipping",
"base_cost": 0,
"cost_ex_tax": 0,
"cost_inc_tax": 0,
"cost_tax": 0,
"cost_tax_class_id": 2,
"base_handling_cost": 0,
"handling_cost_ex_tax": 0,
"handling_cost_inc_tax": 0,
"handling_cost_tax": 0,
"handling_cost_tax_class_id": 2,
"shipping_zone_id": 1,
"shipping_zone_name": "Bulgaria",
"shipping_quotes": {
"link": "/orders/100/shipping_addresses/1/shipping_quotes"
},
"form_fields": ""
}
}
}
Mapping:
Big Commerce Field | Hemi Field | Comment | ||
---|---|---|---|---|
address |
||||
id |
N/A | |||
order_id |
N/A | |||
first_name |
Orders > Shipping Buyer Name | Concatenate with Last Name | ||
last_name |
Orders > Shipping Buyer Name | Concatenate with First Name | ||
company |
Orders > Company Name | |||
street_1 |
Orders > Shipping Street 1 | |||
street_2 |
Orders > Shipping Street 2 | |||
city |
Orders > Shipping City | |||
zip |
Orders > Post Code | |||
country |
Orders > Shipping Country Name | |||
country_iso2 |
Orders > Shipping Country Code | |||
state |
Orders > Shipping State Province | |||
email |
Orders > Buyer mail | |||
phone |
Orders > Shipping Phone | |||
items_total |
N/A | |||
items_shipped |
N/A | |||
shipping_method |
Orders > Shipping Service | |||
base_cost |
N/A | |||
cost_ex_tax |
N/A | |||
cost_inc_tax |
N/A | |||
cost_tax |
N/A | |||
cost_tax_class_id |
N/A | |||
base_handling_cost |
N/A | |||
handling_cost_ex_tax |
N/A | |||
handling_cost_inc_tax |
N/A | |||
handling_cost_tax |
N/A | |||
handling_cost_tax_class_id |
N/A | |||
shipping_zone_id |
N/A | |||
shipping_zone_name |
N/A | |||
shipping_quotes |
||||
link |
N/A | |||
form_fields |
N/A |
Get Coupons
Please note we can have at most one coupon per order other wise we receive empty response.
API Call: GET https://api.bigcommerce.com/stores/oduzegjfvn/v2/orders/100/coupons
Docs: https://developer.bigcommerce.com/docs/rest-management/orders/order-coupons#list-order-couponsSample Response:Status 200 OK
{
"coupons": {
"coupon": {
"id": 1,
"coupon_id": 2,
"order_id": 108,
"code": "test2",
"amount": 0,
"type": 5,
"discount": 0
}
}
}
If there are any coupons applied we will receive status 200 with the body
Status 204 OK
If there are no coupons applied we will receive status 204 with empty body which means the request is sucessfull but there is no coupon applied
Mapping:
Big Commerce Field | Hemi Field | Comment | ||
---|---|---|---|---|
coupon |
||||
id |
N/A | |||
coupon_id |
N/A | |||
order_id |
N/A | |||
code |
Orders > Discount Code | |||
amount |
N/A | |||
type |
N/A | |||
discount |
N/A |
Order Status Mapping:
Big Commerce Status ID | Big Commerce Status Name | Description | Hemi Status |
---|---|---|---|
0 | Incomplete | An incomplete order happens when a shopper reached the payment page, but did not complete the transaction. | N/A |
We do not want to store such orders in Hemi | |||
1 | Pending | Customer started the checkout process, but did not complete it. | Pending |
<v1.1>We do not want to store payment rows on pending orders.</v1.1> | |||
2 | Shipped | Order has been shipped, but receipt has not been confirmed; seller has used the Ship Items action. | Shipped |
3 | Partially Shipped | Only some items in the order have been shipped, due to some products being pre-order only or other reasons. | Partially Shipped |
4 | Refunded | Seller has used the Refund action. | Cancelled |
5 | Cancelled | Seller has cancelled an order, due to a stock inconsistency or other reasons. | Cancelled |
6 | Declined | Seller has marked the order as declined for lack of manual payment, or other reasons. | Cancelled |
7 | Awaiting Payment | Customer has completed checkout process, but payment has yet to be confirmed. | Pending |
<v1.1>We do not want to store payment rows on pending orders.</v1.1> | |||
8 | Awaiting Pickup | Order has been pulled, and is awaiting customer pickup from a seller-specified location. | Ready For Shipping |
9 | Awaiting Shipment | Order has been pulled and packaged, and is awaiting collection from a shipping provider. | Ready For Shipping |
10 | Completed | Client has paid for their digital product and their file(s) are available for download. | Shipped |
11 | Awaiting Fulfillment | Customer has completed the checkout process and payment has been confirmed. | Ready For Shipping |
12 | Manual Verification Required | Order is on hold while some aspect needs to be manually confirmed. | Pending |
<v1.1>We do not want to store payment rows on pending orders.</v1.1> | |||
13 | Disputed | Customer has initiated a dispute resolution process for the PayPal transaction that paid for the order. | We do not want to update our Order > Status just the Order > Marketplace Status if the order exist in Hemi |
However if we receive this status for an order which do not exist in Hemi we have to check if we have products with quantity_shipped
field populated and we have to track if the whole order is shipped - Order > Status as Shipped or partially shipped - Order > Status as Partially Shipped else we treat it as Ready For Shipping.
Also if we have an order which exist in Hemi but it is with Order > Status = Pending we have to apply the same logic and check the quantity_shipped
field |
| 14 | Partially Refunded | Seller has partially refunded the order. | We do not want to update our Order > Status just the Order > Marketplace Status if the order exist in Hemi
However if we receive this status for an order which do not exist in Hemi we have to check if we have products with quantity_shipped
field populated and we have to track if the whole order is shipped - Order > Status as Shipped or partially shipped - Order > Status as Partially Shipped else we treat it as Ready For Shipping.
Also if we have an order which exist in Hemi but it is with Order > Status = Pending we have to apply the same logic and check the quantity_shipped
field |