square / square-nodejs-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create Order Dropping Catalog_Object_Id Property

TristonWasik opened this issue · comments

I have been implementing square for an ecommerce site that I've been working on. Using the SDK I have gotten just about everything worked out except the create order functionality. When I create the order using the following:

const response = await ordersApi.createOrder({ idempotencyKey: uuid, order: { locationId: LOCID, lineItems, }, });

The POST request to square seems to just drop all of my lineItem 'catalog_object_id' property, however the quantity property remains and is correct. Here is the lineItem object I am passing in:

[ { catalog_object_id: '4QAL2SVDTNQB2O43ILNODDIG', quantity: '4' }, { catalog_object_id: 'AQ6WVDOXDRRBSFNURWZIAZK6', quantity: '1' } ]

When I create an example of the request in the interactive API, I see the following:

{ "order": { "location_id": "L2738YY5ZPMZA", "line_items": [ { "quantity": "4", "catalog_object_id": "4QAL2SVDTNQB2O43ILNODDIG" }, { "quantity": "1", "catalog_object_id": "AQ6WVDOXDRRBSFNURWZIAZK6" } ] }, "idempotency_key": "a9265fd0-eaf0-421f-95d6-8aab16193139" }

Am I doing something wrong, or is this an issue that others are having?