Certified Checkout Flow

Convert a validated cart into an order and track it to completion, entirely through the API.

πŸ”’ Certified Partners only. Creating orders and processing payments through the API is restricted to certified partners. If you are not certified, use the Checkout Handoff instead β€” it needs no certification and hands the shopper to Blaze-hosted checkout with the cart intact. To apply for certification, contact your Blaze account manager or ecomsupport@blaze.me. Full list of restricted operations: Access Tiers.

What you'll build

Picking up from the Cart Flow example, where the cart was built and validated:

  1. Creates an order from the validated cart
  2. Checks order status
  3. Refreshes the order status from the POS

Prerequisites


Setup

All examples use these constants:

STORE_UUID="e87437f2-3e35-4738-af5e-6307e368255c"
BASE_URL="https://ecom-api.staging.blaze.me"
TOKEN="YOUR_JWT_TOKEN"
CART_UUID="YOUR_VALIDATED_CART_UUID"
const STORE_UUID = "e87437f2-3e35-4738-af5e-6307e368255c";
const BASE_URL = "https://ecom-api.staging.blaze.me";
const TOKEN = "YOUR_JWT_TOKEN";
const CART_UUID = "YOUR_VALIDATED_CART_UUID";

Step 1: Create an Order (Checkout)

After validation passes, create an order by referencing the cart UUID.

POST /api/v4/orders

cURL

curl -X POST "$BASE_URL/api/v4/orders" \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: $STORE_UUID" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "data": {
      "type": "orders",
      "attributes": {
        "cart_uuid": "CART_UUID"
      }
    }
  }'

JavaScript

const orderRes = await fetch(`${BASE_URL}/api/v4/orders`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    data: {
      type: "orders",
      attributes: {
        cart_uuid: cartId,
      },
    },
  }),
});

const { data: order } = await orderRes.json();
const orderId = order.id;
console.log(`Order created: ${orderId}`);
console.log(`Status: ${order.attributes.status}`);

Response

{
  "data": {
    "id": "order-uuid",
    "type": "orders",
    "attributes": {
      "uuid": "order-uuid",
      "status": "pending",
      "subtotal": 90.00,
      "total": 89.55,
      "tax": 8.55,
      "delivery_specification": "delivery",
      "items": [
        {
          "id": "item-b-uuid",
          "product_id": "PRODUCT_B_UUID",
          "quantity": 3,
          "price": 30.00,
          "name": "Sour Diesel"
        }
      ]
    }
  }
}

Step 2: Check Order Status

GET /api/v1/orders/{uuid}

cURL

curl -X GET "$BASE_URL/api/v1/orders/ORDER_UUID" \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: $STORE_UUID" \
  -H "Authorization: Bearer $TOKEN"

JavaScript

const statusRes = await fetch(`${BASE_URL}/api/v1/orders/${orderId}`, {
  headers,
});

const { data: orderDetail } = await statusRes.json();
console.log(`Order ${orderDetail.id}`);
console.log(`Status: ${orderDetail.attributes.status}`);
console.log(`Total: $${orderDetail.attributes.total}`);

Step 3: Refresh Order Status

If the order status is managed by the POS, force a status refresh from the external system.

PATCH /api/v1/orders/{uuid}/refresh-status

cURL

curl -X PATCH "$BASE_URL/api/v1/orders/ORDER_UUID/refresh-status" \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: $STORE_UUID" \
  -H "Authorization: Bearer $TOKEN"

JavaScript

const refreshRes = await fetch(
  `${BASE_URL}/api/v1/orders/${orderId}/refresh-status`,
  {
    method: "PATCH",
    headers,
  }
);

const { data: refreshed } = await refreshRes.json();
console.log(`Refreshed status: ${refreshed.attributes.status}`);


Complete Flow Summary

POST   /api/v4/orders                        β†’ Create order from validated cart
GET    /api/v1/orders/{uuid}                 β†’ Check order status
PATCH  /api/v1/orders/{uuid}/refresh-status  β†’ Refresh from POS

What's Next?