01.software Docs

Import a terminal historical Order

Use the SDK for application integration. This read-only reference covers Commerce, Customer Auth, Membership and Events.

All HTTP operations
POST
/api/orders/import

Server sk01_ key bound to an active external-effect integration of the current Live environment. Inserts one already-terminal Order with its line snapshots and imported payment/refund facts in a single transaction; the Order is execution-locked, and both its placedAt and createdAt are orderedAt. The original (integration namespace, origin.storeId, origin.orderId) is the permanent idempotency identity: the same facts replay (X-Idempotent-Replay: true), different facts return 409 idempotency_conflict. orderNumber already used by an Order or Checkout returns 409 conflict. A customer.externalCustomerId that does not resolve to an active Customer link returns 422, and so does any imported time later than the server time. A body that is not JSON returns 400 bad_request; an integration binding that cannot read Customer links returns 403 forbidden; an unavailable Customer link authority or database transaction returns 503 service_unavailable. dryRun runs every check and always rolls back; a dryRun that would create returns order.id null, and a dryRun that replays an existing import returns its id. No inventory, fulfillment, discount, notification, webhook or payment-provider effect occurs.

Authorization

publishableKeybearerAuth
headerX-Publishable-Key<token>

Tenant publishable key for authentication (sent via X-Publishable-Key header)

headerAuthorizationBearer <token>

Public integration credentials: verified opaque sk01_ secret key or pat01_ personal access token; operation policy and read/write scopes still apply. These credentials are not Customer JWTs.

Request Body

application/json
  1. body
origin*
orderNumber*string
Length1 <= length <= 64
orderedAt*string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Formatdate-time
currency*string
Match^[A-Z]{3}$
customer?
customerSnapshot?
shippingAddress?|null
items*array<>
Items1 <= items <= 100
amounts*
payments*array<>
Itemsitems <= 10
refunds?array<>
Itemsitems <= 20
Default[]
cancellation?
fulfillment*string
Value in"fulfilled""unfulfilled"
returned?boolean
purchaseConfirmedAt?string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Formatdate-time
dryRun?boolean

Response Body

Import a terminal historical Order result

application/json
  1. response
dryRun*boolean
replayed*boolean
order*

Examples may be generated from schemas; they are illustrative, not recorded successful API calls. Example snippets may omit required authentication headers.

Example Request
curl -X POST 'https://api.01.software/api/orders/import' \  -H 'Content-Type: application/json' \  -d '{  "origin": {    "integrationId": "497a18ca-284e-40c0-985d-f72be35d468e",    "storeId": "string",    "orderId": "string"  },  "orderNumber": "string",  "orderedAt": "2019-08-24T14:15:22Z",  "currency": "string",  "items": [    {      "title": "string",      "quantity": 1,      "unitPriceMinor": 0,      "discountMinor": 0,      "requiresShipping": true    }  ],  "amounts": {    "subtotalMinor": 0,    "shippingMinor": 0,    "discountMinor": 0,    "totalMinor": 0  },  "payments": [    {      "reference": "string",      "amountMinor": 0,      "paidAt": "2019-08-24T14:15:22Z"    }  ],  "fulfillment": "fulfilled"}'
Example Response
{  "dryRun": true,  "replayed": true,  "order": {    "id": "string",    "orderNumber": "string",    "customer": "string",    "placedAt": "2019-08-24T14:15:22Z",    "financialStatus": "pending",    "fulfillmentStatus": "unfulfilled",    "returnStatus": "no_return",    "confirmationStatus": "unconfirmed",    "primaryDisplayStatus": "pending"  }}