# Update order tracking from JSON

If your supplier provides order tracking data through an API, you can use it to fulfill orders in Shopify. Typically, the data is shared in JSON format. Here’s an example of what the API response might look like:

```json
{
    "order_number": "#4417",
    "tracking_number": "1234567890",
    "items": [
      {
        "sku": "SKU12345",
        "quantity": 1
      },
      {
        "sku": "SKU54321",
        "quantity": 2
      }
    ]
  }
```

In this scenario, configure the following settings in the Data Mapping section:

<figure><img src="https://2609323150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F97qHA4IuHSHLxA8BhsWe%2Fuploads%2Fgit-blob-3a13fdc515685ac16ba8c98b0eedc95589419c37%2Ffulfilleo-json-data-mapping.png?alt=media" alt=""><figcaption><p>Data Mapping section in Fulfilleo for JSON file</p></figcaption></figure>

In scenarios where data retrieval is required from a field higher in the JSON hierarchy, you can utilize the variables `order` and `shipment`.

* `order`: contains details about a single order from the API
* `shipment`: contains details about a single shipment from the API (only available if the Shipment field is included in the Data Mapping section)

### Fulfill single orders

Some suppliers require the order number to be included in the URL when making a request. Fulfilleo supports these cases by iterating through all unfulfilled and partially fulfilled orders to check if the supplier has provided tracking data.

<figure><img src="https://2609323150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F97qHA4IuHSHLxA8BhsWe%2Fuploads%2Fgit-blob-35cbcd0a0fdf1995f0e7259aa8d5e8f0764c4483%2Ffulfilleo-order-number-in-url.png?alt=media" alt=""><figcaption><p>Order number variable in URL</p></figcaption></figure>

You can include the following variables in the URL:

* `{{ order_number }}`
* `{{ order_id }}`
* `{{ order_email }}`
* `{{ order.metafields.<namespace>.<key> }}`

In this mode, you can utilize the `context` object in the Data Mapping section. The `context` object provides the following structure and contains key details about the order from Shopify:

```json
{
    "order": {
        "id": 1234567890123,
        "created_at": "2025-01-01T00:00:00+01:00",
        "email": "test@test.com",
        "name": "#D1263",
        "number": 263,
        "order_number": 1263,
        "tags": ""
    },
    "order_id": 1234567890123,
    "order_name": "#D1263",
    "order_number": 1263
}
```

Sometimes, the API response might not include the order number required in the **Data Mapping** section. In such cases, you can use `{{ context.order.order_number }}` or `{{ context.order_number }}` to provide the necessary order number.

<figure><img src="https://2609323150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F97qHA4IuHSHLxA8BhsWe%2Fuploads%2Fgit-blob-0a97519fee42f69e36045f2f3174c2ebd9195d75%2Ffulfilleo-order-number-from-context.png?alt=media" alt=""><figcaption><p>Order Number from <code>context</code> object</p></figcaption></figure>
