DataJet
  • Welcome to DataJet
  • Scripts
    • Introduction
    • Scripts
      • Input
      • HTTP
      • Scheduled
      • Event
      • Shipping Rate
      • Email
    • Creating a custom script
  • Liquid
    • Introduction
    • Tags
      • exit
      • function
      • json
      • push
      • run
    • Filters
      • array_difference
      • array_equal
      • array_intersection
      • array_symmetric_difference
      • base64_decode
      • base64_encode
      • concat
      • content
      • email
      • encode_uri
      • file
        • multipart
        • url
        • content
      • find
      • find_exp
      • flat
      • flow
      • flow_v2
      • ftp
      • graphql
      • group_by
      • group_by_exp
      • hmac_sha256
      • http
      • in_groups_of
      • in_timezone
      • log
      • parse_json
      • parse_csv
      • parse_xml
      • pop
      • push
      • random
      • remove_prop
      • rest
      • run
      • sha1
      • sum
      • time_add
      • time_subtract
      • type
      • where_exp
  • Misc
    • Credits and usage
    • GitHub Integration
      • Track changes in a script's source code
      • Connect development stores with development branches
      • Use one codebase across multiple Shopify stores
    • Functions
    • Variables
    • Shopify Flow Integration
      • V1
      • V2
    • Processing user submitted forms
Powered by GitBook
On this page
  1. Liquid
  2. Filters

rest

rest will allow you to perform Shopify actions with use of Shopify REST API.

It accepts a JSON object as a parameter.

Here is an example input object that would be used to create fulfillment via REST API.

{% json rest_input %}
  {
    "path": "/orders/1234567/fulfillments.json",
    "method": "POST",
    "body": {
      "fulfillment": {
        "location_id": "98765431",
        "notify_customer": false,
        "status": "success"
      }
    }
  }
{% endjson %}

Above can be used together with rest filter to create fulfillment for order: 1234567.

{% assign fulfillment_result = rest_input | rest %}

fulfillment_result is going to store response returned from shopify. If we want to access newly created fulfillment we would do with with following syntax: fulfillment_result.body.fulfillment

rest input object has one required parameter which is path. You can always look up path for every Shopify resource in official Shopify REST documentation:

Previousremove_propNextrun

Last updated 4 years ago

REST Admin API referenceShopify
Logo