# Order Item API Reference

Endpoint:

https://[client].hiweb.io/api/order_items

Order item object:

{
	"type": "order_items",
	"id": "(string)",
	"attributes": {
		"grams": (float),
		"quantity": (integer),
		"price": (float),
		"discount": (float),
		"total_price": (float),
		"captured_data": {
			"product": {
				"type": "products",
				"id": "...",
				"attributes": {
					...
				}
			},
			"variant": {
				"type": "variants",
				"id": "...",
				"attributes": {
					...
				}
			}
		},
		"custom_data": {Object|Array},
		"note": "string",
		"created_at": "string|datetime",
		"updated_at": "string|datetime"
	},
	"relationships": {
		"order": {
			"data": Object [Order Resource]
		}
	}
}

Related resources: Order, Fulfillment, Discount

# Writable fields

Field name Creating Updating
price numeric|>=0 numeric|>=0
grams numeric|>=0 numeric|>=0
quantity required|integer|min:1 integer|min:1
discount numeric|>=0 numeric|>=0
captured_data array array
custom_data object|array object|array
note string|min:1|max:255 string|min:1|max:255

# Writable relationships

Relationship name Relationship resource type Type Creating Updating
order orders To-one Yes - Required No