Fulfillments
Create, update, and query fulfillments.
Table-Specific Information
Select
The connector uses the Shopify API to process search criteria that refer to the Id, OrderId, CreatedAt, and UpdatedAt columns. The connector processes other filters client-side within the connector.For example, the following queries are processed server-side.
-
If you specify the unique identifier of the order, then this view will only list fulfillment information concerning that order. You can also retrieve a specific fulfillment by specifying OrderId and Id. To retrieve fulfillments associated with a fulfillment order you need to specify the FulfillmentOrderId.
SELECT * FROM Fulfillments WHERE OrderId = '123' SELECT * FROM Fulfillments WHERE OrderId = '123' AND Id = '567' SELECT * FROM Fulfillments WHERE FulfillmentOrderId = '123'
-
This view supports filtering by the CreatedAt and UpdatedAt columns on the server-side.
SELECT * FROM Fulfillments WHERE CreatedAt > '2017-10-25'
Insert
You must specify the FulfillmentOrderId column to insert a fulfillment.
-
Fulfill one line item using aggregates.
INSERT INTO Fulfillments (FulfillmentOrderId, LineAggregate) VALUES ('123', '[{\"id\":\"123\"}]')
-
Fulfill one line item using temporary table. The temporary table you are populating is dynamic and will be created at run time the first time you insert to it. Temporary tables are denoted by a # appearing in their name. When using a temporary table to insert, the temporary table must be named in the format [TableName]#TEMP, where TableName is the name of the table you will be inserting to. For instance:
Insert INTO OrdersItems#TEMP (ItemId) VALUES ('123')
Once your temporary table is populated, it is now time to insert to the actual table in Shopify. You can do this by performing an INSERT to the actual table and setting as a value for LinesAggregate the name of the temporary table. For instance:
Insert INTO Fulfillments (FulfillmentOrderId, LinesAggregate) VALUES ('123', 'OrdersItems#TEMP')
In cases that two ore more shop locations are specified in your Shopify account the LocationId needs to be added. For instance:
Insert INTO Fulfillments (FulfillmentOrderId, LocationId, LinesAggregate) VALUES ('123', '456', 'OrdersItems#TEMP')
-
Fulfill many line items using aggregates.
INSERT INTO Fulfillments (FulfillmentOrderId, LineAggregate) VALUES ('123', '[{\"id\":\"123\"},{\"id\":\"456\"},{\"id\":\"789\"}]')
-
Fulfill many line items using temporary table.
INSERT INTO OrdersItems#TEMP (ItemId) VALUES ('123') INSERT INTO OrdersItems#TEMP (ItemId) VALUES ('456') INSERT INTO OrdersItems#TEMP (ItemId) VALUES ('789') INSERT INTO Fulfillments (FulfillmentOrderId, LineAggregate) VALUES ('123', 'OrdersItems#TEMP')
-
Fulfill all line items, notify the customer, and set a tracking number.
INSERT INTO Fulfillments (FulfillmentOrderId, TrackingNumbers, NotifyCustomer) VALUES ('123', 'FEDEX1', true)
-
Partially fulfill a single line item by explicitly specifying the line item and quantity to be fulfilled using aggregates.
INSERT INTO Fulfillments (FulfillmentOrderId, LineAggregate) VALUES ('123', '[{\"id\":\"123\",\"quantity\":5}]')
-
Partially fulfill a single line item by explicitly specifying the line item and quantity to be fulfilled using temporary table.
INSERT INTO OrdersItems#TEMP (ItemId, ItemQuantity) VALUES ('123', 5) INSERT INTO Fulfillments (FulfillmentOrderId, LineAggregate) VALUES ('456', 'OrdersItems#TEMP')
-
Complete a fulfillment (you must specify the Id of the fulfillment as well).
INSERT INTO Fulfillments (FulfillmentOrderId, Id, Status) VALUES ('123', '456', 'Complete')
-
Transition a fulfillment from pending to open (you must specify the Id of the fulfillment as well).
INSERT INTO Fulfillments (FulfillmentOrderId, Id, Status) VALUES ('123', '456', 'Open')
-
Cancel a fulfillment (you must specify Id of the fulfillment as well).
INSERT INTO Fulfillments (FulfillmentOrderId, Id, Status) VALUES ('123', '456', 'Cancel')
Update
You must specify the OrderId and Id of the fulfillment to fulfill an order.
UPDATE Fulfillments SET TrackingNumbers = 'FedEx123,UPS123' WHERE OrderId = '123' AND Id = '456'
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | Long | True |
A unique numeric identifier for the fulfillment. | |
OrderId | Long | False |
Orders.Id |
A unique numeric identifier for the order. |
LocationId [KEY] | Long | False |
A unique numeric identifier for the Location. | |
NotifyCustomer | Bool | False |
A flag indicating whether the customer should be notified | |
Status | String | False |
The status of the fulfillment. | |
Receipt | String | True |
Provides information about the receipt of this fulfillment. | |
TrackingCompany | String | False |
The name of the tracking company. | |
TrackingNumbers | String | False |
A list of comma-separated tracking numbers, provided by the shipping company. | |
TrackingUrls | String | False |
The sum of all the prices of all the items in the fulfillment. | |
VariantInventoryManagement | String | True |
States the name of the inventory management service. | |
CreatedAt | Datetime | True |
The date and time when the fulfillment was created. | |
UpdatedAt | Datetime | True |
The date and time when the fulfillment was last modified. | |
LineAggregate | String | False |
A JSON aggregate of line items associated with the fulfillment. | |
OrderUpdatedAt | Datetime | True |
The date and time when the order was last modified. | |
OrderCreatedAt | Datetime | True |
The date and time when the order was last created. | |
FulfillmentOrderId | Long | False |
The ID of the fulfillment order that is associated with the fulfillments. |