> ## Documentation Index
> Fetch the complete documentation index at: https://developer.fabric.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Importing order and inventory data

This document is intended for merchants and System Integrator (SI) partners who want to migrate or import inventory and order data.

## Prerequisites

* Ensure that you have **Orders & Inventory Editor** or **Administrator** privileges to fabric Orders. For more information, see the [Role-Based Access Control](/v3/platform/settings/rbac/role-based-access-control-orders-roles) section.
* Ensure that you have a valid [Authorization Token](/v3/getting-started/api-guides/getting-started-with-fabric-apis) to provide in the header. When generating an authorization token, ensure that the API System App that you are using to generate the token has the correct role assigned. If a token doesn't have the correct role, the following error is returned:

```json theme={null}
{
not a valid key=value pair (missing equal-sign) in Authorization header: {token}
}
```

* If you have fabric **Products Catalog** enabled for your organization, ensure that you [create and update the product catalog](https://developer.fabric.inc/v3/api-reference/product-catalog/developer-guide#import-product-data-through-bulk-import) before importing inventory. If you are using product management software other than fabric’s Product Catalog, you must import your product data using the [Products endpoint](/v3/product-catalog/api-reference/product-catalog/general-product-operations/add-products).
* Ensure that you have at least one [fulfillment location](/v3/orders-and-inventory/api-reference/orders/developer-guide/inventory-setup#create-location), such as a Distribution Center (DC).

## Process

To import inventory, you must create an inventory CSV file. Once you have filled in the CSV file, you can upload it to the `inventory-imports` endpoint. With the file uploaded, fabric process's the CSV file and populates your inventory. With your baseline inventory populated, you're ready to update the counters onHand, allocated, and shipped for each location. This populates your total available to purchase amount for each product and populates the inventory for each location.

* [Import Inventory](#importing-inventory)

To import orders, you must create an orders JSON file. Once you have completed the JSON file, you can upload it to the `oms-imports` endpoint. With the file uploaded, fabric process's the JSON file and populates your orders.

* [Import Orders](#importing-orders)

## Importing Inventory

Before using the `inventory-imports` endpoint, you must download and update the **Update** CSV file template. This file is uploaded in a subsequent API call.

### Step 1: Download the CSV template file

1. Log in to fabric Copilot.

2. In the left menu, click **Inventory**.

   The **Manage inventory** tab is displayed.

3. Click **Import**.

   The **Import CSV file to add or edit your inventory** window is displayed. Two templates are provided.

4. Click **Template: Update**.

The **inventory\_update.csv** file is downloaded.

### Step 2: Update the CSV template file

The **inventory\_update.csv** file contains a number of columns with optional fields, such as preorder and backorder dates. These fields are set to **Null** by the system if left blank. The following values are required:

| Field               | Description                                                                                                                      |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **SKU**             | The stock keeping unit.                                                                                                          |
| **Item ID**         | The fabric item ID generated after a successful import of a product. This is required only if you use fabric Product Catalog.    |
| **Location Number** | A unique value used to identify the location such as a DC. Products can have multiple locations associated with their inventory. |
| **Channel ID**      | The sales channel ID.                                                                                                            |

### Step 3: Create the `importId`

The `inventory-imports` endpoint is used to create the `importId` and returns a `uploadFileUrl`. The `uploadFileUrl` is used to upload the CSV file from [step 2](#step-2-update-the-template-csv-file) that populates your inventory levels.

**POST Request**:

```Bash theme={null}
curl --location --request POST 'https://api.fabric.inc/api/v3/inventory-imports/' \
--header 'x-fabric-tenant-id: {tenantId}' \
--header 'x-fabric-channel-id: 12' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: {authToken} \
--data '{
    "fileName": "C:/Users/Fabric/Downloads/Inventory_Import.csv",
    "type": "INVENTORY"
}'
```

**Response**:

```Bash theme={null}
{
    "importId": "1716414052775_CUsersFabricDownloadsInventory_Import",
    "uploadFileUrl": "{AWS S3 upload URL}"
}
```

### Step 4: Upload the template file

Use the `uploadFileUrl` value, which is returned in [step 3](#step-3-create-the-importid), and send a **PUT** request with the template file.

Note: No authorization token is required for this step. If you use Postman, click the URL to automatically open the request in a new tab. Remember to change the request from GET to PUT and in the body of the request click the binary option followed by providing your inventory CSV file.

```Bash theme={null}
curl --location --request PUT '{AWS S3 upload URL}' \
--header 'Content-Type: text/csv' \
--data '@/C:/Users/Fabric/Downloads/Inventory_Import.csv'
```

A successful response returns a 200 status.

### Step 5: Check the upload status

Ensure that you have the `importId` value from the response in [Step 3](#step-3-create-the-importid).

You can check your inventory upload status by making a **GET** request to the `inventory-imports/{importId}` endpoint.

**GET Request**:

```Bash theme={null}
curl --location --request GET 'https://api.fabric.inc/api/v3/inventory-imports/1716408181352_Inventory_Import' \
--header 'x-fabric-tenant-id: {tenantId}' \
--header 'x-fabric-channel-id: 12' \
--header 'Accept: application/json' \
--header 'Authorization: {authToken}'
```

**Response**:

```Bash theme={null}
{
    "importId": "1716414052775_CUsersFabricDownloadsInventory_Import",
    "type": "bulk",
    "statusCode": "COMPLETED",
    "attributes": {
        "isTrueUp": false
    },
    "createdAt": "2024-05-22T20:03:01Z",
    "updatedAt": "2024-05-22T20:03:02Z",
    "originalFileUrl": "{AWS S3 upload URL}",
    "importCount": {
        "uploaded": 1,
        "processed": 1,
        "error": 0
    }
}
```

On the **Manage inventory** page mentioned in [step 1](#step-1-download-the-template-csv-file), the **Available To Purchase** column for each SKU is updated. Note that you may need to refresh your browser to see the update.

### Step 6: Update inventory counters

After importing your inventory, update the default counters for **onHand**, **allocated**, and **shipped** for each product. Custom counters are supported and can be created using the [Counters API](/v3/orders-and-inventory/api-reference/inventory/counters/create-counter) endpoint.

**PUT Request**:

```Bash theme={null}
curl --location --request PUT 'https://api.fabric.inc/v3/inventories/actions/find-and-adjust-inventory-counters' \
--header 'Authorization: Bearer {authorizationToken}' \
--header 'Content-Type: application/json' \
--header 'x-fabric-channel-id: 12' \
--header 'x-fabric-tenant-id: {tenantId}' \
--data '{
  "inventoryId": "664fabec0f0853fe68e2bea8",
  "sku": "123456",
  "itemId": 12332,
  "locationNumber": 90012,
  "counters": {
    "allocated": 50,
    "onHand": 200,
    "shipped": 20
  }
}'
```

**Response**:

With the inventory counters updated, the fabric virtual counter also updates the SKU's **Available To Purchase** value. In the following example, the value is updated to 130:

```JSON theme={null}
{
    "inventoryId": "664e51c60f0853fe681fc3e6",
    "sku": "123456",
    "itemId": 12332,
    "locationNumber": 90012,
    "channelId": "12",
    "createdAt": "2024-05-22T20:12:54.082+00:00",
    "updatedAt": "2024-05-24T22:03:51.903+00:00",
    "backorderLimit": 0,
    "preorderLimit": 0,
    "safetyStock": 0,
    "lowStock": 0,
    "counters": {
        "allocated": 50,
        "onHand": 200,
        "shipped": 20
    },
    "customAttributes": {},
    "networkCounters": {}
}
```

## Importing orders

Before using the `oms-imports` endpoint, you must create a JSON file containing all your order information in a specific format.

The JSON file is used to provide a centralized source for order, inventory, and warehouse information, enabling you to receive, track, and fulfill customer orders.

### Step 1: Create the JSON file containing your orders

Note that each line in the JSON file represents one order. If you want to import 1000 orders , the file should have exactly 1000 lines with each line representing an order object. If you save the JSON file with an extension that makes it more readable or expands the object to more than one line, the upload fails.

<Accordion title="JSON order example">
  This section provides a JSON example that shows a single order object formatted to be readable. The following sample code includes examples of potential custom attributes and is designed to illustrate the best-case scenario, offering a comprehensive order view:

  ```JSON Example Order theme={null}
  {
    "orderId": "o11213873041",
    "orderNumber": "132279859",
    "orderDate": "2023-07-02T07:13:26",
    "cancellationDate": "",
    "channelId": "12",
    "cartId": null,
    "type": "WEB",
    "subType": "Domestic",
    "employeeId": "",
    "retail": {
        "locationNum": "90012"
    },
    "orderSubTotal": 197.88,
    "originalSubTotal": 197.88,
    "orderDiscount": 52.64,
    "originalDiscounts": 52.64,
    "adjustmentTotal": 0.00,
    "originalAdjustmentTotal": 0.00,
    "feeTotal": 0.00,
    "originalFeeTotal": 0.00,
    "taxTotal": 7.99,
    "appeasementTotal": 0.00,
    "originalTaxTotal": 7.99,
    "returnTotal": 0.00,
    "cancelTotal": 0.00,
    "invoiceTotal": 153.23,
    "orderTotal": 153.23,
    "originalOrderTotal": 153.23,
    "currency": "USD",
    "statusCode": "ORDER_SHIPPED",
    "statusDescription": "ORDER_SHIPPED",
    "attributes": {
        "createdDate": "2023-03-24T07:22:24",
        "tracking-hash": "",
        "isMigrated": true
    },
    "fees": [],
    "appeasements": [],
    "discounts": [
        {
            "quantity": 1,
            "amount": 30.00,
            "unit": null,
            "value": 0.00,
            "promoId": "promo30359324",
            "promoCode": null,
            "promoTitle": "Loyalty Offer",
            "type": "Order Discount",
            "invoiceQuantity": 1,
            "returnQuantity": 0,
            "cancelQuantity": 0
        },
        {
            "quantity": 1,
            "amount": 7.64,
            "unit": null,
            "value": 5.00,
            "promoId": "PASSPORT",
            "promoCode": null,
            "promoTitle": "Passport",
            "type": "Order Discount - Percent Off",
            "invoiceQuantity": 1,
            "returnQuantity": 0,
            "cancelQuantity": 0
        },
        {
            "quantity": 1,
            "amount": 15.00,
            "unit": null,
            "value": 0.00,
            "promoId": "promo31919319",
            "promoCode": null,
            "promoTitle": "BIRTHDAY ONLY",
            "type": "Order Discount",
            "invoiceQuantity": 1,
            "returnQuantity": 0,
            "cancelQuantity": 0
        }
    ],
    "customer": {
        "name": {
            "first": "Joe",
            "middle": null,
            "last": "Madison"
        },
        "email": "Joe.madison@gmail.com",
        "phone": {
            "number": "2075224290",
            "type": "MOBILE"
        },
        "userId": "C1108401952",
        "accountId": "1108401952",
        "employeeId": "",
        "company": null
    },
    "payments": [
        {
            "paymentCounter": 1,
            "paymentDate": "2023-07-02T07:13:26",
            "billToId": "pg12906396079",
            "paymentIdentifier": {
                "cardIdentifier": "4284",
                "expirationYear": "2025",
                "expirationMonth": "11",
                "paymentId": "pg12906396079",
                "fabricPaymentReference": "pg12906396079"
            },
            "paymentProvider": "CNP",
            "paymentToken": {
                "token": "5243662388273181",
                "paymentType": null
            },
            "paymentMethod": "applePay",
            "authAmount": 153.23,
            "chargedAmount": 153.23,
            "refundAmount": 0.00,
            "currency": "USD",
            "conversion": 1,
            "paymentStatus": "AUTHORIZED",
            "billToAddress": {
                "name": {
                    "first": "Joe",
                    "middle": null,
                    "last": "Madison"
                },
                "email": "Joe.madison@gmail.com",
                "phone": {
                    "number": "2075224290",
                    "type": "MOBILE"
                },
                "address1": "11 Beryl Loop",
                "address2": null,
                "address3": null,
                "address4": null,
                "city": "Topsham",
                "state": "ME",
                "country": "USA",
                "postalCode": "04086",
                "type": null,
                "latitude": null,
                "longitude": null
            },
            "attributes": {
                "requestedDate": "2023-07-02T11:13:27",
                "expirationMonth": "11",
                "expirationYear": "2025",
                "cardIdentifier": "4284",
                "lastFour": "4284",
                "referenceId": "8825362745964734",
                "authCode": null,
                "authExpirationDate": null,
                "softDecline": null,
                "payerId": null,
                "paypalToken": null,
                "_comment": "Fields related to amazon pay",
                "authorizedAmount": null,
                "captureAmount": null,
                "captureCurrencyCode": null,
                "captureReferenceId": null,
                "amazonAuthorizationId": null,
                "amazonOrderReferenceId": null,
                "authorizationCurrencyCode": null,
                "authorizationReferenceId": null,
                "captureNow": null,
                "sellerAuthorizationNote": null,
                "softDescriptor": null,
                "sellerCaptureNote": null,
                "transactionTimeout": null,
                "amazonCaptureId": null,
                "refundAmount": null,
                "refundCurrencyCode": null,
                "refundReferenceId": null,
                "sellerRefundNote": null,
                "_comment1": "Fields related to credit card",
                "cnpTxnId": "ps1159357855",
                "accountNumber": null,
                "cardType": "MasterCard",
                "checkoutId": null,
                "expirationDate": "11-2025",
                "omniToken": "5243662388273181",
                "orderSource": "applePay",
                "payPageRegId": null,
                "_comment2": "Fields related to gift card",
                "paymentRequests": [
                    {
                        "transactionId": null,
                        "paymentId": null,
                        "customProperties": null,
                        "gatewaySettings": null,
                        "cardDetails": {
                            "giftCardNumber": null,
                            "giftCardPin": null
                        },
                        "amount": 153.23,
                        "transactionTimestamp": "2023-07-02T11:13:27",
                        "paymentMethod": null,
                        "gatewayId": null
                    }
                ],
                "_comment3": "Fields related to AfterPay",
                "token": null,
                "afterPayOrderNumber": null,
                "tenderTypeId": "51",
                "invoiceNumber": null
            },
            "partialCapture": false,
            "finalCapture": true
        }
    ],
    "returns": [],
    "items": [
        {
            "lineItemId": "ci100596348648",
            "lineItemNumber": "4",
            "itemId": "12332",
            "sku": "123456",
            "channelId": "12",
            "title": "Test Product OMS",
            "type": "ShipToHome",
            "isBackorder": false,
            "isPreorder": false,
            "orderedQuantity": "1",
            "backOrderedQuantity": 0,
            "pendingShippedQuantity": 0,
            "pendingShippedBackOrderQuantity": null,
            "shippedQuantity": 1,
            "deliveredQuantity": 0,
            "invoiceQuantity": 1,
            "cancelledQuantity": 0,
            "pendingReturnQuantity": 0,
            "processingReturnQuantity": 0,
            "rejectedReturnQuantity": 0,
            "returnedQuantity": 0,
            "reshippedQuantity": 0,
            "quantityInStatus": {
                "created": 0,
                "pendingShipped": 0,
                "shipped": 1,
                "returned": 0,
                "cancelled": 0,
                "hold": 0,
                "delivered": 0
            },
            "shipToId": "sg12601324493",
            "itemUnitPrice": 74.25,
            "itemSubTotal": 74.25,
            "originalItemSubTotal": 74.25,
            "itemFeeTotal": null,
            "originalFeeTotal": 0.00,
            "itemShippingTotal": null,
            "originalShippingTotal": null,
            "appeasementTotal": null,
            "itemDiscountsTotal": 19.79,
            "originalDiscounts": 19.79,
            "itemAdjustmentTotal": 0.00,
            "originalItemAdjustmentTotal": 0.00,
            "itemTaxTotal": 2.99,
            "originalTaxTotal": 2.99,
            "itemTotal": 57.45,
            "originalItemTotal": 57.45,
            "outstandingItemTotal": null,
            "originalOutstandingItemTotal": null,
            "invoiceTotal": 57.45,
            "currency": "USD",
            "associateId": "",
            "fees": [],
            "appeasements": null,
            "returns": [],
            "taxCode": "200231531",
            "taxDetail": [
                {
                    "type": "CITY",
                    "value": 0.00
                },
                {
                    "type": "COUNTY",
                    "value": 0.00
                },
                {
                    "type": "STATE",
                    "value": 2.99
                },
                {
                    "type": "COUNTRY",
                    "value": 0.00
                },
                {
                    "type": "DISTRICT",
                    "value": 0.00
                },
                {
                    "type": "OTHER",
                    "value": 0.00
                }
            ],
            "discounts": [
                {
                    "quantity": 1,
                    "amount": 11.27,
                    "unit": null,
                    "value": 0.00,
                    "promoId": "promo30359324",
                    "promoCode": null,
                    "promoTitle": "Loyalty Offer",
                    "type": "Order",
                    "invoiceQuantity": 1,
                    "returnQuantity": 0,
                    "cancelQuantity": 0
                },
                {
                    "quantity": 1,
                    "amount": 2.88,
                    "unit": null,
                    "value": 5.00,
                    "promoId": "PASSPORT",
                    "promoCode": null,
                    "promoTitle": "Passport",
                    "type": "Order",
                    "invoiceQuantity": 1,
                    "returnQuantity": 0,
                    "cancelQuantity": 0
                },
                {
                    "quantity": 1,
                    "amount": 5.64,
                    "unit": null,
                    "value": 0.00,
                    "promoId": "promo31919319",
                    "promoCode": null,
                    "promoTitle": "BIRTHDAY ONLY",
                    "type": "Order",
                    "invoiceQuantity": 1,
                    "returnQuantity": 0,
                    "cancelQuantity": 0
                }
            ],
            "adjustments": [],
            "attributes": {
                "style": "570348729",
                "colorCode": "001",
                "colorDescription": "Black",
                "image": "https://www.fabric-demo.com/Product_Images/570348729_001.jpg?imgPolicy=domSmall",
                "title": "Knit Woven Mix Maxi Tank Dress",
                "productUrl": "https://www.fabric-demo.com/store/product/Knit-Woven-Mix-Maxi-Tank-Dress/570348729?color=001",
                "size": "2 (12/14-L)",
                "giftMessage": [
                    {
                        "giftTo": "",
                        "giftFrom": "",
                        "giftMessage": "",
                        "giftBox": "false",
                        "giftWrap": "false",
                        "giftBoxPrice": 0.00
                    }
                ],
                "isDonation": false,
                "isGiftCard": false,
                "isFinalSale": false,
                "effectiveTaxRate": 0.0550
            },
            "exchangeQuantity": 0,
            "refundAmount": -2.99,
            "cancelledAmount": 0.00,
            "lineOrderStatus": "SHIPPED",
            "gifting": false,
            "donation": false
        }
    ],
    "shipInfo": [
        {
            "shipToId": "sg12596229905",
            "taxCode": "200231531",
            "locationNum": "",
            "pickup": [],
            "shipToAddress": {
                "name": {
                    "first": "Debbie",
                    "middle": null,
                    "last": "Dionne"
                },
                "email": "Joe.madison@gmail.com",
                "phone": {
                    "number": "2075224290",
                    "type": "MOBILE"
                },
                "address1": "11 BERYL LOOP",
                "address2": "",
                "address3": "",
                "address4": null,
                "city": "TOPSHAM",
                "state": "ME",
                "country": "USA",
                "postalCode": "04086-3603",
                "type": null,
                "latitude": null,
                "longitude": null
            },
            "taxDetail": [
                {
                    "type": "CITY",
                    "value": 0.00
                },
                {
                    "type": "COUNTY",
                    "value": 0.00
                },
                {
                    "type": "STATE",
                    "value": 0.00
                },
                {
                    "type": "COUNTRY",
                    "value": 0.00
                },
                {
                    "type": "DISTRICT",
                    "value": 0.00
                },
                {
                    "type": "OTHER",
                    "value": 0.00
                }
            ],
            "discounts": [],
            "shipMethod": "Parcel Post Delivery",
            "shipToType": "SHIP_TO_ADDRESS",
            "shipToPrice": 0.00,
            "shipToDiscount": 0,
            "shipToTaxTotal": 0.00,
            "shipmentInstructions": null,
            "attributes": {
                "giftMessage": []
            },
            "isInvoiced": true
        },
        {
            "shipToId": "sg12593859245",
            "taxCode": "200231531",
            "locationNum": "",
            "pickup": [],
            "shipToAddress": {
                "name": {
                    "first": "Debbie",
                    "middle": null,
                    "last": "Dionne"
                },
                "email": "Joe.madison@gmail.com",
                "phone": {
                    "number": "2075224290",
                    "type": "MOBILE"
                },
                "address1": "11 BERYL LOOP",
                "address2": "",
                "address3": "",
                "address4": null,
                "city": "TOPSHAM",
                "state": "ME",
                "country": "USA",
                "postalCode": "04086-3603",
                "type": null,
                "latitude": null,
                "longitude": null
            },
            "taxDetail": [
                {
                    "type": "CITY",
                    "value": 0.00
                },
                {
                    "type": "COUNTY",
                    "value": 0.00
                },
                {
                    "type": "STATE",
                    "value": 0.00
                },
                {
                    "type": "COUNTRY",
                    "value": 0.00
                },
                {
                    "type": "DISTRICT",
                    "value": 0.00
                },
                {
                    "type": "OTHER",
                    "value": 0.00
                }
            ],
            "discounts": [],
            "shipMethod": "Parcel Post Delivery",
            "shipToType": "SHIP_TO_ADDRESS",
            "shipToPrice": 0.00,
            "shipToDiscount": 7.95,
            "shipToTaxTotal": 0.00,
            "shipmentInstructions": null,
            "attributes": {
                "giftMessage": []
            },
            "isInvoiced": true
        },
        {
            "shipToId": "sg12601324493",
            "taxCode": "200231531",
            "locationNum": "",
            "pickup": [],
            "shipToAddress": {
                "name": {
                    "first": "Joe",
                    "middle": null,
                    "last": "Madison"
                },
                "email": "Joe.madison@gmail.com",
                "phone": {
                    "number": "2075224290",
                    "type": "MOBILE"
                },
                "address1": "11 BERYL LOOP",
                "address2": "",
                "address3": "",
                "address4": null,
                "city": "TOPSHAM",
                "state": "ME",
                "country": "USA",
                "postalCode": "04086-3603",
                "type": null,
                "latitude": null,
                "longitude": null
            },
            "taxDetail": [
                {
                    "type": "CITY",
                    "value": 0.00
                },
                {
                    "type": "COUNTY",
                    "value": 0.00
                },
                {
                    "type": "STATE",
                    "value": 0.00
                },
                {
                    "type": "COUNTRY",
                    "value": 0.00
                },
                {
                    "type": "DISTRICT",
                    "value": 0.00
                },
                {
                    "type": "OTHER",
                    "value": 0.00
                }
            ],
            "discounts": [],
            "shipMethod": "Parcel Post Delivery",
            "shipToType": "SHIP_TO_ADDRESS",
            "shipToPrice": 0.00,
            "shipToDiscount": 0,
            "shipToTaxTotal": 0.00,
            "shipmentInstructions": null,
            "attributes": {
                "giftMessage": []
            },
            "isInvoiced": true
        }
    ],
    "auditLogs": [],
    "notes": [],
    "createdAt": "2023-03-24T07:22:24",
    "updatedAt": "2023-07-05T03:31:53"
  }
  ```
</Accordion>

### Step 2: Retrieve the `importId` and upload URL

The `oms-imports` endpoint is used to create the `importId` and returns a `uploadFileUrl`. The `uploadFileUrl` is used to upload the JSON file from [step 1](#step-1-create-the-json-file-containing-your-orders).

```Bash theme={null}
curl --location --request GET 'https://api.fabric.inc/api/v3/oms-imports' \
--header 'X-Fabric-Tenant-Id: {tenantId}' \
--header 'X-Fabric-Channel-Id: 12' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {authorizationToken}' \
--data '{
    "fileName": "C:/Users/Fabric/Downloads/example_order.json",
    "module": "ORDER",
    "type": "BULK"
}'
```

**Response**:

```Bash theme={null}
{
    "importId": "6650def0104f907ac98275de",
    "uploadFileUrl": "{AWS S3 Upload URL}",
    "fileName": "example_order.json",
    "module": "ORDER",
    "type": "BULK",
    "statusCode": "INITIATED",
    "createdAt": "2024-05-24T18:39:44Z",
    "updatedAt": "2024-05-24T18:39:44Z"
}
```

### Step 3: Upload the JSON file

Use the `uploadFileUrl` value, which is returned in [step 2](#step-2-retrieve-the-importid-and-upload-url), and send a **PUT** request with the template file.

Note: No authorization token is required for this step. If you use Postman, click the URL to automatically open the request in a new tab. Remember to change the request from GET to PUT and in the body of the request click the binary option followed by providing your inventory CSV file.

```Bash theme={null}
curl --location --request PUT '{AWS S3 upload URL}' \
--header 'Content-Type: application/json' \
--data '@/C:/Users/Fabric/Downloads/example_order.json'
```

A successful response returns a 200 status.

### Step 4: Check the status of the import

Ensure that you have the `importId` value from the response in [Step 2](#step-2-retrieve-the-importid-and-upload-url).

You can check your order upload status by making a GET request to the `oms-imports/{importId}` endpoint.

**GET Request**:

```Bash theme={null}
curl --location --request GET 'https://api.fabric.inc/api/v3/oms-imports/{importId}' \
--header 'x-fabric-tenant-id: {tenantId}' \
--header 'x-fabric-channel-id: 12' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {authorizationToken}'
```

**Response**:

Depending on the number of orders being imported, this process can take up to 20 minutes to complete. Batches of up to 1 million imports are supported at a time. The `statusCode` value is set to **INITIATED** until the process completes.

```JSON theme={null}
{
    "importId": "6670898e85d8c162c403f4d3",
    "fileName": "example_order_2.json",
    "module": "ORDER",
    "type": "BULK",
    "statusCode": "COMPLETED",
    "createdAt": "2024-06-17T19:07:58Z",
    "updatedAt": "2024-06-17T19:11:30Z",
    "originalFileUrl": "{AWS S3 Upload URL}"
}
```

### Step 5: Use the order number to retrieve an order

To verify the orders are imported, make a GET request to the `orders/order-number/{orderNumber}` endpoint using one of the imported order numbers.

**Request**:

```BASH theme={null}
curl --location --request GET 'https://api.fabric.inc/api/v3/orders/order-number/{orderNumber}' \
--header 'x-fabric-tenant-id: {tenantId}' \
--header 'x-fabric-channel-id: 12' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {authorizationToken}'
```

A successful response returns a 200 status with an order object in the payload.

## Related Resources

* [Developer Guide Overview](/v3/orders-and-inventory/api-reference/orders/developer-guide/overview)
* [Inventory Setup Guide](/v3/orders-and-inventory/api-reference/orders/developer-guide/inventory-setup)
* [Product Catalog Developer Guide](/v3/product-catalog/api-reference/product-catalog/developer-guide/introduction)
* [Counters API Endpoint](/v3/orders-and-inventory/api-reference/inventory/counters/overview)
* [Locations API Endpoint](/v3/orders-and-inventory/api-reference/inventory/locations/overview)
* [Inventory API Endpoint](/v3/orders-and-inventory/api-reference/inventory/inventory/overview)
