Orders
Order properties
| Property | Description |
|---|---|
| id | Depending on the webshop, the id is a number (4312) or uid |
| status | The satus depends on your settings done payment_needed |
type Order = {
id: ID;
reference: string;
type: "customer" | "admin" | "api";
status: string;
currency: string;
customer: Customer;
shipping_address: Address;
billing_address?: Address; // if no billing address is present shipping is used
total: string | number;
note: string;
line_items: LineItem[];
// tax // shipping coupon ect
created_at: Date | string;
updated_at: Date | string;
tags?: string;
device_metadata?: any;
metadata?: any;
};
type Customer = {
id: ID;
email: string;
phone: string;
first_name: string;
last_name: string;
created_at: Date | string;
updated_at: Date | string;
addresses?: Address[];
metadata: any;
};
type Address = {
id: ID;
type: "default" | "shipping" | "billing";
customer_id: string;
customer: Customer;
line1: string;
line2?: string;
housenumber?: string;
street?: string;
city: string;
postal_code: string;
state?: string;
country: string;
name?: string; // fallback: customer name
email?: string; // fallback: customer email
created_at: Date | string;
updated_at: Date | string;
metadata: any;
};
type LineItem = {
id: ID;
product_id?: ID;
variant_id?: ID;
sku: string;
name: string;
price: string;
quantity: number;
};
Endpoints
Create an order
POST
/orders Update an order
PUT
/orders/:id Delete an order
DELETE
/orders/:id List all Orders
GET
/orders Search Orders
GET
/orders/search Count Orders & Status
GET
/orders/count GET
/orders/count-per-status GET
/orders/count-per-status Find Order
GET
/orders/:id Examples
Get all orders with status 'new'
GET
/orders?status=new