order.create

Create an order from a completed checkout session (server-internal; shopper actor).

Payload

fieldtyperequirednotes
orderIdstring (/^ord_[a-zA-Z0-9]{1,32}$/)yes
customerIdstring (/^cus_[a-zA-Z0-9]{1,32}$/)yes
paymentIdstring (/^pay_[a-zA-Z0-9]{1,32}$/)yes
sessionIdstring (/^cos_[a-zA-Z0-9]{1,32}$/)yes
status"paid" | "pending_cod" | "awaiting_transfer"yes
methodstring (/^[a-z0-9_]{2,32}$/)yes
testbooleanyes
guardStockbooleanyes
channelstring (/^[a-z0-9_]{2,24}$/, default "storefront")no
channelRefstring (≤64 chars)no
legalTermsobject (default {})no
userIdstring (/^usr_[a-zA-Z0-9]{1,32}$/)no
emailstring (/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ≤200 chars)yes
emailNormstring (≤200 chars)yes
phonestring (≤20 chars)yes
billingAddressobjectyescanonical-il address (M6 cargo keys on il_plaka)
namestring (≤120 chars)yes
ilstring (≤40 chars)yes
il_plakastring (/^\d{2}$/)yes
ilcestring (≤60 chars)yes
addressstring (≤500 chars)yes
shippingAddressobject | nullyes
requiresShippingbooleanyes
linesarray<object> (≤50)yes
totalsobjectyes
itemsSubtotalKurusinteger (0..10000000000000)yes
shippingKurusinteger (0..10000000000000)yes
codFeeKurusinteger (0..10000000000000)yes
discountKurusinteger (0..10000000000000)yes
totalKurusinteger (0..10000000000000)yes
saleUrlstring (≤300 chars)yes
taksitCountinteger (1..24)no
pspPaymentIdstring (≤80 chars)no
paidAtstringno
attemptIdstring (/^pat_[a-zA-Z0-9]{1,32}$/)no
consentsobjectyes
docSha256sarray<string (/^[0-9a-f]{64}$/)> (≤2)yes
acceptedAtstringyes
ipstring (≤60 chars)yes
uastring (≤300 chars)yes
digitalWaiverobject | nullyes
digitalWaiverbooleanyes
docsarray<object> (≤2)yes
accessTokenHashstring (/^[0-9a-f]{64}$/)yes

JSON Schema

{
  "$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
}
Generated from the live platform registries at build time — reference pages cannot go stale. Markdown variant: /reference/commands/order.create.md