E-commerce

E-commerce Order JSON Example

A detailed JSON example for an e-commerce order — covers line items, shipping address, payment status, and totals. Ideal for online store APIs and order management systems. Copy-ready.

{
  "id": "ord_7TnVqRx2kL",
  "customerId": "usr_9k2mXpQr4t",
  "status": "processing",
  "currency": "INR",
  "lineItems": [
    {
      "productId": "prod_A1B2C3D4",
      "sku": "TSHIRT-BLU-L",
      "name": "Classic Cotton T-Shirt (Blue, L)",
      "quantity": 2,
      "unitPrice": 599,
      "discount": 59.9,
      "subtotal": 1138.1
    },
    {
      "productId": "prod_E5F6G7H8",
      "sku": "JEANS-BLK-32",
      "name": "Slim Fit Jeans (Black, 32)",
      "quantity": 1,
      "unitPrice": 1499,
      "discount": 0,
      "subtotal": 1499
    }
  ],
  "subtotal": 2637.1,
  "taxAmount": 475,
  "shippingCost": 99,
  "discountTotal": 59.9,
  "grandTotal": 3151.2,
  "shippingAddress": {
    "name": "Ravi Mehta",
    "street": "42, Shyamal Cross Road",
    "city": "Ahmedabad",
    "state": "Gujarat",
    "postalCode": "380015",
    "country": "IN",
    "phone": "+91-98765-43210"
  },
  "payment": {
    "method": "upi",
    "status": "paid",
    "transactionId": "txn_UPI20250501XYZ",
    "paidAt": "2025-05-01T10:35:00Z"
  },
  "notes": "Please leave at door if not home.",
  "createdAt": "2025-05-01T10:30:00Z",
  "updatedAt": "2025-05-01T11:00:00Z"
}

Field Reference

idstringrequiredUnique order identifier with ord_ prefix
customerIdstringrequiredReference to the user who placed the order
statusstringrequiredOrder lifecycle state: pending, processing, shipped, delivered, cancelled
lineItemsarray<object>requiredList of products ordered, each with quantity and pricing
grandTotalnumberrequiredFinal amount charged after tax, shipping, and discounts
shippingAddressobjectrequiredDelivery address including recipient name and phone
paymentobjectrequiredPayment method, status, and transaction reference
currencystringrequiredISO 4217 currency code (e.g. INR, USD, EUR)

Variants

MinimalA single-item order with only essential fields populated.
{
  "id": "ord_2SmPwBv9nJ",
  "customerId": "usr_3hFwLmNz8q",
  "status": "pending",
  "currency": "INR",
  "lineItems": [
    {
      "productId": "prod_A1B2C3D4",
      "sku": "TSHIRT-BLU-L",
      "name": "Classic Cotton T-Shirt (Blue, L)",
      "quantity": 1,
      "unitPrice": 599,
      "discount": 0,
      "subtotal": 599
    }
  ],
  "subtotal": 599,
  "taxAmount": 107.82,
  "shippingCost": 99,
  "discountTotal": 0,
  "grandTotal": 805.82,
  "shippingAddress": {
    "name": "Priya Sharma",
    "street": "15, Vesu Main Road",
    "city": "Surat",
    "state": "Gujarat",
    "postalCode": "395007",
    "country": "IN",
    "phone": "+91-99887-76655"
  },
  "payment": {
    "method": "cod",
    "status": "pending",
    "transactionId": null,
    "paidAt": null
  },
  "createdAt": "2025-05-10T09:00:00Z",
  "updatedAt": "2025-05-10T09:00:00Z"
}
ExtendedMulti-item order with coupon, tracking info, and fulfilment details.
Extended
{
  "id": "ord_7TnVqRx2kL",
  "customerId": "usr_9k2mXpQr4t",
  "status": "shipped",
  "currency": "INR",
  "couponCode": "SUMMER10",
  "lineItems": [
    {
      "productId": "prod_A1B2C3D4",
      "sku": "TSHIRT-BLU-L",
      "name": "Classic Cotton T-Shirt (Blue, L)",
      "quantity": 2,
      "unitPrice": 599,
      "discount": 59.9,
      "subtotal": 1138.1
    },
    {
      "productId": "prod_E5F6G7H8",
      "sku": "JEANS-BLK-32",
      "name": "Slim Fit Jeans (Black, 32)",
      "quantity": 1,
      "unitPrice": 1499,
      "discount": 0,
      "subtotal": 1499
    }
  ],
  "subtotal": 2637.1,
  "taxAmount": 475,
  "shippingCost": 0,
  "discountTotal": 263.71,
  "grandTotal": 2848.39,
  "shippingAddress": {
    "name": "Ravi Mehta",
    "street": "42, Shyamal Cross Road",
    "city": "Ahmedabad",
    "state": "Gujarat",
    "postalCode": "380015",
    "country": "IN",
    "phone": "+91-98765-43210"
  },
  "payment": {
    "method": "upi",
    "status": "paid",
    "transactionId": "txn_UPI20250501XYZ",
    "paidAt": "2025-05-01T10:35:00Z"
  },
  "shipping": {
    "carrier": "Delhivery",
    "trackingNumber": "DLVY2025050199887",
    "estimatedDelivery": "2025-05-05T18:00:00Z",
    "shippedAt": "2025-05-02T08:00:00Z"
  },
  "notes": "Please leave at door if not home.",
  "createdAt": "2025-05-01T10:30:00Z",
  "updatedAt": "2025-05-02T08:05:00Z"
}

Common Use Cases

  • Building the order confirmation response for a POST /orders REST endpoint
  • Generating order summary emails and PDF receipts
  • Syncing order data to an ERP or warehouse management system
ordere-commerceshoppingpaymentline items

Validate or format this JSON

Paste the example above into JSONKit's tools to validate, minify, or explore the structure interactively.

Frequently Asked Questions

Store monetary values as numbers (float/decimal), but be aware of floating-point precision issues. Many payment APIs use integer cents (e.g. 159920 for ₹1599.20) to avoid rounding errors.

Common statuses are: pending, processing, shipped, delivered, cancelled, and refunded. Use a consistent string enum and document transitions in your API spec.

Include a taxAmount field at the order level and optionally a taxRate per line item. For multi-jurisdiction tax, use a taxes array with breakdown by type (GST, VAT, etc.).

Related JSON Examples