Skip to main content
Aarunya AppsAarunya Apps

Shopify Order Webhook TypeScript Types (orders/create)

TypeScript interfaces for the Shopify orders/create webhook. Use these types to handle new order events in your Shopify app or integration.

Shopify Order — Sample JSON

{
  "id": 820982911946154,
  "name": "#9999",
  "number": 234,
  "order_number": 1234,
  "email": "jon@example.com",
  "created_at": "2024-01-10T11:00:00-05:00",
  "updated_at": "2024-01-10T11:00:00-05:00",
  "financial_status": "paid",
  "fulfillment_status": null,
  "currency": "USD",
  "total_price": "49.99",
  "subtotal_price": "49.99",
  "total_tax": "0.00",
  "total_discounts": "0.00",
  "total_line_items_price": "49.99",
  "phone": "+15142546011",
  "note": null,
  "test": false,
  "cancel_reason": null,
  "cancelled_at": null
}

Generated TypeScript

export interface ShopifyOrder {
  id: number;
  name: string;
  number: number;
  order_number: number;
  email: string;
  created_at: string;
  updated_at: string;
  financial_status: string;
  fulfillment_status: null | null;
  currency: string;
  total_price: string;
  subtotal_price: string;
  total_tax: string;
  total_discounts: string;
  total_line_items_price: string;
  phone: string;
  note: null | null;
  test: boolean;
  cancel_reason: null | null;
  cancelled_at: null | null;
}

How to use

Copy the TypeScript above into a types.ts file in your project. Import the root interface and use it to type your API responses: const data: ShopifyOrder = await res.json()

Working with a different JSON payload? Paste any JSON and generate TypeScript interfaces instantly.

Convert your own JSON →

FAQ

How do I verify that a Shopify webhook is genuine?

Shopify includes an X-Shopify-Hmac-SHA256 header with each webhook. Compute HMAC-SHA256 of the raw request body using your webhook secret as the key, then base64-encode the result. If it matches the header value, the request is authentic.

Why are price fields strings instead of numbers in Shopify webhooks?

Shopify uses strings for monetary values to preserve precision across different locales and avoid floating-point rounding errors. Always treat them as decimal strings and use a library like Decimal.js for arithmetic — don't parseFloat() money values.

What is the difference between financial_status and fulfillment_status?

financial_status tracks payment (pending, authorized, paid, refunded, voided). fulfillment_status tracks shipping (null = not fulfilled, partial, fulfilled). An order can be paid (financial_status: 'paid') but not yet shipped (fulfillment_status: null).

Powered by Aarunya Apps