# 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="/files/5HUKBPGZLa7jKg78T5SD" 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="/files/e1EARCVMyU67eYFUTiK9" 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="/files/lkCTwiY2aIBDE6XuUzZR" alt=""><figcaption><p>Order Number from <code>context</code> object</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.fulfilleo.solvenium.com/data-mapping/update-order-tracking-from-json.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
