Shopify - Create Order Fulfillment
@sergio
code:
data:privatelast updated:4 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
shopify_create_order_fulfillment
Create Order Fulfillment
auth
(auths.shopify)
params
Order id

The unique numeric identifier for the order.

 
integer ·params.order_id
Location id

The unique identifier of the location that the fulfillment should be processed for. To find the ID of the location, use the Location resource.

 
integer ·params.location_id
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
}
26

return await require("@pipedreamhq/platform").axios(this, {
  method: "post",
  url: `https://${auths.shopify.shop_id}.myshopify.com/admin/api/2020-01/orders/${params.order_id}/fulfillments.json`,  
  headers: {
    "X-Shopify-Access-Token": `${auths.shopify.oauth_access_token}`,
    "Content-Type": `application/json`,
  },
  data: {
      fulfillment: {
        line_items: typeof params.line_items == 'undefined' ? params.line_items : JSON.parse(params.line_items),
        location_id: params.location_id,
        name: params.name,
        notify_customer: params.notify_customer,
        receipt: typeof params.receipt == 'undefined' ? params.receipt : JSON.parse(params.receipt),
        service: params.service,
        shipment_status: params.shipment_status,
        status: params.status,
        tracking_company: params.tracking_company,
        tracking_numbers: typeof params.tracking_numbers == 'undefined' ? params.tracking_numbers : JSON.parse(params.tracking_numbers),
        tracking_urls: typeof params.tracking_urls == 'undefined' ? params.tracking_urls : JSON.parse(params.tracking_urls),      
    }
  }
})