← Back to API Reference
/order_items
Tag: order_items
getThe items in an order
Parameters
| Name | In | Type | Format | Required | Description |
|---|---|---|---|---|---|
id | query | string | — | — | — |
order_id | query | string | — | — | The order the item is for |
product_id | query | string | — | — | The product ID for the item |
variant_id | query | string | — | — | The variant ID for the item |
price_amount | query | string | — | — | The price amount for the item |
quantity | query | string | — | — | The quantity of the item |
created_at | query | string | — | — | The creation date of the item |
updated_at | query | string | — | — | The last update date of the item |
select | query | string | — | — | Filtering Columns |
order | query | string | — | — | Ordering |
Range | header | string | — | — | Limiting and Pagination |
Range-Unit | header | string | — | — | Limiting and Pagination |
offset | query | string | — | — | Limiting and Pagination |
limit | query | string | — | — | Limiting and Pagination |
Prefer | header | string | — | — | Preference |
Example
bash
curl "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/order_items?select=*&limit=10" \
-H "apikey: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Responses
200OK
206Partial Content
postThe items in an order
Parameters
| Name | In | Type | Format | Required | Description |
|---|---|---|---|---|---|
order_items | body | object | — | — | order_items |
select | query | string | — | — | Filtering Columns |
Prefer | header | string | — | — | Preference |
Example
bash
curl -X POST "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/order_items" \
-H "apikey: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '{
"order_id": "example",
"product_id": "example",
"variant_id": "example",
"quantity": 0
}'Responses
201Created
patchThe items in an order
Parameters
| Name | In | Type | Format | Required | Description |
|---|---|---|---|---|---|
id | query | string | — | — | — |
order_id | query | string | — | — | The order the item is for |
product_id | query | string | — | — | The product ID for the item |
variant_id | query | string | — | — | The variant ID for the item |
price_amount | query | string | — | — | The price amount for the item |
quantity | query | string | — | — | The quantity of the item |
created_at | query | string | — | — | The creation date of the item |
updated_at | query | string | — | — | The last update date of the item |
order_items | body | object | — | — | order_items |
Prefer | header | string | — | — | Preference |
Example
bash
curl -X PATCH "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/order_items?id=eq.YOUR_ID" \
-H "apikey: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '{"order_id": "example"}'Responses
204No Content
deleteThe items in an order
Parameters
| Name | In | Type | Format | Required | Description |
|---|---|---|---|---|---|
id | query | string | — | — | — |
order_id | query | string | — | — | The order the item is for |
product_id | query | string | — | — | The product ID for the item |
variant_id | query | string | — | — | The variant ID for the item |
price_amount | query | string | — | — | The price amount for the item |
quantity | query | string | — | — | The quantity of the item |
created_at | query | string | — | — | The creation date of the item |
updated_at | query | string | — | — | The last update date of the item |
Prefer | header | string | — | — | Preference |
Example
bash
curl -X DELETE "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/order_items?id=eq.YOUR_ID" \
-H "apikey: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Responses
204No Content
Schema
The items in an order
| Column | Type | Format | Nullable | Default | Notes |
|---|---|---|---|---|---|
idPK | string | text | — | — | This is a Primary Key. |
order_id | string | text | — | — | FK → orders.id |
product_id | string | text | — | — | The product ID for the item |
variant_id | string | text | — | — | The variant ID for the item |
price_amount | number | numeric | ✓ | — | The price amount for the item |
quantity | integer | integer | — | 1 | The quantity of the item |
created_at | string | timestamp with time zone | — | CURRENT_TIMESTAMP | The creation date of the item |
updated_at | string | timestamp with time zone | — | CURRENT_TIMESTAMP | The last update date of the item |