Skip to content

Integrate custom order item options w/ Sales Order Item fields #52

@batonac

Description

@batonac

I need to import order item metadata/options from ShipStation orders with custom fields into ERPNext.

For example, I'd like to import the following "options" from the ShipStation API (excerpt from the ShipStation Get Order API):

... 
   "items": [
        {
            "orderItemId": 142302926,
            "lineItemKey": "9991",
            "sku": "custom-design",
            "name": "Upload Your Own Design",
           ...
            "options": [
                {
                    "name": "Design File",
                    "value": "EggShell_Stripe_06_13_22.jpg"
                },
                {
                    "name": "Design Scale (in inches)",
                    "value": "2 x 2"
                },
                {
                    "name": "Fabric",
                    "value": "Organic Cotton Interlock (American Milled)"
                },
                {
                    "name": "Size",
                    "value": "Fat Quarter (21\"x18\")"
                },
                {
                    "name": "Price Per Fat Quarter",
                    "value": "Qty: 1, Price: $13.00"
                }
            ],
            "productId": 1683943,
            "fulfillmentSku": null,
            "adjustment": false,
            "upc": null,
            "createDate": "2022-06-13T18:35:36.187",
            "modifyDate": "2022-06-13T18:35:36.187"
        },
...

Each of these fields ("Design File", "Design Scale", etc) would have a corresponding custom field in the Sales Order Items table to record this data from ShipStation.

I'm assuming this could be accomplished with the update_shipstation_order_before_submit hook, but I'm a bit confused by the code since the item key syntax used in shipstation_integration/shipstation_integration/orders.py doesn't correspond to the key syntax of the ShipStation API. For example, the key for the Order Item ID from the API is orderItemId but the key used in orders.py is item.order_item_id. This leaves me feeling unsure how to reference values in the underlying array.

I'm glad to pay for commercial development around this, and sent a corresponding request to Parsimony, but thought I'd mention it here as well in case this is rudimentary to solve...

In the end, I suppose this is part support request, part feature request. It's vital, in some scenarios, to have some way for this order item metadata to flow through. Baking support for this into this app, with some kind of corresponding lookup/match table in the Shipstation Settings, would be swell. I'm glad to do some sponsoring here either way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions