StoreOSv0.15.0
GraphQL API

Mutations

GraphQL mutations explained — checkout, coupons, and account changes.

Mutations change data on StoreOS — place orders, update profiles, log in. Most need x-tenant; some also need a customer JWT.


Checkout

createOrder

What it does: Places an order — converts cart line items into an invoice on StoreOS. This is the main checkout action.

Who can call: Guests (no JWT) or logged-in customers (with JWT).

What you send: Line items, shipping address, payment method (COD or ONLINE), delivery area, optional coupon.

What you get back: Order with invoiceUID, optional authToken for guest tracking.

mutation CreateOrder($input: CreateOrderInput!) {
  createOrder(input: $input) {
    order { invoiceUID invoiceStatus netTotalAmount }
    authToken
    customer { _id name email phoneNumber }
  }
}

REST equivalent: POST /api/v1/orders · SDK: createOrder()

Checkout guide


verifyCoupon

What it does: Checks if a discount code is valid for the current cart and returns the discount amount.

Why line items are required: StoreOS validates the coupon against specific products and quantities.

mutation VerifyCoupon($input: VerifyCouponInput!) {
  verifyCoupon(input: $input) {
    valid discountAmount message
  }
}

Input needs code + lineItems[] with productId, variantId, quantity.

REST equivalent: POST /api/v1/orders/coupons/verify · SDK: verifyCoupon()


Account

updateProfile · changePassword

MutationWhat it doesAuth
updateProfile Change name, phone, shipping addressRequired
changePassword Change password (returns Boolean)Required
mutation UpdateProfile($input: UpdateProfileInput!) {
  updateProfile(input: $input) { _id name email phoneNumber }
}

REST equivalent: PATCH /api/v1/auth/profile, POST /api/v1/auth/change-password


cancelOrder

What it does: Cancels an order the logged-in customer placed.

Input: orderId (invoice UID) + optional reason.

mutation CancelOrder($input: CancelOrderInput!) {
  cancelOrder(input: $input) {
    invoiceUID invoiceStatus
  }
}

REST equivalent: POST /api/v1/orders/:orderId/cancel · SDK: cancelOrder()


Order lifecycle reference

Invoice status (invoiceStatus)

StatusMeaning
PENDINGPlaced, awaiting processing
PROCESSINGBeing prepared
SHIPMENT_IN_PROGRESSHanded to courier
SHIPMENT_IN_TRANSITIn transit
SHIPMENT_DELIVEREDDelivered
REJECTEDRejected / cancelled

Payment status (paymentStatus)

UNATTEMPTED · PROCESSING · PAID · CANCELLED · FAILED · EXPIRED

Delivery areas

Bangladesh divisions: DHAKA, CHATTOGRAM, SYLHET, RAJSHAHI, KHULNA, BARISHAL, RANGPUR, MYMENSINGH, OUTSIDE_CAPITAL.

Fees come from storeFront.charges — fetch with storeFront query or getTenant().

On this page