# `order.create` Create an order from a completed checkout session (server-internal; shopper actor). - **scope**: `checkout` - **storefront-visible** (bumps the catalog generation): no - **destructive**: no ## Payload | field | type | required | notes | |---|---|---|---| | `orderId` | string (/^ord_[a-zA-Z0-9]{1,32}$/) | yes | | | `customerId` | string (/^cus_[a-zA-Z0-9]{1,32}$/) | yes | | | `paymentId` | string (/^pay_[a-zA-Z0-9]{1,32}$/) | yes | | | `sessionId` | string (/^cos_[a-zA-Z0-9]{1,32}$/) | yes | | | `status` | "paid" \| "pending_cod" \| "awaiting_transfer" | yes | | | `method` | string (/^[a-z0-9_]{2,32}$/) | yes | | | `test` | boolean | yes | | | `guardStock` | boolean | yes | | | `channel` | string (/^[a-z0-9_]{2,24}$/, default "storefront") | no | | | `channelRef` | string (≤64 chars) | no | | | `legalTerms` | object (default {}) | no | | | `userId` | string (/^usr_[a-zA-Z0-9]{1,32}$/) | no | | | `email` | string (/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ≤200 chars) | yes | | | `emailNorm` | string (≤200 chars) | yes | | | `phone` | string (≤20 chars) | yes | | | `billingAddress` | object | yes | canonical-il address (M6 cargo keys on il_plaka) | | ` name` | string (≤120 chars) | yes | | | ` il` | string (≤40 chars) | yes | | | ` il_plaka` | string (/^\d{2}$/) | yes | | | ` ilce` | string (≤60 chars) | yes | | | ` address` | string (≤500 chars) | yes | | | `shippingAddress` | object \| null | yes | | | `requiresShipping` | boolean | yes | | | `lines` | array (≤50) | yes | | | `totals` | object | yes | | | ` itemsSubtotalKurus` | integer (0..10000000000000) | yes | | | ` shippingKurus` | integer (0..10000000000000) | yes | | | ` codFeeKurus` | integer (0..10000000000000) | yes | | | ` discountKurus` | integer (0..10000000000000) | yes | | | ` totalKurus` | integer (0..10000000000000) | yes | | | `saleUrl` | string (≤300 chars) | yes | | | `taksitCount` | integer (1..24) | no | | | `pspPaymentId` | string (≤80 chars) | no | | | `paidAt` | string | no | | | `attemptId` | string (/^pat_[a-zA-Z0-9]{1,32}$/) | no | | | `consents` | object | yes | | | ` docSha256s` | array (≤2) | yes | | | ` acceptedAt` | string | yes | | | ` ip` | string (≤60 chars) | yes | | | ` ua` | string (≤300 chars) | yes | | | ` digitalWaiver` | object \| null | yes | | | `digitalWaiver` | boolean | yes | | | `docs` | array (≤2) | yes | | | `accessTokenHash` | string (/^[0-9a-f]{64}$/) | yes | | ### JSON Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "orderId": { "type": "string", "pattern": "^ord_[a-zA-Z0-9]{1,32}$" }, "customerId": { "type": "string", "pattern": "^cus_[a-zA-Z0-9]{1,32}$" }, "paymentId": { "type": "string", "pattern": "^pay_[a-zA-Z0-9]{1,32}$" }, "sessionId": { "type": "string", "pattern": "^cos_[a-zA-Z0-9]{1,32}$" }, "status": { "type": "string", "enum": [ "paid", "pending_cod", "awaiting_transfer" ] }, "method": { "type": "string", "pattern": "^[a-z0-9_]{2,32}$" }, "test": { "type": "boolean" }, "guardStock": { "type": "boolean" }, "channel": { "default": "storefront", "type": "string", "pattern": "^[a-z0-9_]{2,24}$" }, "channelRef": { "type": "string", "minLength": 1, "maxLength": 64 }, "legalTerms": { "default": {}, "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "userId": { "type": "string", "pattern": "^usr_[a-zA-Z0-9]{1,32}$" }, "email": { "type": "string", "maxLength": 200, "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "emailNorm": { "type": "string", "maxLength": 200 }, "phone": { "type": "string", "minLength": 1, "maxLength": 20 }, "billingAddress": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "il": { "type": "string", "minLength": 1, "maxLength": 40 }, "il_plaka": { "type": "string", "pattern": "^\\d{2}$" }, "ilce": { "type": "string", "minLength": 1, "maxLength": 60 }, "address": { "type": "string", "minLength": 1, "maxLength": 500 } }, "required": [ "name", "il", "il_plaka", "ilce", "address" ], "additionalProperties": {}, "description": "canonical-il address (M6 cargo keys on il_plaka)" }, "shippingAddress": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "il": { "type": "string", "minLength": 1, "maxLength": 40 }, "il_plaka": { "type": "string", "pattern": "^\\d{2}$" }, "ilce": { "type": "string", "minLength": 1, "maxLength": 60 }, "address": { "type": "string", "minLength": 1, "maxLength": 500 } }, "required": [ "name", "il", "il_plaka", "ilce", "address" ], "additionalProperties": {}, "description": "canonical-il address (M6 cargo keys on il_plaka)" }, { "type": "null" } ] }, "requiresShipping": { "type": "boolean" }, "lines": { "minItems": 1, "maxItems": 50, "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^oln_[a-zA-Z0-9]{1,32}$" }, "productId": { "type": "string", "pattern": "^prd_[a-zA-Z0-9]{1,32}$" }, "variantId": { "type": "string", "pattern": "^var_[a-zA-Z0-9]{1,32}$" }, "qty": { "type": "integer", "minimum": 1, "maximum": 99 }, "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "variantTitle": { "type": "string", "minLength": 1, "maxLength": 120 }, "sku": { "type": "string", "minLength": 1, "maxLength": 80 }, "unitPriceKurus": { "type": "integer", "minimum": 0, "maximum": 10000000000000 }, "lineTotalKurus": { "type": "integer", "minimum": 0, "maximum": 10000000000000 }, "compareAtKurus": { "type": "integer", "minimum": 0, "maximum": 10000000000000 }, "lowest30dKurus": { "type": "integer", "minimum": 0, "maximum": 10000000000000 }, "requiresShipping": { "type": "boolean" }, "withdrawalException": { "type": "string", "maxLength": 40 }, "exceptionAvailable": { "type": "boolean" }, "taksitCapApplied": { "type": "integer", "minimum": 0, "maximum": 24 } }, "required": [ "id", "productId", "qty", "title", "unitPriceKurus", "lineTotalKurus", "requiresShipping" ], "additionalProperties": false } }, "totals": { "type": "object", "properties": { "itemsSubtotalKurus": { "type": "integer", "minimum": 0, "maximum": 10000000000000 }, "shippingKurus": { "type": "integer", "minimum": 0, "maximum": 10000000000000 }, "codFeeKurus": { "type": "integer", "minimum": 0, "maximum": 10000000000000 }, "discountKurus": { "type": "integer", "minimum": 0, "maximum": 10000000000000 }, "totalKurus": { "type": "integer", "minimum": 0, "maximum": 10000000000000 } }, "required": [ "itemsSubtotalKurus", "shippingKurus", "codFeeKurus", "discountKurus", "totalKurus" ], "additionalProperties": false }, "saleUrl": { "type": "string", "minLength": 1, "maxLength": 300 }, "taksitCount": { "type": "integer", "minimum": 1, "maximum": 24 }, "pspPaymentId": { "type": "string", "minLength": 1, "maxLength": 80 }, "paidAt": { "type": "string" }, "attemptId": { "type": "string", "pattern": "^pat_[a-zA-Z0-9]{1,32}$" }, "consents": { "type": "object", "properties": { "docSha256s": { "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "string", "pattern": "^[0-9a-f]{64}$" } }, "acceptedAt": { "type": "string" }, "ip": { "type": "string", "maxLength": 60 }, "ua": { "type": "string", "maxLength": 300 }, "digitalWaiver": { "anyOf": [ { "type": "object", "properties": { "at": { "type": "string" }, "labelSha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" } }, "required": [ "at", "labelSha256" ], "additionalProperties": false }, { "type": "null" } ] } }, "required": [ "docSha256s", "acceptedAt", "ip", "ua", "digitalWaiver" ], "additionalProperties": false }, "digitalWaiver": { "type": "boolean" }, "docs": { "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^doc_[a-zA-Z0-9]{1,32}$" }, "kind": { "type": "string", "enum": [ "on_bilgilendirme", "mesafeli_sozlesme" ] }, "bodyHtml": { "type": "string", "minLength": 100, "maxLength": 400000 }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "shownAt": { "type": "string" }, "acceptedAt": { "type": "string" } }, "required": [ "id", "kind", "bodyHtml", "sha256", "shownAt", "acceptedAt" ], "additionalProperties": false } }, "accessTokenHash": { "type": "string", "pattern": "^[0-9a-f]{64}$" } }, "required": [ "orderId", "customerId", "paymentId", "sessionId", "status", "method", "test", "guardStock", "email", "emailNorm", "phone", "billingAddress", "shippingAddress", "requiresShipping", "lines", "totals", "saleUrl", "consents", "digitalWaiver", "docs", "accessTokenHash" ], "additionalProperties": false } ```