← Back to API Reference

/order_items

Tag: order_items

getThe items in an order

Parameters

NameInTypeFormatRequiredDescription
idquerystring
order_idquerystringThe order the item is for
product_idquerystringThe product ID for the item
variant_idquerystringThe variant ID for the item
price_amountquerystringThe price amount for the item
quantityquerystringThe quantity of the item
created_atquerystringThe creation date of the item
updated_atquerystringThe last update date of the item
selectquerystringFiltering Columns
orderquerystringOrdering
RangeheaderstringLimiting and Pagination
Range-UnitheaderstringLimiting and Pagination
offsetquerystringLimiting and Pagination
limitquerystringLimiting and Pagination
PreferheaderstringPreference

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

NameInTypeFormatRequiredDescription
order_itemsbodyobjectorder_items
selectquerystringFiltering Columns
PreferheaderstringPreference

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

NameInTypeFormatRequiredDescription
idquerystring
order_idquerystringThe order the item is for
product_idquerystringThe product ID for the item
variant_idquerystringThe variant ID for the item
price_amountquerystringThe price amount for the item
quantityquerystringThe quantity of the item
created_atquerystringThe creation date of the item
updated_atquerystringThe last update date of the item
order_itemsbodyobjectorder_items
PreferheaderstringPreference

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

NameInTypeFormatRequiredDescription
idquerystring
order_idquerystringThe order the item is for
product_idquerystringThe product ID for the item
variant_idquerystringThe variant ID for the item
price_amountquerystringThe price amount for the item
quantityquerystringThe quantity of the item
created_atquerystringThe creation date of the item
updated_atquerystringThe last update date of the item
PreferheaderstringPreference

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

ColumnTypeFormatNullableDefaultNotes
idPK
stringtextThis is a Primary Key.
order_id
stringtextFK → orders.id
product_id
stringtextThe product ID for the item
variant_id
stringtextThe variant ID for the item
price_amount
numbernumericThe price amount for the item
quantity
integerinteger1The quantity of the item
created_at
stringtimestamp with time zoneCURRENT_TIMESTAMPThe creation date of the item
updated_at
stringtimestamp with time zoneCURRENT_TIMESTAMPThe last update date of the item