Marketplaces / WooCommerce Technical Sccope / WooCommerce Order Management / WooCommerce Get Orders

WooCommerce Get Orders

Version Date Created / Updated Notes
v1.0 14/05/2025 Hristiyan Georgiev Initial version

The purpose of this page is to define general requirements for Order management, flow and download setup and mapping from WooCommerce into MCPro.

All validations, triggers and standardizations which are not mentioned here are as per Order management general requirements

API Call : GET /wp-json/wc/v2/orders

API Docs : https://woocommerce.github.io/woocommerce-rest-api-docs/wp-api-v2.html?php#list-all-orders

We are to use a parameter called after which basically acts as order created date. We also need to use a parameter called dates_are_gmt and send it as “true”. This way, we will make sure we are using the correct times when calling for orders based on our system time. The format of the date should be ISO8601 compliant (in a 2017-03-22T19:28:02 format) . There is also the possibility for pagination with the page , per_page and offset filters so we need to be able to handle pagination as well. Default orders per page is 10, we can raise it if devs decide.

The first run will check for new orders in the last 90 days and afterwards we will get the date from last_date_run table and filter orders using the after parameter. We want to overlap the time with 1 hour, meaning that we should use the time of last_date_run - 1 hour.

Example response (please note that the response is for an order that has been shipped and refunded so we can see an example and mapping of all possible cases) :

[
    {
        "id": 110,
        "parent_id": 0,
        "status": "processing",
        "currency": "USD",
        "version": "9.8.5",
        "prices_include_tax": false,
        "date_created": "2025-05-15T11:04:01",
        "date_modified": "2025-05-15T11:08:45",
        "discount_total": "0.00",
        "discount_tax": "0.00",
        "shipping_total": "0.00",
        "shipping_tax": "0.00",
        "cart_tax": "0.00",
        "total": "100.00",
        "total_tax": "0.00",
        "customer_id": 1,
        "order_key": "wc_order_Yo8UWYKLVv7T2",
        "billing": {
            "first_name": "Hristiyan ",
            "last_name": "Georgiev",
            "company": "",
            "address_1": "Yordan Yosifov 22",
            "address_2": "",
            "city": "Sofia",
            "state": "BG-23",
            "postcode": "1700",
            "country": "BG",
            "email": "hgeorgiev@threecolts.com",
            "phone": ""
        },
        "shipping": {
            "first_name": "Hristiyan ",
            "last_name": "Georgiev",
            "company": "",
            "address_1": "Yordan Yosifov 22",
            "address_2": "",
            "city": "Sofia",
            "state": "BG-23",
            "postcode": "1700",
            "country": "BG",
            "phone": ""
        },
        "payment_method": "woocommerce_payments",
        "payment_method_title": "Visa credit card",
        "transaction_id": "pi_3ROzbRCIFQxYOgRk1VQpN6XN",
        "customer_ip_address": "78.90.34.44",
        "customer_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",
        "created_via": "store-api",
        "customer_note": "This is great product BRO!",
        "date_completed": null,
        "date_paid": "2025-05-15T11:08:45",
        "cart_hash": "90acc9324d0418ac47d58aae17b848db",
        "number": "110",
        "meta_data": [
            {
                "id": 114,
                "key": "_shipping_hash",
                "value": "9d4568c009d203ab10e33ea9953a0264"
            },
            {
                "id": 115,
                "key": "_coupons_hash",
                "value": "d751713988987e9331980363e24189ce"
            },
            {
                "id": 116,
                "key": "_fees_hash",
                "value": "d751713988987e9331980363e24189ce"
            },
            {
                "id": 117,
                "key": "_taxes_hash",
                "value": "d751713988987e9331980363e24189ce"
            },
            {
                "id": 118,
                "key": "is_vat_exempt",
                "value": "no"
            },
            {
                "id": 130,
                "key": "_wc_order_attribution_source_type",
                "value": "typein"
            },
            {
                "id": 131,
                "key": "_wc_order_attribution_referrer",
                "value": "https://judicious-hedgehog-609998.instawp.xyz/wp-admin/admin.php?page=wc-admin&path=/customize-store"
            },
            {
                "id": 132,
                "key": "_wc_order_attribution_utm_source",
                "value": "(direct)"
            },
            {
                "id": 133,
                "key": "_wc_order_attribution_session_entry",
                "value": "https://judicious-hedgehog-609998.instawp.xyz/?cys-hide-admin-bar=1"
            },
            {
                "id": 134,
                "key": "_wc_order_attribution_session_start_time",
                "value": "2025-05-15 10:56:14"
            },
            {
                "id": 135,
                "key": "_wc_order_attribution_session_pages",
                "value": "5"
            },
            {
                "id": 136,
                "key": "_wc_order_attribution_session_count",
                "value": "1"
            },
            {
                "id": 137,
                "key": "_wc_order_attribution_user_agent",
                "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"
            },
            {
                "id": 138,
                "key": "_wc_order_attribution_device_type",
                "value": "Desktop"
            },
            {
                "id": 140,
                "key": "_payment_method_id",
                "value": "pm_1ROzbRCIFQxYOgRkiXQpSBcc"
            },
            {
                "id": 141,
                "key": "_stripe_customer_id",
                "value": "cus_SJcrATqi5x0yIO"
            },
            {
                "id": 142,
                "key": "_wcpay_mode",
                "value": "test"
            },
            {
                "id": 143,
                "key": "_intent_id",
                "value": "pi_3ROzbRCIFQxYOgRk1VQpN6XN"
            },
            {
                "id": 144,
                "key": "_charge_id",
                "value": "ch_3ROzbRCIFQxYOgRk1iJHBpo4"
            },
            {
                "id": 145,
                "key": "_intention_status",
                "value": "succeeded"
            },
            {
                "id": 146,
                "key": "_wcpay_intent_currency",
                "value": "usd"
            },
            {
                "id": 147,
                "key": "_wcpay_payment_transaction_id",
                "value": ""
            },
            {
                "id": 148,
                "key": "_charge_risk_level",
                "value": "normal"
            },
            {
                "id": 150,
                "key": "_wcpay_fraud_outcome_status",
                "value": "allow"
            },
            {
                "id": 151,
                "key": "_wcpay_fraud_meta_box_type",
                "value": "allow"
            },
            {
                "id": 152,
                "key": "_wcpay_transaction_fee",
                "value": "3.2"
            },
            {
                "id": 153,
                "key": "last4",
                "value": "4242"
            },
            {
                "id": 154,
                "key": "_card_brand",
                "value": "visa"
            },
            {
                "id": 155,
                "key": "_new_order_tracking_complete",
                "value": "yes"
            },
            {
                "id": 157,
                "key": "_wcpay_fraud_outcome_manual_entry",
                "value": {
                    "type": "fraud_outcome_manual_approve",
                    "user": {
                        "id": 1,
                        "username": "razafesiko6976"
                    },
                    "action": "approved",
                    "datetime": 1747307323
                }
            },
            {
                "id": 160,
                "key": "_wcpay_net",
                "value": "96.8"
            }
        ],
        "line_items": [
            {
                "id": 33,
                "name": "Hoodie",
                "product_id": 15,
                "variation_id": 0,
                "quantity": 1,
                "tax_class": "",
                "subtotal": "100.00",
                "subtotal_tax": "0.00",
                "total": "100.00",
                "total_tax": "0.00",
                "taxes": [],
                "meta_data": [],
                "sku": "TESTSKU123",
                "price": 100,
                "image": {
                    "id": "64",
                    "src": "https://judicious-hedgehog-609998.instawp.xyz/wp-content/uploads/2025/05/1715726245686.jpg"
                },
                "parent_name": null
            }
        ],
        "tax_lines": [],
        "shipping_lines": [],
        "fee_lines": [],
        "coupon_lines": [],
        "refunds": [],
        "payment_url": "https://judicious-hedgehog-609998.instawp.xyz/checkout/order-pay/110/?pay_for_order=true&key=wc_order_Yo8UWYKLVv7T2",
        "is_editable": false,
        "needs_payment": false,
        "needs_processing": true,
        "date_created_gmt": "2025-05-15T11:04:01",
        "date_modified_gmt": "2025-05-15T11:08:45",
        "date_completed_gmt": null,
        "date_paid_gmt": "2025-05-15T11:08:45",
        "currency_symbol": "$",
        "_links": {
            "self": [
                {
                    "href": "https://judicious-hedgehog-609998.instawp.xyz/wp-json/wc/v2/orders/110",
                    "targetHints": {
                        "allow": [
                            "GET",
                            "POST",
                            "PUT",
                            "PATCH",
                            "DELETE"
                        ]
                    }
                }
            ],
            "collection": [
                {
                    "href": "https://judicious-hedgehog-609998.instawp.xyz/wp-json/wc/v2/orders"
                }
            ],
            "email_templates": [
                {
                    "embeddable": true,
                    "href": "https://judicious-hedgehog-609998.instawp.xyz/wp-json/wc/v2/orders/110/actions/email_templates"
                }
            ],
            "customer": [
                {
                    "href": "https://judicious-hedgehog-609998.instawp.xyz/wp-json/wc/v2/customers/1"
                }
            ]
        }
    }
]

Response Mapping :

WooCommerce Field Mc Pro Field Notes
id Orders > Marketplace Order ID
parent_id Orders > Selling Manager SalesRecordNumber
status Orders > Marketplace Status

AND Orders > Order Status | Mapping for Order Statusprovided below in a table | | currency | | | | Orders > Order Currency | If for some reason the currency is missing in the payload, we want to pick it from Channel > Exchange Rate Calculator Currency | | version | | | | N/A | | | prices_include_tax | | | | N/A | | | date_created | | | | Orders > Order Initially Created Date | It is in a format of 2025-05-15T11:04:01 We need to convert it into unix format. | | date_modified | | | | Orders > Order Modified Time | | | discount_total | | | | Orders > Discount Value | | | discount_tax | | | | N/A | | | shipping_total | | | | Orders > Shipping Service Cost | | | shipping_tax | | | | Orders > Total Shipping Sales Tax OR Orders > Total Shipping Marketplace VAT | This would depend on Channel > Country IF we have Channel > Country = United States we use the Total Shipping Sales Tax field, IF we have Channel > Country != United States we use Total Shipping Marketplace VAT | | cart_tax | | | | N/A | | | total | | | | Orders > Order Total Amount | | | total_tax | | | | Orders > Total Sales Tax OR Orders > Total Marketplace VAT | This would depend on Channel > Country IF we have Channel > Country = United States we use the Total Sales Tax IF we have Channel > Country != United States we use Total Marketplace VA | | customer_id | | | | Orders > Buyer User ID | | | order_key | | | | N/A | | | billing | | | | | | | | first_name | | | Orders > Billing Name | We need to concatinate first_name and last_name and store together | | | last_name | | | Orders > Billing Name | We need to concatinate first_name and last_name and store together | | | company | | | Orders > Company Name | | | | address_1 | | | Orders > Billing Street 1 | | | | address_2 | | | Orders > Billing Street 2 | | | | city | | | Orders > Billing City Name | | | | state | | | Orders > Billing State Province | | | | postcode | | | Orders > Billing Postal Code | | | | country | | | Orders > Billing Country Name | | | | email | | | N/A | | | | phone | | | Orders > Billing Phone | | | shipping | | | | | | | | first_name | | | Orders > Shipping Buyer Name | We need to concatinate first_name and last_name and store together | | | last_name | | | Orders > Shipping Buyer Name | We need to concatinate first_name and last_name and store together | | | company | | | Orders > Company Name | | | | address_1 | | | Orders > Shipping Street 1 | | | | address_2 | | | Orders > Shipping Street 2 | | | | city | | | Orders > Shipping City | | | | state | | | Orders > Shipping State Province | | | | postcode | | | Orders > Shipping Postal Code | | | | country | | | Orders > Shipping Country Name | | | | phone | | | Orders > Shipping Phone | | | payment_method | | | | N/A | | | payment_method_title | | | | N/A | | | transaction_id | | | | Order Payment Details > Transaction ID | We want to create a logic and if transaction_id is empty, we want to use the order id as Transaction ID in MC Pro. This could happen if we have payment method of Direct Bank Transfer for example. | | customer_ip_address | | | | N/A | | | customer_user_agent | | | | N/A | | | created_via | | | | N/A | | | customer_note | | | | N/A | | | date_completed | | | | N/A | | | date_paid | | | | Order Payment Details > Payment Date | | | cart_hash | | | | N/A | | | number | | | | N/A | | | meta_data | | | | N/A | | | | id | | | N/A | | | | key | | | N/A | | | | value | | | | | | | | tracking_provider | | Order Shipment > Courier | We will have either this or the below field filled. | | | | custom_tracking_provider | | Order Shipment > Courier | We will have either this or the above field filled. | | | | custom_tracking_link | | Order Shipment > Tracking URL | | | | | tracking_number | | Order Shipment > Tracking Number | | | | | date_shipped | | Order Shipment > Shipment Processed Time | | | | | tracking_id | | Order Shipment > External Id | | | line_items | | | | | | | | id | | | Product In Order > Item Order Line ID | | | | name | | | Product In Order > Item Title | | | | product_id | | | Product In Order > Channel Item ID | | | | variation_id | | | N/A | | | | quantity | | | Product In Order > Quantity | | | | tax_class | | | N/A | | | | subtotal | | | N/A | | | | subtotal_tax | | | N/A | | | | total | | | N/A | | | | total_tax | | | Product In Order > Marketplace VAT Item Price | | | | taxes | | | N/A | | | | meta_data | | | N/A | | | | sku | | | Product In Order > SKU | | | | price | | | Product In Order > Item Price | | | | image | | | | | | | | id | | N/A | | | | | src | | N/A | | | | parent_name | | | N/A | | | tax_lines | | | | N/A | | | shipping_lines | | | | | | | | id | | | N/A | | | | method_title | | | Orders > Shipping Service | | | | method_id | | | N/A | | | | instance_id | | | N/A | | | | total | | | Product In Order> Item Shipping Cost | Since shipping is not associated with product, we want to spread it evenly across the products in MCPro. | | | total_tax | | | N/A | | | | taxes | | | N/A | | | | tax_status | | | N/A | | | | meta_data | | | N/A | | | fee_lines | | | | N/A | | | coupon_lines | | | | N/A | | | refunds | | | | | We are unable to store any refund with the get orders call as we cannot associate it with any product. We will develop a get refunds call which will be scoped in the order refunds scope. | | | id | | | N/A | | | | reason | | | N/A | | | | total | | | N/A | | | payment_url | | | | N/A | | | is_editable | | | | N/A | | | needs_payment | | | | N/A | | | needs_processing | | | | N/A | | | date_created_gmt | | | | N/A | | | date_modified_gmt | | | | N/A | | | date_completed_gmt | | | | N/A | | | date_paid_gmt | | | | N/A | | | gift_cards | | | | N/A | | | currency_symbol | | | | N/A | | | _links | | | | | | | | self | | | | | | | | href | | N/A | | | | | targetHints | | | | | | | | allow | N/A | | | | collection | | | | | | | | href | | N/A | | | | email_templates | | | | | | | | embeddable | | N/A | | | | | href | | N/A | |

Order status mapping:

WooCommerce Status Hemi Status Notes
pending Pending This is an order that is pending payment
processing Ready for Shipping Payment for this order has been received and stock has been reduced. The order is waiting fulfillment
on-hold Pending The order is awaiting payment confirmation. Stock has been reduced, but the seller needs to confirm payment
completed Shipped Order fulfilled and complete
cancelled Cancelled Order has been cancelled
refunded N/A Orders are automatically put in this status when an admin or shop manager has fully refunded the order’s value after payment. We don’t want to map this status,
failed  Incomplete The customer’s payment has failed or was declined and no payment was successfully made
trash N/A
Is this article helpful?
0 0 0