B2B order data in the Storefront GraphQL API
Authenticated B2B company users can now read company orders and B2B order details through the Storefront GraphQL API, so a single storefront graph can serve both B2C and B2B order experiences.
Storefront GraphQL
- Company order queries: the
ordersfield on theActiveCompanytype returns orders placed on the current storefront channel by any user in the shopper’s active company, with cursor pagination, filtering, and sorting. - B2B order fields: orders add
poNumber,reference,company,placedBy,invoice,history, andextraFields. These fields require a B2B storefront token.
For example queries, see the Orders guide, or browse the Storefront GraphQL API reference for schema details.
Per-code coupon scheduling for bulk coupon promotions
The Promotions V3 API now supports a custom validity window on each coupon code of a bulk coupon promotion. A code with no custom window inherits the schedule of its parent promotion.
Promotions V3
- Code schedule: the
CouponCodeobject has a new nullablescheduleobject withvalid_fromandvalid_untilfields. - Generate codes with a schedule: the Generate Multiple Coupon Codes endpoint (/codegen) accepts an optional
scheduleobject and applies it to every generated code. - Filter codes by schedule: the List Coupon Codes endpoint accepts the new
valid_from:minandvalid_until:maxquery filters. The values are Unix timestamps. - Reschedule codes in bulk: the new
PUT /promotions/{promotion_id}/reschedulecodesendpoint updates the validity window of up to 250 codes in one request. Sendschedule: nullto reset the codes to the promotion schedule.
For details, see the Promotions API reference.