Order Fulfillment

fabric’s Order service simplifies complex order management and fulfillment processes after order is created either by using any checkout service or at Point of Sale (POS).

Order service lets merchants create a unified commerce experience by importing all orders in real time to a single application, and use fabric Order endpoints for order creation, initiate post-order process workflows, and manage order related data, such as set estimated delivery date, ship-by date, fulfillment location information to view what facility orders were allocated for fulfillment, and many more. Order service also lets merchants cancel, return, exchange order cancellation, returns, exchanges, appeasements, invoicing, shipment, tracking, backorders, and other use cases.

Workflow

The following provides a basic workflow of fabric Order service for the orders created using a checkout service:

  1. Merchants create an Order and upload Order details to fabric OMS after shoppers complete the payment process at checkout stage.
  2. fabric OMS sends notification for different order updates, using the Notification APIs of fabric OMS, to shoppers and merchants.
  3. fabric Order allocates the order, using allocation APIs, to the shopper's nearest warehouse or facility for inventory confirmation, and shipping of product.
  4. Order is then picked, packed, and shipped.
  5. Merchant and shopper are notified of the delivery being shipped.
  6. The order completes its journey at the shopper’s delivery address.

Set up Order Tracking for an Order Created Using a Checkout Service

After an order is created, for the order to drop to the warehouse, you must set up webhook subscriptions to OMS events for better order management.

  1. Set up webhook subscription to OMS events
  2. Create order and upload to fabric OMS
  3. Integrate OMS with Warehouse Management System (WMS)
  4. Integrate OMS with fraud service
  5. Create shipment for the allocations

Step 1: Set up webhook subscription to OMS events

Use webhook endpoint (POST/api/v2/webhook) to set up webhook subscriptions to various order events so that when an order is created or updated, fabric OMS automatically starts the post-order processes, and sends notifications for the subscribed events.

Once an order is allocated to a warehouse, the webhook that you have set up sends notification mentioning an allocation ID.

Follwing is a curl example for subscribing to allocation events:

curl --location --request POST 'https://uat01.oms.fabric.inc/api/v2/webhook' \
--header 'Authorization: Bearer {token}' \
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "target": "https://webhook.site/83834d4c-9736-4cba-b32b-e6b6d75a6683",
    "protocol": "HTTP",
    "source": "ORDER_SERVICE", // This will change based on service to be subscribed
    "apiVersion": "1.0.0",
    "format": "application/json",
    "requestType": "POST",
    "events": [
        "ORDER_CREATE"
        "ORDER_SHIPPED" // List of events to subscribe
    ]
}'

To subscribe to any other OMS events, mention the respective source name and events that you want to subscribe for. For details, see List of Webhook Events.

Step 2: Create Order and Upload to fabric OMS

Use POST/api/v2/order endpoint to create an order through any integrated checkout service that you are using.

  • The orderNumber field that is passed during order creation is a string.
  • For Cash On Delivery (COD) orders, provide paymentMethod as ‘CASH ON DELIVERY’, and chargedAmount as ‘0’ under the payment object while creating an order.

Request Sample

{
  "orderNumber": "309019176",
  "orderDate": "2022-05-12T09:30:31.198Z",
  "channelId": "12",
  "cartId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
  "type": "WEB",
  "subType": "International",
  "employeeId": "43278",
  "retail": {
    "locationNum": 123,
    "cashierId": "C-123",
    "registerId": "113",
    "transactionId": "R123-431-1133-2129"
  },
  "orderSubTotal": 123.45,
  "orderDiscount": 1.23,
  "feeTotal": 12.34,
  "taxTotal": 12.34,
  "orderTotal": 146.9,
  "currency": "USD",
  "statusCode": "ORDER_CREATED",
  "statusDescription": "Order created",
  "attributes": {
    "additionalProp1": {
      "purchaseOrder": "String",
      "salesRepId": "String",
      "approver": "String",
      "fraudCheckSessionId": "aee6d1face0e4d55948d1e30b6240048",
      "fraudCheckStatus": "UPDATED",
      "fraudCheckTransId": "KKMH0R12TQ46",
      "fraudScore": "31"
    }
  },
  "fees": [
    {
      "type": "shipping",
      "value": 34.56,
      "invoiceValue": 34.56
    }
  ],
  "discounts": [
    {
      "quantity": 2,
      "amount": 2.4,
      "unit": "AMOUNT_OFF",
      "value": 2,
      "promoId": "HNY2022",
      "promoCode": "HNY2022",
      "promoTitle": "Happy New Year",
      "type": "promotion"
    }
  ],
  "customer": {
    "name": {
      "first": "John",
      "middle": "Middle",
      "last": "Doe"
    },
    "email": "john@fabric.inc",
    "phone": {
      "number": "55555555555",
      "type": "MOBILE"
    },
    "userId": "62272e917b12209e68751d94",
    "accountId": "62272e917b12209e68751d94",
    "employeeId": "62272e917b12209e68751d94",
    "company": "fabric"
  },
  "payments": [
    {
      "paymentCounter": 1,
      "paymentDate": "2022-01-27T16:15:58-05:00",
      "billToId": "62272e917b12209e68751d94",
      "paymentIdentifier": {
        "cardIdentifier": "3456",
        "expirationYear": "2029",
        "expirationMonth": "02",
        "paymentId": "62272e917b12209e68751d94",
        "fabricPaymentReference": "fab3456"
      },
      "paymentProvider": "stripe",
      "paymentToken": {
        "token": "pi_34tr6787rt",
        "paymentType": "VISA"
      },
      "paymentMethod": "CREDIT_CARD",
      "authAmount": 123.45,
      "chargedAmount": 60,
      "currency": "USD",
      "conversion": 1,
      "paymentStatus": "AUTHORIZED",
      "authExpirationDate": "2022-01-27T16:15:58-05:00",
      "billToAddress": {
        "name": {
          "first": "John",
          "middle": "Middle",
          "last": "Doe"
        },
        "email": "john123@gmail.com",
        "phone": {
          "number": "55555555555",
          "type": "MOBILE"
        },
        "address1": "First line of address",
        "address2": "123 Parking Lot",
        "address3": "Third line of address",
        "address4": "Fourth line of address",
        "city": "Beaumont",
        "state": "TX",
        "country": "USA",
        "postalCode": "77705",
        "type": "residence",
        "latitude": 35.294952,
        "longitude": 32.294952
      },
      "attributes": {
        "expirationMonth": 12
      }
    }
  ],
  "items": [
    {
      "lineItemId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
      "lineItemNumber": 1,
      "itemId": "1234",
      "sku": "P1234",
      "channelId": "WHBM",
      "segment": "P1234",
      "vendorId": "P1234",
      "title": "Item",
      "type": "WEB_SHIP",
      "subType": "Borderfree",
      "backorder": true,
      "orderedQuantity": 60,
      "uom": "EA",
      "shipToId": "b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569",
      "itemUnitPrice": 10,
      "itemSubTotal": 600,
      "itemFeeTotal": 5,
      "itemDiscountsTotal": 55,
      "itemTaxTotal": 5,
      "itemTotal": 555,
      "currency": "USD",
      "employeeId": "5345HJH",
      "associateId": "5345HJH",
      "fees": [
        {
          "type": "tax",
          "value": 34.56
        }
      ],
      "taxCode": "FR01",
      "taxDetail": [
        {
          "type": "tax",
          "value": 34.56
        }
      ],
      "discounts": [
        {
          "quantity": 2,
          "amount": 2.4,
          "unit": "AMOUNT_OFF",
          "value": 2,
          "promoId": "HNY2022",
          "promoCode": "HNY2022",
          "promoTitle": "Happy New Year",
          "type": "promotion"
        }
      ],
      "attributes": {
        "isDonation": true,
        "isGiftCard": false,
        "isFinalSale": false,
        "returnsLink": true
      },
      "notes": [
        {
          "timestamp": "2022-05-12T09:30:31.198Z",
          "user": "62272e917b12209e68751d94",
          "notes": "Extra information to be provided"
        }
      ]
    }
  ],
  "shipInfo": [
    {
      "shipToId": "5349b4ddd2781d08c09890f4",
      "taxCode": "FR01",
      "locationNum": "123",
      "pickup": [
        {
          "name": {
            "first": "John",
            "middle": "Middle",
            "last": "Doe"
          },
          "email": "john123@gmail.com",
          "phone": {
            "number": "55555555555",
            "type": "MOBILE"
          },
          "pickupType": "Primary"
        }
      ],
      "shipToAddress": {
        "name": {
          "first": "John",
          "middle": "Middle",
          "last": "Doe"
        },
        "email": "john123@gmail.com",
        "phone": {
          "number": "55555555555",
          "type": "MOBILE"
        },
        "address1": "First line of address",
        "address2": "123 Parking Lot",
        "address3": "Third line of address",
        "address4": "Fourth line of address",
        "city": "Beaumont",
        "state": "TX",
        "country": "USA",
        "postalCode": "77705",
        "type": "residence",
        "latitude": 35.294952,
        "longitude": 32.294952
      },
      "taxDetail": [
        {
          "type": "tax",
          "value": 34.56
        }
      ],
      "shipMethod": "Express Delivery",
      "shipToType": "SHIP_TO_ADDRESS",
      "estimatedShipDate": "2022-05-12T09:30:31.198Z",
      "estimatedDeliveryDate": "2022-05-12T09:30:31.198Z",
      "shipToPrice": 20,
      "shipToDiscount": 12.6,
      "shipToTaxTotal": 12.6,
      "shipmentInstructions": "User instructions",
      "attributes": {
        "isOpenBox": false,
        "isOTPDElivery": true
      }
    }
  ],
  "notes": [
    {
      "timestamp": "2022-05-12T09:30:31.198Z",
      "user": "62272e917b12209e68751d94",
      "notes": "Extra information to be provided"
    }
  ]
}

Step 3: Integrate OMS with Warehouse Management System (WMS)

Integrate OMS with the WMS that you use to check the movement of inventory to fulfill orders. By integrating OMS with WMS, you allow the WMS to listen to allocation events that you created in the first step. Based on the shopper's location, fabric OMS allocates order to the nearest warehouse. To integrate OMS with the WMS you use, either:

  1. You (retailers) develop the integration software to communicate with fabric OMS, and maintain the integration layer on your own.
  2. Or, you (retailers) use a third party integration software that is developed to communicate with fabric OMS. For example, Bascom develops integration software for fabric OMS.

Step 4: Integrate OMS with Fraud Service

Use fraud endpoints to integrate OMS with Fraud service

Step 5: Create Shipment for the Allocations

Configure integration service with fabric OMS in such a way that integration service uses the create shipment endpoint (POST/api/v2/shipment) to ship the order to the shopper's address after a warehouse is allocated with order details.

Optional Steps:

Search orders or allocation for additional information.

Get Allocations by OrderId

You can get all the allocations documents by OrderID

curl example:

curl --location --request POST 'https://uat01.oms.fabric.inc/api/v2/allocation/query' \
--header 'Authorization: {{accessToken}}' \
--header 'x-site-context: {"account":"63310842f37ee100111e9fe3"}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "filters": {
       "items.orderId":"6376483e1c259b33815d6e2e"
    }
}'

Search Orders by AllocationId

Use POST/{allocationId} endpoint to get order details by allocationId.