List all line items
How to fetch a collection of line items via API
To fetch a collection of line items, send a GET
request to the /api/line_items
endpoint.
Request
GET https://yourdomain.commercelayer.io/api/line_items
Example
The following request fetches a collection of line items:
curl -g -X GET \
'https://yourdomain.commercelayer.io/api/line_items/' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token'
Remember that when you fetch a list of resources you get paginated result.
Sortable fields
The list of line items can be sorted by the following fields:
Attributes
currency_code
unit_amount_cents
compare_at_amount_cents
options_amount_cents
discount_cents
total_amount_cents
tax_amount_cents
name
item_type
id
circuit_state
circuit_failure_count
created_at
updated_at
reference
reference_origin
Relationships
order
Filterable fields
The list of line items can be filtered by the following fields:
Attributes
sku_code
quantity
currency_code
unit_amount_cents
compare_at_amount_cents
options_amount_cents
discount_cents
total_amount_cents
tax_amount_cents
name
image_url
item_type
id
circuit_state
circuit_failure_count
created_at
updated_at
reference
reference_origin
metadata
Relationships
order
sku
bundle
adjustment
gift_card
shipment
payment_method
line_item_options
return_line_items
stock_reservations
stock_line_items
stock_transfers
notifications
events
tags
Last updated