getOrderById
Getting a single order created by the user, by its own id.
Description
This method retrieves one order of the authenticated user by the order id alone, without the storage marker. It returns a Promise that resolves to an IOrderByMarkerEntity object - the same entity getOrderByMarkerAndId returns.
Orders.getOrderById(id, langCode);
Parameters
id: number
ID of the order object.
example: 12345
langCode: string (optional)
Language code. Default: "en_US".
example: "en_US"
💡 When to use it instead of getOrderByMarkerAndId
getOrderByMarkerAndId needs both the storage marker and the id. The marker is exactly what is missing when the id arrives from outside your app: the return URL of a payment provider, a link in a notification, an order number a customer reads out over the phone. In those cases use this method.
🔐 Authorization
This method requires user authorization. See the AuthProvider module.
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": "Ivan"
}
],
"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 identifier.
example: 125
storageId: number
Identifier of the order storage object.
example: 1
createdDate: string
Date when the order was created.
example: "2023-10-01T12:00:00Z"
statusIdentifier: string
Text identifier of the order status.
example: "order-status-1"
formIdentifier: string
Text identifier of the form.
example: "bar-orders-form"
formData: IOrdersFormData[]
Data submitted by the form linked to the order store.
example:
[
{
"marker": "order_name",
"value": "Ivan",
"type": "string"
}
]
formData.marker: string
Marker of form field.
example: "name_1"
formData.type: string
Type of value.
example: "string"
formData.value: string
Value.
example: "Name"
attributeSetIdentifier: string | null
Text identifier 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
Textual identifier for the order payment.
example: "payment-1"
paymentAccountLocalizeInfos: ILocalizeInfo
Payment account name considering localization.
example:
{
"title": "Cash"
}
products: IOrderProducts[]
Array of products added to 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
Product previewImage.
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 link.
example: "https://example.com/pay/123"
isCompleted: boolean | null
Indicates that the order has been completed.
example: true
isPartial: boolean | null
Indicates that the order is partially paid; null on older orders where it was not tracked.
example: false
paymentStrategy: string
Payment strategy of the order.
example: "once"
statusLocalizeInfos: ILocalizeInfo
Localized status name.
fulfillmentStatusIdentifier: string | null
Text identifier 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
Text identifier of the payment status; null while no payment status is assigned.
example: "inProgress-payment"
paymentStatusLocalizeInfos: ILocalizeInfo | null
Localized payment status name; null while no payment status is assigned.
discountConfig: IOrderDiscountConfig | null
Resolved discount configuration applied to the order (orderDiscounts, productDiscounts, coupon, settings, bonus, totals); null on older orders without a resolved discount config.
discountConfig.bonus: IOrderDiscountBonus | null
Bonus calculation result, null when bonuses are not used, or omitted entirely when the order has no bonus context.
discountConfig.coupon: unknown | null
Resolved 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 extra 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 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 only by the semantic (vector) search endpoint when debug: true is passed in the search body.
example: 0.12