getOrderById
Get one of the user's orders by its id. 🔐 This method requires authorization.
Description
Fetches one of the authenticated user's orders by its id alone, without the storage marker. Resolves to an IOrderByMarkerEntity, the same entity getOrderByMarkerAndId returns.
.getOrderById(
,
);
Parameters schema
Schema
id(required): number
Order ID.
example: 12345
langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"
When to use it instead of getOrderByMarkerAndId
getOrderByMarkerAndId needs both the storage marker and the id. When the id comes from outside your app, the marker is usually what you don't have: the return URL of a payment provider, a link in a notification, an order number a customer reads out over the phone. Use this method in those cases.
Examples
Minimal example
const response = await Orders.getOrderById(205);
With a language code
const response = await Orders.getOrderById(205, 'en_US');
Example response
{
"id": 205,
"storageId": 1,
"createdDate": "2025-07-18T05:51:09.924Z",
"statusIdentifier": "inProgress",
"statusLocalizeInfos": {
"title": "In progress"
},
"fulfillmentStatusIdentifier": null,
"fulfillmentStatusLocalizeInfos": null,
"paymentStatusIdentifier": null,
"paymentStatusLocalizeInfos": null,
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"type": "string",
"value": "John"
}
],
"attributeSetIdentifier": "order_form",
"paymentStrategy": "once",
"totalSum": "51",
"totalSumRaw": "51",
"currency": "usd",
"paymentAccountIdentifier": "stripe",
"paymentAccountLocalizeInfos": {
"title": "Stripe"
},
"products": [
{
"id": 2954,
"title": "Box",
"sku": null,
"previewImage": [
{
"size": 742690,
"filename": "files/project/product/2954/image/48853cbf-4462-42c6-8b99-d14f721c21a2.jpeg",
"contentType": "image/jpeg",
"previewLink": {
"default": [
"data:image/webp;base64,UklGRmwAAABXRUJQVlA4IGAAAADQAQCdASoQABAABUB8JbACdACZZ3P8AAD+wGsUXBs/r069WpdrcuaTNfVxqWIetuaIdIvOMkSp9iJRxE+KhA2YHbrVehhMRj/j5+DUdjWn1v5YtZ7vw0IgPi9R5vkAAAA=",
"https://your-project.oneentry.cloud/cloud-static/files/project/product/2954/image/48853cbf-4462-42c6-8b99-d14f721c21a2.preview.default.jpeg"
]
},
"downloadLink": "https://your-project.oneentry.cloud/cloud-static/files/project/product/2954/image/48853cbf-4462-42c6-8b99-d14f721c21a2.jpeg",
"defaultPreview": "default"
}
],
"price": 51,
"quantity": 1,
"isGift": false
}
],
"paymentUrl": "https://checkout.stripe.com/c/pay/cs_test_a19RuP9hh4gGmaSOQwb57OBpnypIifa0FDnGhYe7od5XkRXRUpYXUKDRtm#fidnandhYHdWcXxpYCc%2FJ2FgY2RwaXEnKSd2cXdsdWBEZmZqcGtxJz8nZGZmcVo0VHJuTndEZlZqS2YybGBzJyknZHVsTmB8Jz8ndW5acWB2cVowNEtDcERXRG9vaE89NUZTa2tDan1AdkJNaHN2YnE2Tmw8YE5zVUJCb1ZTYXBkQEBgSXNkZ3JTVj1UbmZDUTVVTXA0cH1CMkZXXDVfUUM0YUJRQTVLTGZPbjU1d0tkcmFoNV8nKSdjd2poVmB3c2B3Jz9xd3BgKSdnZGZuYndqcGthRmppancnPycmY2NjY2NjJyknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpscWBoJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl",
"discountConfig": {
"orderDiscounts": [],
"productDiscounts": [],
"coupon": null,
"settings": {
"allowStacking": false,
"maxDiscountValue": null,
"allowGiftStacking": false
},
"additionalDiscountsMarkers": [],
"totalRaw": 51,
"totalSumWithDiscount": 51,
"excludedGiftProductIds": [],
"bonus": null,
"bonusApplied": 0,
"totalDue": 51
},
"isPartial": false,
"isCompleted": false,
"split": {
"completed": false,
"partial": false,
"stages": [
{
"marker": "default",
"sessionId": null,
"productId": 2954,
"title": "Default",
"value": 51,
"status": "planned"
}
]
}
}
Response schema
Schema: IOrderByMarkerEntity
id: number
Object ID.
example: 125
storageId: number
ID of the order storage.
example: 1
createdDate: string
Date when the order was created.
example: "2023-10-01T12:00:00Z"
statusIdentifier: string
Marker of the order status.
example: "order-status-1"
formIdentifier: string
Marker of the form.
example: "bar-orders-form"
formData: IOrdersFormData[]
Data from the form linked to the order storage.
example:
[
{
"marker": "order_name",
"value": "John",
"type": "string"
}
]
formData.marker: string
Marker of the form field.
example: "name_1"
formData.type: string
Type of the field value, for example "string".
example: "string"
formData.value: string
Field value.
example: "Name"
attributeSetIdentifier: string | null
Marker of the attribute set.
example: "attribute-set-1"
totalSum: string
Total order amount.
example: "100.00"
totalSumRaw: string
Raw total order amount with full precision.
example: "100.00"
currency: string
Currency used to pay for the order.
example: "USD"
paymentAccountIdentifier: string | null
Marker of the payment account.
example: "payment-1"
paymentAccountLocalizeInfos: ILocalizeInfo
Localized name of the payment account.
example:
{
"title": "Cash"
}
products: IOrderProducts[]
Products in the order.
example:
[
{
"id": 1,
"name": "Product 1",
"quantity": 2
}
]
products.id: number
Product ID.
example: 2957
products.quantity: number
Product quantity.
example: 1
products.title: string
Product title.
example: "Cosmo"
products.sku: string | null
Product SKU.
example: "SKU"
products.previewImage: IPicture | null
Preview image of the product.
example:
{
"filename": "image.jpg",
"downloadLink": "https://example.com/image.jpg",
"size": 102400,
"previewLink": "https://example.com/image-preview.jpg"
}
products.price: number
Product price.
example: 150
products.isGift: boolean
Whether the product is a gift.
example: false
paymentUrl: string | null
Payment page URL.
example: "https://example.com/pay/123"
isCompleted: boolean | null
Whether the order has been completed.
example: true
isPartial: boolean | null
Whether the order is partially paid; null on older orders where this was not tracked.
example: false
paymentStrategy: string
Payment strategy of the order.
example: "once"
statusLocalizeInfos: ILocalizeInfo
Localized status name.
fulfillmentStatusIdentifier: string | null
Marker of the fulfillment (delivery) status; null while no fulfillment status is assigned.
example: "shipped"
fulfillmentStatusLocalizeInfos: ILocalizeInfo | null
Localized fulfillment status name; null while no fulfillment status is assigned.
paymentStatusIdentifier: string | null
Marker of the payment status; null while no payment status is assigned.
example: "inProgress-payment"
paymentStatusLocalizeInfos: ILocalizeInfo | null
Localized name of the payment status; null while no payment status is assigned.
discountConfig: IOrderDiscountConfig | null
Discount configuration resolved for the order: orderDiscounts, productDiscounts, coupon, settings, bonus and totals. null on older orders without a resolved configuration.
discountConfig.bonus: IOrderDiscountBonus | null
Bonus calculation result: null when bonuses are not used; omitted when the order has no bonus context.
discountConfig.coupon: unknown | null
Applied coupon, or null when no coupon is applied.
discountConfig.orderDiscounts: unknown[]
Order-level discounts that were matched and applied.
discountConfig.productDiscounts: unknown[]
Product-level discounts that were matched and applied.
discountConfig.settings: IOrderDiscountSettings
Stacking and cap settings used during calculation.
discountConfig.additionalDiscountsMarkers: string[]
Markers of additional discounts requested by the client. Omitted in preview responses.
discountConfig.bonusApplied: number
Bonus amount applied to the order. Omitted in preview responses.
example: 0
discountConfig.excludedGiftProductIds: string[]
Product IDs excluded from gift selection. Omitted in preview responses.
discountConfig.totalDue: number
Total amount due after discounts and bonuses (omitted in preview responses).
example: 300
discountConfig.totalRaw: number
Total amount before discounts (omitted in preview responses).
example: 300
discountConfig.totalSumWithDiscount: number
Total amount after discounts but before bonuses (omitted in preview responses).
example: 300
split: IOrderSplit
Split (staged) payment configuration; present on the by-id order endpoint.
split.completed: boolean
Whether all split payment stages are completed.
example: false
split.partial: boolean
Whether the split is partially paid.
example: false
split.stages: IOrderSplitStage[]
Ordered list of split payment stages.
distance: number
Cosine distance to the query. Returned on every item by the semantic (vector) search endpoint.
example: 0.12