{"openapi":"3.0.0","paths":{"/public/v1/customers":{"get":{"operationId":"customersList","parameters":[{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":50,"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"The next_cursor from the previous page","schema":{"type":"string"}},{"name":"updated_since","required":false,"in":"query","description":"Only records changed at or after this time, oldest change first. Keep the last updated_at you saw and ask from there to sync.","schema":{"example":"2026-11-25T08:00:00.000Z","type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/PublicCustomerDto"}},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"List customers, newest first, or changes since a time","tags":["Customers"],"x-required-scopes":["customers:read"]},"post":{"description":"The phone must not belong to another customer in the shop.","operationId":"customersCreate","parameters":[{"name":"Idempotency-Key","in":"header","description":"Your id for this request (up to 255 letters, digits, - _ . :). Retrying with the same key returns the first response for 24 hours instead of doing it twice.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicCreateCustomerDto"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicCustomerDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"Add a customer","tags":["Customers"],"x-required-scopes":["customers:write"]}},"/public/v1/customers/{customerId}":{"get":{"operationId":"customersGet","parameters":[{"name":"customerId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicCustomerDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"One customer","tags":["Customers"],"x-required-scopes":["customers:read"]},"patch":{"operationId":"customersUpdate","parameters":[{"name":"customerId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Your id for this request (up to 255 letters, digits, - _ . :). Retrying with the same key returns the first response for 24 hours instead of doing it twice.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicUpdateCustomerDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicCustomerDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"Change a customer's name, phone or address","tags":["Customers"],"x-required-scopes":["customers:write"]}},"/public/v1/deliveries":{"get":{"operationId":"deliveriesList","parameters":[{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":50,"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"The next_cursor from the previous page","schema":{"type":"string"}},{"name":"updated_since","required":false,"in":"query","description":"Only records changed at or after this time, oldest change first. Keep the last updated_at you saw and ask from there to sync.","schema":{"example":"2026-11-25T08:00:00.000Z","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["scheduled","out_for_delivery","delivered"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/PublicDeliveryDto"}},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"List deliveries, newest first, or changes since a time","tags":["Deliveries"],"x-required-scopes":["deliveries:read"]}},"/public/v1/deliveries/{deliveryId}":{"get":{"operationId":"deliveriesGet","parameters":[{"name":"deliveryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicDeliveryDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"One delivery","tags":["Deliveries"],"x-required-scopes":["deliveries:read"]},"patch":{"description":"Marking it delivered also moves the order, as in FOM.","operationId":"deliveriesUpdate","parameters":[{"name":"deliveryId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Your id for this request (up to 255 letters, digits, - _ . :). Retrying with the same key returns the first response for 24 hours instead of doing it twice.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicUpdateDeliveryDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicDeliveryDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"Change a delivery's status or time","tags":["Deliveries"],"x-required-scopes":["deliveries:write"]}},"/public/v1/orders":{"get":{"operationId":"ordersList","parameters":[{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":50,"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"The next_cursor from the previous page","schema":{"type":"string"}},{"name":"updated_since","required":false,"in":"query","description":"Only records changed at or after this time, oldest change first. Keep the last updated_at you saw and ask from there to sync.","schema":{"example":"2026-11-25T08:00:00.000Z","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["new","confirmed","out_for_delivery","delivered","cancelled"]}},{"name":"customer_id","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/PublicOrderDto"}},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"List orders, newest first, or changes since a time","tags":["Orders"],"x-required-scopes":["orders:read"]},"post":{"description":"Give a customer_id, or a customer with a phone: an existing customer with that phone is used. Items with a variant_id take its name and price unless you send them. Stock is taken when the order is confirmed.","operationId":"ordersCreate","parameters":[{"name":"Idempotency-Key","in":"header","description":"Your id for this request (up to 255 letters, digits, - _ . :). Retrying with the same key returns the first response for 24 hours instead of doing it twice.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicCreateOrderDto"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicOrderDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"Create an order","tags":["Orders"],"x-required-scopes":["orders:write"]}},"/public/v1/orders/{orderId}":{"get":{"operationId":"ordersGet","parameters":[{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicOrderDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"One order with its items, customer and delivery","tags":["Orders"],"x-required-scopes":["orders:read"]}},"/public/v1/orders/{orderId}/status":{"post":{"description":"Moves stock, deliveries and customer messages the same way as in FOM. Send expected_revision to be sure nobody changed the order since you read it.","operationId":"ordersChangeStatus","parameters":[{"name":"orderId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Your id for this request (up to 255 letters, digits, - _ . :). Retrying with the same key returns the first response for 24 hours instead of doing it twice.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicOrderStatusDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicOrderDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"Change an order's status","tags":["Orders"],"x-required-scopes":["orders:write"]}},"/public/v1/products":{"get":{"description":"With updated_since, a product counts as changed when it or any of its variants (including stock) changed.","operationId":"productsList","parameters":[{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":50,"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"The next_cursor from the previous page","schema":{"type":"string"}},{"name":"updated_since","required":false,"in":"query","description":"Only records changed at or after this time, oldest change first. Keep the last updated_at you saw and ask from there to sync.","schema":{"example":"2026-11-25T08:00:00.000Z","type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/PublicProductDto"}},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"List products with variants and stock","tags":["Products"],"x-required-scopes":["products:read"]},"post":{"operationId":"productsCreate","parameters":[{"name":"Idempotency-Key","in":"header","description":"Your id for this request (up to 255 letters, digits, - _ . :). Retrying with the same key returns the first response for 24 hours instead of doing it twice.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicCreateProductDto"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicProductDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"Add a product with its variants","tags":["Products"],"x-required-scopes":["products:write"]}},"/public/v1/products/{productId}":{"get":{"operationId":"productsGet","parameters":[{"name":"productId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicProductDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"One product with its variants and stock","tags":["Products"],"x-required-scopes":["products:read"]},"patch":{"description":"Send variants to replace the list: give id for ones to keep; ones left out are archived. Change stock with the stock endpoint.","operationId":"productsUpdate","parameters":[{"name":"productId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Your id for this request (up to 255 letters, digits, - _ . :). Retrying with the same key returns the first response for 24 hours instead of doing it twice.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicUpdateProductDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicProductDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"Change a product","tags":["Products"],"x-required-scopes":["products:write"]}},"/public/v1/shop":{"get":{"description":"Any working key can call this. Use it to check a key and see its scopes.","operationId":"shopShop","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicShopDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"The shop this API key belongs to","tags":["Shop"]}},"/public/v1/variants/{variantId}/stock":{"post":{"description":"Send delta to add or remove, or set after a stock count. Recorded in the stock history.","operationId":"productsStock","parameters":[{"name":"variantId","required":true,"in":"path","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"Your id for this request (up to 255 letters, digits, - _ . :). Retrying with the same key returns the first response for 24 hours instead of doing it twice.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicStockDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/PublicProductDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}}}}}},"4XX":{"description":"An error: 401 bad key, 403 missing scope or permission, 404 not found, 409 conflict, 422 invalid, 429 rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicErrorDto"}}}}},"security":[{"api-key":[]}],"summary":"Change a variant's stock","tags":["Products"],"x-required-scopes":["stock:write"]}}},"info":{"title":"FOM Public API","description":"Read and change your shop's orders, customers, products, stock and deliveries from your own tools.\n\nAuthenticate with an API key from Settings → Developers: `Authorization: Bearer fom_live_…`. A key acts for the person who made it, limited to its scopes. Responses use `{ success, data, meta }`; lists page with `cursor`, and `updated_since` returns changes oldest first for syncing. Writes accept an `Idempotency-Key`. Limits: 120 requests a minute per key and 600 per shop, shown in `RateLimit-*` headers.","version":"1.0.0","contact":{}},"tags":[{"name":"Shop"},{"name":"Orders"},{"name":"Customers"},{"name":"Products"},{"name":"Deliveries"}],"servers":[{"url":"https://api.getfom.com"}],"components":{"securitySchemes":{"api-key":{"scheme":"bearer","bearerFormat":"fom_live_…","type":"http","description":"An API key from Settings → Developers"}},"schemas":{"PublicApiKeyInfoDto":{"type":"object","properties":{"name":{"type":"string","example":"POS sync"},"scopes":{"example":["orders:read"],"type":"array","items":{"type":"string"}},"acts_for":{"type":"string","example":"Ma Aye","description":"The member the key acts for"}},"required":["name","scopes","acts_for"]},"PublicCreateCustomerDto":{"type":"object","properties":{"name":{"type":"string","example":"Daw Aye Aye"},"phone":{"type":"string","example":"09 9871 2345","description":"Finds the existing customer with this phone, or adds one"},"township":{"type":"string","example":"Hlaing","nullable":true},"address":{"type":"string","nullable":true}},"required":["name","phone"]},"PublicCreateOrderDto":{"type":"object","properties":{"customer_id":{"type":"string","description":"An existing customer"},"customer":{"$ref":"#/components/schemas/PublicOrderCustomerDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PublicOrderItemDto"}},"payment_method":{"type":"string","enum":["unknown","cod","prepaid","kbzpay","wavepay","other"],"default":"cod"},"delivery_fee":{"type":"number","example":3000,"minimum":0},"note":{"type":"string","nullable":true},"status":{"type":"string","enum":["new","confirmed"],"default":"new"}},"required":["items"]},"PublicCreateProductDto":{"type":"object","properties":{"name":{"type":"string","example":"Cotton T-shirt"},"description":{"type":"string","nullable":true},"option_names":{"example":["Colour","Size"],"type":"array","items":{"type":"string"}},"on_shop_page":{"type":"boolean","default":true},"variants":{"type":"array","items":{"$ref":"#/components/schemas/PublicVariantDto"}}},"required":["name","variants"]},"PublicCustomerDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Daw Aye Aye"},"phone":{"type":"string","example":"09 9871 2345"},"township":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"archived":{"type":"boolean"},"revision":{"type":"number","description":"Send as expected_revision when changing it"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","phone","township","address","archived","revision","created_at","updated_at"]},"PublicCustomerRefDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Daw Aye Aye"},"phone":{"type":"string","example":"09 9871 2345"},"township":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}},"required":["id","name","phone","township","address"]},"PublicDeliveryDto":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["scheduled","out_for_delivery","delivered"]},"scheduled_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"order_id":{"type":"string"},"order_no":{"type":"string","example":"ORD-0319"},"address":{"type":"string"},"delivery_fee":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","status","scheduled_at","delivered_at","order_id","order_no","address","delivery_fee","created_at","updated_at"]},"PublicDeliverySummaryDto":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["scheduled","out_for_delivery","delivered"]},"scheduled_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true}},"required":["id","status","scheduled_at","delivered_at"]},"PublicErrorBodyDto":{"type":"object","properties":{"code":{"type":"string","example":"VALIDATION_ERROR","description":"UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT, VALIDATION_ERROR, TOO_MANY_REQUESTS or SERVER_ERROR"},"message":{"type":"string","example":"The request is not valid."},"details":{"type":"array","items":{"$ref":"#/components/schemas/PublicErrorDetailDto"}},"context":{"type":"object","additionalProperties":true,"description":"Extra facts, e.g. retry_after_seconds on 429"}},"required":["code","message"]},"PublicErrorDetailDto":{"type":"object","properties":{"field":{"type":"string","example":"items.0.qty"},"errors":{"example":["qty must not be less than 1"],"type":"array","items":{"type":"string"}}},"required":["field","errors"]},"PublicErrorDto":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"$ref":"#/components/schemas/PublicErrorBodyDto"},"meta":{"$ref":"#/components/schemas/PublicMetaDto"}},"required":["success","error","meta"]},"PublicMetaDto":{"type":"object","properties":{"request_id":{"type":"string","example":"req_7f3a2c"},"timestamp":{"type":"string","example":"2026-11-25T08:00:00.000Z"},"pagination":{"$ref":"#/components/schemas/PublicPaginationDto"},"idempotent_replay":{"type":"boolean","description":"True when an Idempotency-Key returned a stored response"}},"required":["request_id","timestamp"]},"PublicOrderCustomerDto":{"type":"object","properties":{"name":{"type":"string","example":"Daw Aye Aye"},"phone":{"type":"string","example":"09 9871 2345","description":"Finds the existing customer with this phone, or adds one"},"township":{"type":"string","example":"Hlaing","nullable":true},"address":{"type":"string","nullable":true}},"required":["name","phone"]},"PublicOrderDto":{"type":"object","properties":{"id":{"type":"string"},"order_no":{"type":"string","example":"ORD-0319"},"status":{"type":"string","enum":["new","confirmed","out_for_delivery","delivered","cancelled"]},"payment_method":{"type":"string","enum":["unknown","cod","prepaid","kbzpay","wavepay","other"]},"payment_status":{"type":"string","enum":["unpaid","paid","refunded"]},"paid_at":{"type":"string","nullable":true},"currency":{"type":"string","example":"MMK"},"subtotal":{"type":"number","example":20000},"delivery_fee":{"type":"number","example":2000},"total":{"type":"number","example":22000},"note":{"type":"string","nullable":true},"source":{"type":"string","example":"manual"},"tracking_url":{"type":"string","nullable":true,"description":"The customer's tracking page"},"customer":{"$ref":"#/components/schemas/PublicCustomerRefDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PublicOrderItemResponseDto"}},"delivery":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PublicDeliverySummaryDto"}]},"revision":{"type":"number","description":"Send as expected_revision when changing it"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","order_no","status","payment_method","payment_status","paid_at","currency","subtotal","delivery_fee","total","note","source","tracking_url","customer","items","delivery","revision","created_at","updated_at"]},"PublicOrderItemDto":{"type":"object","properties":{"variant_id":{"type":"string","description":"A product variant. Its name and price are used when you leave them out."},"name":{"type":"string","example":"T-shirt (Red, M)","description":"Needed when there is no variant_id"},"qty":{"type":"number","example":2,"minimum":1},"unit_price":{"type":"number","example":12000,"minimum":0,"description":"Price for one; the variant's price when left out"}},"required":["qty"]},"PublicOrderItemResponseDto":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"name":{"type":"string","example":"Cotton T-shirt (Red / M)"},"qty":{"type":"number","example":2},"unit_price":{"type":"number","example":12000},"line_total":{"type":"number","example":24000}},"required":["id","product_id","variant_id","name","qty","unit_price","line_total"]},"PublicOrderStatusDto":{"type":"object","properties":{"status":{"type":"string","enum":["new","confirmed","out_for_delivery","delivered","cancelled"]},"note":{"type":"string","nullable":true},"expected_revision":{"type":"number","description":"The order revision you last saw; the change is refused if someone changed it since"}},"required":["status"]},"PublicPaginationDto":{"type":"object","properties":{"limit":{"type":"number","example":50},"next_cursor":{"type":"string","nullable":true,"description":"Pass as cursor for the next page; null on the last page"},"has_more":{"type":"boolean"}},"required":["limit","next_cursor","has_more"]},"PublicProductDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Cotton T-shirt"},"description":{"type":"string","nullable":true},"option_names":{"example":["Colour","Size"],"type":"array","items":{"type":"string"}},"on_shop_page":{"type":"boolean","description":"Listed on the public shop page"},"archived":{"type":"boolean"},"variants":{"type":"array","items":{"$ref":"#/components/schemas/PublicVariantResponseDto"}},"revision":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string","description":"The latest change to the product or any variant, stock included"}},"required":["id","name","description","option_names","on_shop_page","archived","variants","revision","created_at","updated_at"]},"PublicShopDto":{"type":"object","properties":{"shop":{"$ref":"#/components/schemas/PublicShopInfoDto"},"api_key":{"$ref":"#/components/schemas/PublicApiKeyInfoDto"}},"required":["shop","api_key"]},"PublicShopInfoDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Ma Aye Shop"},"timezone":{"type":"string","example":"Asia/Yangon"}},"required":["id","name","timezone"]},"PublicStockDto":{"type":"object","properties":{"delta":{"type":"number","example":5,"description":"Add (or remove, if negative) this many"},"set":{"type":"number","example":12,"description":"Set stock to this count"},"reason":{"type":"string","enum":["manual_adjust","restock","stock_count"],"default":"manual_adjust"},"note":{"type":"string","nullable":true}}},"PublicUpdateCustomerDto":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"township":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"expected_revision":{"type":"number"}}},"PublicUpdateDeliveryDto":{"type":"object","properties":{"status":{"type":"string","enum":["scheduled","out_for_delivery","delivered"]},"scheduled_at":{"type":"string","format":"date-time","nullable":true}}},"PublicUpdateProductDto":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"option_names":{"type":"array","items":{"type":"string"}},"on_shop_page":{"type":"boolean"},"variants":{"description":"The full list of variants; ones left out are archived","type":"array","items":{"$ref":"#/components/schemas/PublicVariantDto"}},"expected_revision":{"type":"number"}}},"PublicVariantDto":{"type":"object","properties":{"id":{"type":"string","description":"An existing variant when updating; leave out to add one"},"option_values":{"example":["Red","M"],"type":"array","items":{"type":"string"}},"sku":{"type":"string","nullable":true},"price":{"type":"number","example":12000,"minimum":0},"track_stock":{"type":"boolean","default":true},"stock_qty":{"type":"number","description":"Starting stock for a new variant; change it later with the stock endpoint"},"low_stock_at":{"type":"number","nullable":true}},"required":["price"]},"PublicVariantResponseDto":{"type":"object","properties":{"id":{"type":"string"},"option_values":{"example":["Red","M"],"type":"array","items":{"type":"string"}},"label":{"type":"string","example":"Red / M"},"sku":{"type":"string","nullable":true},"price":{"type":"number","example":12000},"track_stock":{"type":"boolean"},"stock_qty":{"type":"number","nullable":true,"description":"null when stock is not tracked"},"low_stock_at":{"type":"number","nullable":true},"low_stock":{"type":"boolean","description":"At or below its low-stock level"},"updated_at":{"type":"string"}},"required":["id","option_values","label","sku","price","track_stock","stock_qty","low_stock_at","low_stock","updated_at"]}}},"security":[{"api-key":[]}]}