Orders
In Lemon Squeezy, an order is created when a customer purchases a product.
An order belongs to a Store, is associated with a Customer and can have many Order Items, Subscriptions, License Keys and Discount Redemptions.
The order object
Attributes
store_id
The ID of the store this order belongs to.
customer_id
The ID of the customer this order belongs to.
identifier
The unique identifier (UUID) for this order.
order_number
An integer representing the sequential order number for this store.
user_name
The full name of the customer.
user_email
The email address of the customer.
currency
The ISO 4217 currency code for the order (e.g. USD
, GBP
, etc).
currency_rate
If the order currency is USD, this will always be 1.0
. Otherwise, this is the currency conversion rate used to determine the cost of the order in USD at the time of purchase.
subtotal
A positive integer in cents representing the subtotal of the order in the order currency.
discount_total
A positive integer in cents representing the total discount value applied to the order in the order currency.
tax
A positive integer in cents representing the tax applied to the order in the order currency.
total
A positive integer in cents representing the total cost of the order in the order currency.
subtotal_usd
A positive integer in cents representing the subtotal of the order in USD.
discount_total_usd
A positive integer in cents representing the total discount value applied to the order in USD.
tax_usd
A positive integer in cents representing the tax applied to the order in USD.
total_usd
A positive integer in cents representing the total cost of the order in USD.
tax_name
If tax is applied to the order, this will be the name of the tax rate (e.g. VAT
, Sales Tax
, etc).
tax_rate
If tax is applied to the order, this will be the rate of tax as a decimal percentage.
status
The status of the order. One of pending
, failed
, paid
, refunded
.
status_formatted
The formatted status of the order.
refunded
Has the value true
if the order has been refunded.
refunded_at
If the order has been refunded, this will be an ISO-8601 formatted date-time string indicating when the order was refunded.
subtotal_formatted
A human-readable string representing the subtotal of the order in the order currency (e.g. $9.99).
discount_total_formatted
A human-readable string representing the total discount value applied to the order in the order currency (e.g. $9.99).
tax_formatted
A human-readable string representing the tax applied to the order in the order currency (e.g. $9.99).
total_formatted
A human-readable string representing the total cost of the order in the order currency (e.g. $9.99).
first_order_item
An object representing the first order item belonging to this order.
id
- The ID of the order item.order_id
- The ID of the order.product_id
- The ID of the product.variant_id
- The ID of the product variant.product_name
- The name of the product.variant_name
- The name of the product variant.price
- A positive integer in cents representing the price of the order item in the order currency.created_at
- An ISO-8601 formatted date-time string indicating when the order item was created.updated_at
- An ISO-8601 formatted date-time string indicating when the order item was last updated.
urls
An object of customer-facing URLs for this order. It contains:
receipt
- A pre-signed URL for viewing the order in the customer's My Orders page.
created_at
An ISO-8601 formatted date-time string indicating when the object was created.
updated_at
An ISO-8601 formatted date-time string indicating when the object was last updated.
Order object
Retrieve an order
Retrieves the order with the given ID.
GET /v1/orders/:id
Returns
Returns an order object.
Response
List all orders
Returns a paginated list of orders.
Parameters
store_id
Only return orders belonging to the store with this ID.
user_email
Only return orders where the user_email
field is equal to this email address.
GET /v1/orders
Returns
Returns a paginated list of order objects ordered by created_at
(descending).