Order

Create Manual Order

Changed on

Description

Create a manual order in Desty Omnichannel using the authenticated merchant and tenant. This feature is in testing and has not been released to production.

Request rules

  • Use the existing Authorization: Bearer <access_token> header. Operator identity is obtained from the authenticated merchant; request-body operator fields are not accepted as the audit identity.
  • Use valid tenant warehouse and Master SKU values. Obtain shippingAddress.districtId from /api/region/list.
  • shippingAddress.postal, courier, and paymentMethod are required by final order validation.
  • Currency is IDR. Send whole-number quantities and amounts where possible. Quantity, paid unit price, shipping fee, and other fees are rounded to integers using HALF_UP.
  • Paid unit price cannot exceed the current Master selling price. Item subtotal is the sum of paid unit price × quantity. Order discount cannot exceed that subtotal. Total = subtotal − order discount + shipping fee + other fees.
  • Available stock is checked in the selected warehouse, including combined component demand from bundles and standalone items. Reservation and deduction are asynchronous; submission validation is not an immediate stock reservation guarantee.
  • The trimmed clientRefNo becomes the order number. Repeated references return DUPLICATE_CLIENT_REF, rather than returning the existing order.
  • Customer tags are applied asynchronously. An existing tag name is reused. Tag assignment is skipped when the customer already has 3 tags, or when a new tag is needed and the tenant already has 15 tags; order creation still succeeds.
  • For subsequent delivery confirmation, use the existing /api/order/confirmDelivery endpoint.

Request example

Resource identifiers below are placeholders or demo values and must be replaced with valid values for the tenant.

{"clientRefNo":"MANUAL-DEMO-001","customer":{"name":"Demo Customer","phone":"+6281234567890"},"shippingAddress":{"districtId":"<districtId from /api/region/list>","addressDetail":"Demo address","postal":"12345"},"warehouseId":123,"items":[{"masterSku":"DEMO-SKU","quantity":1}],"courier":"Custom courier","paymentMethod":"Bank Payment/Transfer","markOrderAsCompleted":false}

Response example

{"code":"0","msg":null,"data":{"orderId":123456789,"displayedOrderSn":"MANUAL-DEMO-001"},"success":true}

Errors

Business, authentication, and rate-limit errors use HTTP 200 with a non-zero code. Unexpected server exceptions use HTTP 500 with SERVER_ERROR. Always inspect code.

codeMeaning
INVALID_PARAMETERMissing, malformed, out-of-range, or invalid warehouse/product parameters
INVALID_TOKENInvalid, expired, or revoked access token
LIMIT_REQUESTExisting request rate limit exceeded
DUPLICATE_CLIENT_REFReference number already exists within the tenant
INVALID_REGIONInvalid shipping district
INSUFFICIENT_STOCKInsufficient available stock in the selected warehouse
SERVER_ERRORDownstream service unavailable or other server error
post/api/order/manual/create

Request

  • Base URL
    https://api.desty.app
  • Auth
    none declared. Required headers: Authorization

Headers

Authorizationstring required

Authorization (Only:Bearer <access_token>)

Request body

clientRefNostring required

Your order reference. Trimmed length: 1–60 characters, without control characters. Must be unique among existing order numbers within the tenant.

warehouseIdinteger required

An active (not archived) Master warehouse ID belonging to the authenticated tenant.

shippingFeenumber

Shipping fee in IDR. Defaults to 0; rounded to a whole number using HALF_UP.

otherFeenumber

Other fees in IDR. Defaults to 0; rounded to a whole number using HALF_UP.

courierstring required

Required courier name, trimmed, at most 100 characters, without control characters. Custom names are supported.

shipmentNostring

Optional tracking number; trimmed length at most 255 characters.

paymentMethodstring required

Required payment method, trimmed, at most 50 characters, without control characters. Custom values are supported. COD is case-insensitive.

sellerNotesstring

Optional seller notes; trimmed length at most 200 characters.

markOrderAsCompletedboolean nullable

True creates a completed order. Omitted, null, or false creates a ready-to-ship order.

Response

successful operation

code'0' | 'INVALID_PARAMETER' | 'INVALID_TOKEN' | 'LIMIT_REQUEST' | 'DUPLICATE_CLIENT_REF' | 'INVALID_REGION' | 'INSUFFICIENT_STOCK' | 'SERVER_ERROR' required

Business result code. 0 indicates success; other values indicate an error.

msgstring nullable

Result message; normally null on success.

successboolean required

True when code equals 0.

Changes