Przejdź do głównej zawartości

Order

A buyer order — the result of completing a cart. Carries totals, status, addresses, line items and the signals needed to drive payment (canCreatePayment, paymentMethodType) and a guest confirmation page (accessToken).

type Order implements Node {
accessToken: String!
attributes(
namespace: String
): [EntityAttributeField!]!
bankTransferInstructions: BankTransferInstructions
canCreatePayment: Boolean!
cancelledAt: DateTime
confirmedAt: DateTime
customerNote: String
discountAllocations: [OrderDiscountAllocation!]!
expiredAt: DateTime
fulfillmentStatus: OrderFulfillmentStatus!
id: ID!
itemCount: Int!
lineItems(
after: String
first: Int = 10
): OrderLineItemConnection!
orderNumber: String!
paymentMethodType: PaymentMethodType!
paymentStatus: OrderPaymentStatus!
processedAt: DateTime!
shipments: [Shipment!]!
shippingAddress: MailingAddress
status: StorefrontOrderStatus!
totals: OrderTotals!
}

Fields

Order.accessToken ● String! non-null scalar

Opaque access token (UUID v4) that grants read access to the order summary without an authenticated session — pass it to the orderByToken query to build a guest confirmation page. Persistent for the lifetime of the order so it can be re-used in forwarded receipts. Store on the storefront in an HTTP-only cookie or sessionStorage; never in localStorage. As defense-in-depth, orderByToken also accepts an optional email guard to limit the blast radius if the token leaks.

Order.attributes ● [EntityAttributeField!]! non-null object

Order custom field values (post-Opcja A unified custom fields).

Order.attributes.namespace ● String scalar

Optional namespace prefix to filter attributes (e.g. "erp", "b2b", "fulfillment")

Order.bankTransferInstructions ● BankTransferInstructions object

Bank transfer details for orders paid by manual bank transfer — render them on the confirmation page when paymentMethodType is BANK_TRANSFER and canCreatePayment is false. Null for orders using any other payment method, for cancelled/expired/paid orders, when the outstanding balance is zero, and when the merchant has not configured their bank account. Reflects the CURRENT merchant account details (not a snapshot) and the CURRENT outstanding amount, so a buyer returning from the confirmation email always sees valid data.

Order.canCreatePayment ● Boolean! non-null scalar

True when the storefront should initiate an online payment for this order — render a "Pay now" button. False when the order is cancelled, already paid, or uses an offline payment method (cash on delivery, manual bank transfer) where no online flow applies. Retry-friendly: returns true for UNPAID / PENDING / FAILED payment statuses when the method supports online init.

Order.cancelledAt ● DateTime scalar

When the order was cancelled. Null when not cancelled.

Order.confirmedAt ● DateTime scalar

When the order was confirmed (e.g. payment authorised / approved). Null until confirmation.

Order.customerNote ● String scalar

The note the buyer left at checkout (delivery instructions, gift message, etc.). Null when no note was provided.

Order.discountAllocations ● [OrderDiscountAllocation!]! non-null object

Per-code discount allocations on the order (parity with Cart.discountAllocations). One entry per code that reduced the price; empty when no discount applied. The sum of amount equals the order-level discount.

Order.expiredAt ● DateTime scalar

When the order expired (e.g. pending payment timed out). Null when not expired.

Order.fulfillmentStatus ● OrderFulfillmentStatus! non-null enum

Fulfillment progress (UNFULFILLED, PARTIALLY_FULFILLED, FULFILLED, IN_TRANSIT, DELIVERED, PARTIALLY_RETURNED, RETURNED, LOST).

Order.id ● ID! non-null scalar

Stable identifier of the order.

Order.itemCount ● Int! non-null scalar

Number of line items on the order (sum of distinct lines, not quantities).

Order.lineItems ● OrderLineItemConnection! non-null object

Line items on the order (paginated, Relay Connection). Use to render the order summary on the confirmation or order detail page.

Order.lineItems.after ● String scalar

Cursor for forward pagination (cursor of the last edge from the previous page)

Order.lineItems.first ● Int scalar

Number of line items to return from the start (forward pagination, default 10)

Order.orderNumber ● String! non-null scalar

Human-readable order number shown to the buyer and the merchant (e.g. "1042"). Distinct from id.

Order.paymentMethodType ● PaymentMethodType! non-null enum

Category of the payment method on the order (CARD, BLIK, BANK_TRANSFER, INSTALLMENT, WALLET, CASH_ON_DELIVERY, OTHER). Use to drive iconography and copy on the confirmation page (e.g. show the card icon for CARD, the BLIK logo for BLIK, the wallet icon for WALLET — Apple Pay / Google Pay).

Order.paymentStatus ● OrderPaymentStatus! non-null enum

Payment progress (UNPAID, PENDING, AUTHORIZED, PAID, PARTIALLY_PAID, PARTIALLY_REFUNDED, REFUNDED, FAILED, CHARGEBACK, VOIDED, REFUND_PENDING).

Order.processedAt ● DateTime! non-null scalar

When the order was placed (ISO 8601). Use as the canonical "order date" in receipts.

Order.shipments ● [Shipment!]! non-null object

Order shipments

Order.shippingAddress ● MailingAddress object

Shipping address snapshot at the moment the order was placed. Null for digital-only orders.

Order.status ● StorefrontOrderStatus! non-null enum

High-level lifecycle status of the order (DRAFT, PENDING, CONFIRMED, PROCESSING, ON_HOLD, COMPLETED, CANCELLED, EXPIRED).

Order.totals ● OrderTotals! non-null object

Cost breakdown on the order (subtotal, total, tax, shipping).

Interfaces

Node interface

GraphQL Node interface — universal ID-based lookup

Returned By

customerOrder query ● orderByToken query

Member Of

Cart object ● CartCompletePayload object ● OrderConnection object ● OrderEdge object