Hemi Connectors / Fuse5 Technical Scope / Fuse5 Get Shipment

Fuse5 Get Shipment

Version Date Created / Updated Notes
v1.0 02/05/2025 Hristiyan First publish

There is no specific call which returns only the shipment information on an order so we need to use a more general call which returns all the information for a finalized order.

Get Shipment

API Docs : https://greenteam.fuse5live.com/f5apidoc/standalone/#api-Sales_Order- Get Sales Orders by finalized date

API Call : sales_order/get_finalized_date

We want to incorporate and use the last_date_run table in order to query for the latest orders. We want to use the record in last_date_run as sales_order_finalized_date_end and then overlap it with 1 hour and use last_date_run minus 1 hour as sales_order_finalized_date_start

Please note ❗❗❗ Since Fuse5 is a US based system, all times are in the US Eastern Time Zone (ET) which means we need to convert to this time zone when using the times from the last_date_run table.

Sample Request:

{
    "authenticate":{
        "apikey":"API KEY" 
    },
    "services":[        
        {
            "call":"sales_order/get_finalized_date",
            "identifier":{              
                "limit":20,
                "offset":0,
                "sales_order_finalized_date_start":"YYYY-MM-DD HH:MM:SS",
                "sales_order_finalized_date_end":"YYYY-MM-DD HH:MM:SS" 
               }
        }
    ]
}

Sample Response:

{
    "authenticate": {
        "apikey": "RvDYVek0LHwq32WgKGe3Xyil8Gp8cUWN",
        "status": "success"
    },
    "services": [
        {
            "request": {
                "call": "sales_order/get_finalized_date",
                "params": [],
                "identifier": {
                    "limit": "20",
                    "offset": "0",
                    "sales_order_finalized_date_start": "2025-04-29 10:00:00",
                    "sales_order_finalized_date_end": "2025-04-29 10:10:00",
                    "apitype": "Standalone"
                }
            },
            "response": {
                "status": true,
                "msg": [
                    {
                        "M003": "Data retrieved successfully"
                    }
                ],
                "data": {
                    "total": "1",
                    "rows": [
                        {
                            "sales_order_details": {
                                "sales_order_number": "S1-173700",
                                "sales_order_location": "Bora Bora",
                                "sales_order_invoice_number": "S1-173700",
                                "sales_order_total_products": "",
                                "sales_order_created_date": "04-29-2025 10:03:08",
                                "sales_order_invoice_date": "04-29-2025 10:03:21",
                                "sales_order_status": "Finished",
                                "sales_order_shipped_via": "Our Truck",
                                "sales_order_grand_total": "35.34",
                                "sales_order_id": "7269549",
                                "account_balance_terms": "Net 1",
                                "account_number": "000500",
                                "account_name": "CASH ACCOUNT - Fuse5 API",
                                "sales_order_finalized_date": "04-29-2025 10:03:21",
                                "tracking_number": "",
                                "customerpo": "",
                                "total_tax": "0.04",
                                "sell_total": "35.3",
                                "payments": [
                                    {
                                        "payment_type": "chargetoaccount",
                                        "payment_name": "CHARGE TO ACCOUNT",
                                        "amount": "35.34",
                                        "payment_mode": "S"
                                    }
                                ]
                            },
                            "sales_order_account_detail": {
                                "account_id": "3989450",
                                "account_name": "CASH ACCOUNT - Fuse5 API",
                                "website": "",
                                "phone": "(000) 000-0000",
                                "other_phone": "",
                                "fax": "12312345678",
                                "primary_email": "test@test.com",
                                "secondary_email": "",
                                "default_location": "Bora Bora",
                                "account_number": "000500",
                                "account_title": "",
                                "contact_firstname": "John",
                                "contact_lastname": "Bunting",
                                "default_delivery_preference": "Our Truck",
                                "statement_type": "Email PDF",
                                "relationship_status": "Regular",
                                "parent_account_id": "0",
                                "statement_frequency": "Month",
                                "default_payment_method": "Cash",
                                "backorder_edi": "Keep",
                                "bill_street": "1",
                                "bill_pobox": "ytrtryrty",
                                "bill_city": "Sofia",
                                "bill_state": "Sofia",
                                "bill_county": "yrtyrt",
                                "bill_country": "Bulgaria",
                                "bill_code": "1700",
                                "ship_street": "Dimitar Blagoev",
                                "ship_pobox": "ytrtryrty",
                                "ship_city": "Sofia",
                                "ship_state": "Sofia",
                                "ship_county": "yrtyrt",
                                "ship_country": "Bulgaria",
                                "ship_code": "1300",
                                "account_receivable_type": "Open Item",
                                "statement_trans_type": "Hybrid OI",
                                "payment_history": "444444444444444444444444",
                                "credit_limitvar": "9999999.00",
                                "terms": "Net 1",
                                "open_account_receivable_type": "34787.37",
                                "account_current_balance": "957.42",
                                "billing_cycle_pastdue1": "0.00",
                                "billing_cycle_pastdue2": "0.00",
                                "billing_cycle_pastdue3": "0.00",
                                "billing_cycle_pastdue_morethen3": "33829.95",
                                "deferred": "0.00",
                                "sales_person": "4326754",
                                "sales_group": "6926980",
                                "allow_b2b_access": "",
                                "account_tax_authority_code": ""
                            },
                            "sales_order_billing_address": {
                                "account_name": "Dum Taki",
                                "account_number": "",
                                "account_contact": "Dum Taki",
                                "account_phone": "(319) 248-5658",
                                "account_email": "",
                                "account_fax": "",
                                "street": "1",
                                "pobox": "ytrtryrty",
                                "city": "Sofia",
                                "state": "Sofia",
                                "county": "yrtyrt",
                                "country": "Bulgaria",
                                "code": "1700",
                                "note": ""
                            },
                            "sales_order_shipping_address": {
                                "account_name": "Dum Taki",
                                "account_number": "",
                                "account_email": "",
                                "account_phone": "(319) 248-5658",
                                "account_fax": "",
                                "street": "Dimitar Blagoev",
                                "pobox": "ytrtryrty",
                                "city": "Sofia",
                                "state": "Sofia",
                                "county": "yrtyrt",
                                "country": "Bulgaria",
                                "code": "1300",
                                "account_contact": "Dum Taki",
                                "note": ""
                            },
                            "sales_order_product_details": [
                                {
                                    "line_code": "PML",
                                    "product_name": "P1 name",
                                    "product_number": "14331",
                                    "comment": "",
                                    "vehicle_comment": "",
                                    "tariff_code": "",
                                    "country_of_origin": "",
                                    "unit_of_measure": "",
                                    "list_price": "0.00",
                                    "core_price": "0.00",
                                    "sell_price": "30.00",
                                    "subtotal": "30.00",
                                    "quantity": "1",
                                    "localtax": "0.00",
                                    "statetax": "0.03",
                                    "extended_original_product_cost": "0.00",
                                    "tax_dollars": "0.03",
                                    "tax_percent": "0.03",
                                    "product_group": "",
                                    "subline": "",
                                    "current_cost": "0.00",
                                    "average_landed_cost": "23.00"
                                },
                                {
                                    "line_code": "FRT",
                                    "product_name": "Freight",
                                    "product_number": "Freight",
                                    "comment": "",
                                    "vehicle_comment": "",
                                    "tariff_code": "",
                                    "country_of_origin": "",
                                    "unit_of_measure": "",
                                    "list_price": "43.49",
                                    "core_price": "0.00",
                                    "sell_price": "5.30",
                                    "subtotal": "5.30",
                                    "quantity": "1",
                                    "localtax": "0.00",
                                    "statetax": "0.01",
                                    "extended_original_product_cost": "12.50",
                                    "tax_dollars": "0.01",
                                    "tax_percent": "0.01",
                                    "product_group": "",
                                    "subline": "",
                                    "current_cost": "12.50",
                                    "average_landed_cost": "16.23"
                                }
                            ],
                            "sales_order_delivery_detail": []
                        }
                    ]
                }
            }
        }
    ]
}

In order to understand which order we need to update, we need to map sales_order_details > sales_order_id with Orders > Connector ID.

Then, from the response we need to map the sales_order_details > tracking_number into Order Shipment > Tracking Number and sales_order_details > sales_order_shipped_via into Order Shipment > Courier . We also have to add the shipped products in the shipment. This is to be done by concatinating sales_order_product_details > line_code with sales_order_product_details > product_number using the Connector Fuse5 > SKU Delimiter as delimiter between the two, and then mapping it with our Product In Order > SKU. There is also quantity in the sales_order_product_details so we can understand if all quantity or part of the quantity of a product was shipped. All other fields are to be ignored.

Sample Error Response:

{

   authenticate: {
       apikey: "dsfq1B61RbzARmphDC5LH7EaXV3V95HW0ik",
       status: "success"
   },
   services: [
       {
           request: {
               call: "sales_order/get_finalized_date",
               params: null,
               identifier: {
                   limit: "0",
                   offset: 0,
                   sales_order_finalized_date_start: "2023-01-01",
                   sales_order_finalized_date_end: "2023-11-20",
                                      }
           },
           response: {
               status: false,
               msg: [
                   {
                       E009: "The 'limit' field contains a value that is not accepted"
                   }
               ],
               data: null
           }
       }
   ]

}

When we have an error response, we will have a status = false. In this case we will have the error message in the msg object. We want to store the message into Order Error with Type = Connector

Is this article helpful?
0 0 0