01 Software

Orders

Orders, order products, returns, exchanges, fulfillments, and payment transaction collections

Orders

orders

Stores order information.

FieldTypeDescriptionRequired
orderNumbertextOrder number (unique, read-only)
statusselectOrder status (default: pending, read-only)
customerrelationshipCustomer reference (customers)
customerSnapshotgroupCustomer info at time of order (read-only)
totalAmountnumberTotal payment amount (read-only)
discountCodetextDiscount code (read-only)
discountAmountnumberDiscount amount (read-only)
notestextareaNotes
shippingAddressgroupShipping address (read-only)
productsjoinOrder products (order-products)
transactionsjoinPayment history (transactions)
returnsjoinReturn history (returns)
exchangesjoinExchange history (exchanges)
fulfillmentsjoinFulfillment history (fulfillments)

Customer Snapshot (customerSnapshot):

FieldTypeDescriptionRequired
nametextCustomer name
emailemailEmail
phonetextPhone number

Shipping Address (shippingAddress):

FieldTypeDescriptionRequired
recipientNametextRecipient name
phonetextPhone number
postalCodetextPostal code
address1textAddress
address2textDetailed address
deliveryMessagetextDelivery message

Order Status Flow:

Payment: pending → paid → failed / canceled
Shipping: preparing → shipped → delivered → confirmed
Returns: return_requested → return_processing → returned
const response = await client.from('orders').find({
  where: { status: { equals: 'paid' } },
  sort: '-createdAt'
})

order-products

Stores products included in an order. All fields are read-only.

FieldTypeDescriptionRequired
orderrelationshipOrder reference (orders)
productrelationshipProduct reference (products)
variantrelationshipVariant reference (product-variants)
optionrelationshipOption reference (product-options)
quantitynumberQuantity
unitPricenumberUnit price at time of order
totalPricenumberunitPrice × quantity

returns

Stores return requests.

FieldTypeDescriptionRequired
orderrelationshipOrder reference (orders, read-only)
statusselectReturn status (default: requested)
reasonselectReturn reason
reasonDetailtextareaDetailed reason
returnProductsjoinReturn products (return-products)
refundAmountnumberRefund amount (read-only)

Return Statuses: requested, processing, approved, rejected, completed

Return Reasons: change_of_mind, defective, wrong_delivery, damaged, other

return-products

Stores individual return product items.

FieldTypeDescriptionRequired
returnrelationshipReturn reference (returns, hidden)
orderrelationshipOrder reference (hidden, read-only)
statusselectStatus: requested, processing, approved, rejected
orderProductrelationshipOrder product reference (order-products)
productrelationshipProduct reference (hidden, auto-set)
variantrelationshipVariant reference (hidden, auto-set)
optionrelationshipOption reference (hidden, auto-set)
quantitynumberReturn quantity

exchanges

Stores exchange requests.

FieldTypeDescriptionRequired
orderrelationshipOrder reference (orders, read-only)
statusselectExchange status (default: requested)
reasonselectExchange reason
reasonDetailtextareaDetailed reason
shippingFeenumberExchange shipping fee (default: 0)
exchangeProductsjoinExchange products (exchange-products)

Exchange Statuses: requested, processing, shipped, completed, rejected

Exchange Reasons: wrong_size, wrong_color, defective, other

const response = await client.from('exchanges').find({
  where: {
    order: { equals: orderId },
    status: { equals: 'requested' }
  }
})

exchange-products

Stores individual exchange product items.

FieldTypeDescriptionRequired
exchangerelationshipExchange reference (exchanges, read-only)
orderrelationshipOrder reference (hidden, auto-set)
orderProductrelationshipOrder product reference (order-products)
productrelationshipProduct reference (hidden, auto-set)
variantrelationshipVariant reference (hidden, auto-set)
optionrelationshipOption reference (hidden, auto-set)
quantitynumberExchange quantity
newVariantrelationshipDesired new variant (product-variants)
newOptionrelationshipDesired new option (product-options)

fulfillments

Stores fulfillment (shipping) information. Supports partial and split shipments.

FieldTypeDescriptionRequired
orderrelationshipOrder reference (orders)
statusselectFulfillment status (default: pending)
carrierselectShipping carrier
trackingNumbertextTracking number
shippedAtdateShipped date
deliveredAtdateDelivered date
itemsjoinFulfillment items (fulfillment-items)

Fulfillment Statuses: pending, packed, shipped, delivered, failed

Shipping Carriers: cj, hanjin, lotte, epost, logen, other

const response = await client.from('fulfillments').find({
  where: {
    order: { equals: orderId },
    status: { not_equals: 'delivered' }
  }
})

fulfillment-items

Stores items included in a fulfillment.

FieldTypeDescriptionRequired
fulfillmentrelationshipFulfillment reference (fulfillments)
orderProductrelationshipOrder product reference (order-products)
quantitynumberFulfillment quantity

transactions

Stores payment transactions. All fields are read-only.

FieldTypeDescriptionRequired
statusselectStatus: pending, paid, failed, canceled
orderrelationshipOrder reference (orders)
paymentIdtextPayment ID
paymentMethodtextPayment method
receiptUrltextReceipt URL
totalAmountnumberPayment amount

On this page