{
  "swagger": "2.0",
  "info": {
    "title": "Desty Omni OpenAPI (2026.11.06)",
    "version": "last"
  },
  "basePath": "/",
  "tags": [
    {
      "name": "Webhooks",
      "description": null
    },
    {
      "name": "Authentication",
      "description": null
    },
    {
      "name": "Product",
      "description": null
    },
    {
      "name": "Order",
      "description": null
    },
    {
      "name": "Return Order",
      "description": null
    },
    {
      "name": "Inventory",
      "description": null
    },
    {
      "name": "Warehouse",
      "description": null
    }
  ],
  "schemes": [
    "http"
  ],
  "paths": {
    "/yourApiAddress": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "order callback",
        "description": "* when order status change, this webhooks will notify you\n* you should return http status 200 if done success\n\nwe will add accessToken at header, the accessToken is you get from   \"/api/auth/token\" ,\n\n* only if you apply the authority of tenant, we will notify you when order status change\n* you can use accessToken to differentiate omni users.\n* you can use accessToken to verify whether the request is from omni;\n* When you reapply for authorization, we will use the new token to put in the request header,But due to concurrency issues, you need to be compatible with old tokens.Recommended is 1 hour",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "description": "accessToken (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "orderId": {
                  "type": "string",
                  "description": "orderId of omni"
                },
                "orderSn": {
                  "type": "string",
                  "description": "orderId of platform"
                },
                "bookingSn": {
                  "type": "string",
                  "description": "booking order id of booking order"
                },
                "orderType": {
                  "type": "string",
                  "description": "DEFAULT_ORDER、BOOKING_ORDER、MARKETPLACE_HANDLE_ORDER"
                },
                "orderStatusList": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "order status of omni. lazada and tiktok will show in item"
                },
                "subOrderStatusList": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "order sub status list"
                },
                "platformOrderStatusList": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "platform order status list"
                },
                "orderCreateTime": {
                  "type": "number",
                  "description": "create time of order"
                },
                "orderUpdateTime": {
                  "type": "number",
                  "description": "update time of order"
                },
                "createTime": {
                  "type": "number",
                  "description": "order create time of omni"
                },
                "hasPaid": {
                  "type": "boolean",
                  "description": "whether order has paid"
                },
                "orderPaymentTime": {
                  "type": "number"
                },
                "includeTax": {
                  "type": "boolean"
                },
                "buyerNotes": {
                  "type": "string"
                },
                "subTotal": {
                  "type": "number",
                  "description": "order total price"
                },
                "discount": {
                  "type": "number",
                  "description": "order discount"
                },
                "tax": {
                  "type": "number",
                  "description": "order tax"
                },
                "totalPrice": {
                  "type": "number",
                  "description": "finally order price"
                },
                "insuranceCost": {
                  "type": "number"
                },
                "paymentMethod": {
                  "type": "string"
                },
                "platform": {
                  "type": "string",
                  "description": "marketplace"
                },
                "platformName": {
                  "type": "string"
                },
                "preOrder": {
                  "type": "boolean"
                },
                "codOrder": {
                  "type": "boolean",
                  "description": "whether order is cash on delivery"
                },
                "customerInfo": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    }
                  }
                },
                "platformOrderStatus": {
                  "type": "string",
                  "description": "lazada and tiktok will show in item"
                },
                "storeId": {
                  "type": "string",
                  "description": "marketplace store id"
                },
                "storeName": {
                  "type": "string",
                  "description": "marketplace store name"
                },
                "packageCount": {
                  "type": "integer"
                },
                "totalWeight": {
                  "type": "number",
                  "description": "the unit is g"
                },
                "itemList": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "itemOrderId": {
                        "type": "string"
                      },
                      "itemId": {
                        "type": "string",
                        "description": "omni sku id"
                      },
                      "itemCode": {
                        "type": "string"
                      },
                      "itemExternalCode": {
                        "type": "string"
                      },
                      "itemName": {
                        "type": "string"
                      },
                      "orderStatus": {
                        "type": "string"
                      },
                      "platformOrderStatus": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "price": {
                        "type": "number"
                      },
                      "quantity": {
                        "type": "number"
                      },
                      "onHandStock": {
                        "type": "number"
                      },
                      "promotionStock": {
                        "type": "number"
                      },
                      "discountAmount": {
                        "type": "number"
                      },
                      "taxAmount": {
                        "type": "number"
                      },
                      "sellPrice": {
                        "type": "number"
                      },
                      "originalPrice": {
                        "type": "number"
                      },
                      "locationName": {
                        "type": "string",
                        "description": "name of warehouse"
                      },
                      "locationId": {
                        "type": "string",
                        "description": "id of warehouse"
                      },
                      "platformWarehouseId": {
                        "type": "string"
                      },
                      "platformWarehouseName": {
                        "type": "string"
                      },
                      "platformWarehouseAddress": {
                        "type": "string"
                      },
                      "imageUrl": {
                        "type": "string"
                      },
                      "shippingDetail": {
                        "type": "object",
                        "properties": {
                          "shippingCost": {
                            "type": "number"
                          },
                          "shippingFullName": {
                            "type": "string"
                          },
                          "shippingAddress": {
                            "type": "string"
                          },
                          "shippingArea": {
                            "type": "string"
                          },
                          "shippingCity": {
                            "type": "string"
                          },
                          "shippingProvince": {
                            "type": "string"
                          },
                          "shippingPostCode": {
                            "type": "string"
                          },
                          "shippingPhone": {
                            "type": "string"
                          },
                          "deliveryDeadline": {
                            "type": "string"
                          },
                          "trackingNumber": {
                            "type": "string"
                          },
                          "courier": {
                            "type": "string"
                          },
                          "shipper": {
                            "type": "string"
                          },
                          "portCode": {
                            "type": "string"
                          },
                          "regionCode": {
                            "type": "string"
                          },
                          "returnPortCode": {
                            "type": "string"
                          },
                          "isShipped": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  },
                  "description": "order item list"
                },
                "orderEditDetails": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "editTimes": {
                        "type": "integer"
                      },
                      "itemList": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "editItemId": {
                              "type": "string"
                            },
                            "itemCode": {
                              "type": "string"
                            },
                            "itemExternalCode": {
                              "type": "string"
                            },
                            "itemName": {
                              "type": "string"
                            },
                            "imageUrl": {
                              "type": "string"
                            },
                            "price": {
                              "type": "number"
                            },
                            "quantity": {
                              "type": "number"
                            },
                            "locationName": {
                              "type": "string"
                            },
                            "locationId": {
                              "type": "string"
                            },
                            "platformWarehouseId": {
                              "type": "string"
                            },
                            "platformWarehouseName": {
                              "type": "string"
                            },
                            "platformWarehouseAddress": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "cancelBy": {
                  "type": "string"
                },
                "logisticStatus": {
                  "type": "string"
                },
                "cancelReason": {
                  "type": "string"
                },
                "packageOrganizeType": {
                  "type": "string",
                  "description": "Single / Splitted / Combined"
                },
                "sellerDiscount": {
                  "type": "number"
                },
                "otherCost": {
                  "type": "number"
                },
                "isStockReturned": {
                  "type": "boolean"
                },
                "shopifyThirdParty": {
                  "type": "boolean"
                },
                "tiktokNDD": {
                  "type": "boolean"
                },
                "orderEditTimes": {
                  "type": "integer"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {}
            }
          }
        }
      }
    },
    "/api/auth/token": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Access Token Request",
        "description": "Query authorization information based on authorization request information\nThe token is valid for 30 days,need to refresh after expire\nyou will need to put the accessToken on http header on each request of other api",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "applyId": {
                  "type": "string",
                  "description": "apply_id retrieved from apply authorization interface"
                },
                "username": {
                  "type": "string",
                  "description": "Omni main account user's name used on Apply Authorization"
                },
                "mobile": {
                  "type": "string",
                  "description": " Omni main account mobile used on Apply Authorization"
                }
              },
              "required": [
                "applyId",
                "username",
                "mobile"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "string"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "accessToken": {
                      "type": "string",
                      "description": "Access token for every interface request authentication"
                    },
                    "tokenType": {
                      "type": "string",
                      "description": "The token prefix, should be shown as \"Bearer\""
                    },
                    "expireTime": {
                      "type": "number",
                      "description": "token expire time,timestamp"
                    }
                  },
                  "required": [
                    "accessToken",
                    "tokenType",
                    "expireTime"
                  ]
                }
              },
              "required": [
                "code",
                "msg",
                "data"
              ]
            }
          }
        }
      }
    },
    "/api/auth/apply": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Apply Authorization",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "companyName": {
                  "type": "string",
                  "description": "Third-party name"
                },
                "companyEmail": {
                  "type": "string",
                  "description": "Third-party email"
                },
                "username": {
                  "type": "string",
                  "description": "Omni main account user's name"
                },
                "email": {
                  "type": "string",
                  "description": "Omni main account email"
                },
                "mobile": {
                  "type": "string",
                  "description": "Omni main account phone number"
                }
              },
              "required": [
                "companyName",
                "mobile",
                "email",
                "username",
                "companyEmail"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "string"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "applyId": {
                      "type": "string",
                      "description": "Permission request id, used for access token request"
                    }
                  },
                  "required": [
                    "applyId"
                  ]
                }
              },
              "required": [
                "code",
                "msg",
                "data"
              ]
            }
          }
        }
      }
    },
    "/api/product/page": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "List Product",
        "description": "**Interface to retrieve product information list from Desty Omni.**",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization ",
            "in": "header",
            "description": "Authorization  (Only:)",
            "required": true,
            "type": "string",
            "default": ""
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "pageNumber": {
                  "type": "integer"
                },
                "pageSize": {
                  "type": "integer",
                  "description": "max pageSize is 50"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "string"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "pageNumber": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    },
                    "totalPages": {
                      "type": "integer"
                    },
                    "totalCount": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "productName": {
                            "type": "string"
                          },
                          "spuId": {
                            "type": "string"
                          },
                          "isBundleProduct": {
                            "type": "boolean"
                          },
                          "createTime": {
                            "type": "number"
                          },
                          "updateTime": {
                            "type": "number"
                          },
                          "skuInfoList": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "skuId": {
                                  "type": "string"
                                },
                                "skuNumber": {
                                  "type": "string",
                                  "description": "skuCode"
                                },
                                "salesPrice": {
                                  "type": "number"
                                },
                                "image": {
                                  "type": "string"
                                },
                                "isBundleProduct": {
                                  "type": "boolean"
                                },
                                "variantNameOptionList": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "option": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                },
                                "bundleChildSkuList": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "productName": {
                                        "type": "string"
                                      },
                                      "skuNumber": {
                                        "type": "string"
                                      },
                                      "salesPrice": {
                                        "type": "number"
                                      },
                                      "bundleQuantity": {
                                        "type": "number"
                                      }
                                    }
                                  }
                                },
                                "masterInventoryList": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "warehouseId": {
                                        "type": "string"
                                      },
                                      "warehouseName": {
                                        "type": "string"
                                      },
                                      "externalWarehouseId": {
                                        "type": "string"
                                      },
                                      "onHandStock": {
                                        "type": "number"
                                      },
                                      "promotionStock": {
                                        "type": "number"
                                      }
                                    }
                                  }
                                },
                                "bindingMarketplaceSkuList": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "platformName": {
                                        "type": "string"
                                      },
                                      "platformSkuId": {
                                        "type": "string"
                                      },
                                      "platformShopId": {
                                        "type": "string"
                                      },
                                      "price": {
                                        "type": "number",
                                        "description": "Platform sales price (except Tokopedia)"
                                      },
                                      "createTime": {
                                        "type": "number"
                                      },
                                      "updateTime": {
                                        "type": "number"
                                      },
                                      "inventoryInfo": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "platformWarehouseId": {
                                              "type": "string"
                                            },
                                            "platformWarehouseName": {
                                              "type": "string"
                                            },
                                            "stock": {
                                              "type": "number"
                                            },
                                            "price": {
                                              "type": "number",
                                              "description": "Platform sales price (valid only on Tokopedia)"
                                            },
                                            "bindingMasterWarehouseId": {
                                              "type": "string"
                                            }
                                          },
                                          "required": []
                                        }
                                      }
                                    }
                                  }
                                },
                                "baseUnit": {
                                  "type": "string"
                                },
                                "unitList": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "unitName": {
                                        "type": "string"
                                      },
                                      "conversionToBase": {
                                        "type": "number"
                                      },
                                      "isBaseUnit": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "isBaseUnit",
                                      "unitName",
                                      "conversionToBase"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "baseUnit",
                                "unitList"
                              ]
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "pageNumber",
                    "pageSize",
                    "totalPages",
                    "totalCount",
                    "results"
                  ]
                }
              },
              "required": [
                "code",
                "msg",
                "data"
              ]
            }
          }
        }
      }
    },
    "/api/product/sku/detail": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "GET SKU Detail",
        "description": "",
        "parameters": [
          {
            "name": "skuNumber",
            "in": "query",
            "required": true,
            "description": "",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "skuId": {
                      "type": "string"
                    },
                    "skuNumber": {
                      "type": "string",
                      "description": "skuCode"
                    },
                    "salesPrice": {
                      "type": "number"
                    },
                    "image": {
                      "type": "string"
                    },
                    "isBundleProduct": {
                      "type": "boolean"
                    },
                    "variantNameOptionList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "option": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "bundleChildSkuList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "productName": {
                            "type": "string"
                          },
                          "skuNumber": {
                            "type": "string"
                          },
                          "salesPrice": {
                            "type": "number"
                          },
                          "bundleQuantity": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "masterInventoryList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "warehouseId": {
                            "type": "string"
                          },
                          "warehouseName": {
                            "type": "string"
                          },
                          "externalWarehouseId": {
                            "type": "string"
                          },
                          "onHandStock": {
                            "type": "number"
                          },
                          "promotionStock": {
                            "type": "number"
                          }
                        },
                        "required": []
                      }
                    },
                    "bindingMarketplaceSkuList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "platformName": {
                            "type": "string"
                          },
                          "platformSkuId": {
                            "type": "string"
                          },
                          "platformShopId": {
                            "type": "string"
                          },
                          "price": {
                            "type": "number",
                            "description": "Platform sales price (except Tokopedia)"
                          },
                          "createTime": {
                            "type": "string",
                            "mock": {
                              "mock": "@datetime"
                            }
                          },
                          "updateTime": {
                            "type": "string",
                            "mock": {
                              "mock": "@datetime"
                            }
                          },
                          "inventoryInfo": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "platformWarehouseId": {
                                  "type": "string"
                                },
                                "platformWarehouseName": {
                                  "type": "string"
                                },
                                "stock": {
                                  "type": "number"
                                },
                                "price": {
                                  "type": "number",
                                  "description": "Platform sales price (only on Tokopedia)"
                                },
                                "bindingMasterWarehouseId": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "baseUnit": {
                      "type": "string"
                    },
                    "unitList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "unitName": {
                            "type": "string"
                          },
                          "conversionToBase": {
                            "type": "number"
                          },
                          "isBaseUnit": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "unitName",
                          "isBaseUnit",
                          "conversionToBase"
                        ]
                      }
                    }
                  },
                  "description": "data",
                  "required": [
                    "baseUnit",
                    "unitList"
                  ]
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/product/sku/masterPriceUpdate": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Update Master Product Price",
        "description": "<span class=\"colour\" style=\"color:rgb(85, 85, 85)\"><span class=\"colour\" style=\"color:rgb(0, 0, 0)\">API to update Master Product price. An API request will change master product price and the bound marketplace product price.</span></span>",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "skuNumber": {
                  "type": "string",
                  "description": "Master Product SKU Code"
                },
                "price": {
                  "type": "number",
                  "description": "Target sale price. Allowed value: 100 - 150000000"
                }
              },
              "required": [
                "skuNumber",
                "price"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "API response code, always shown as “0”"
                },
                "msg": {
                  "type": "string",
                  "description": "API response message, always shown as “null”"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/product/sku/marketplacePriceUpdate": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Update Marketplace Product Price",
        "description": "API to update Marketplace Product price. An API request will only change the corresponding marketplace product price.",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "platformName": {
                  "type": "string",
                  "description": "Marketplace name: lazada, tokopedia, shopee, tiktok, blibli, zalora, destyStore, destyPos"
                },
                "platformSkuId": {
                  "type": "string",
                  "description": "Marketplace SKU ID, can be retrieved from List Product or GET SKU Detail API"
                },
                "platformShopId": {
                  "type": "string",
                  "description": "Marketplace Shop ID, can be retrieved from List Product or GET SKU Detail API"
                },
                "platformWarehouseId": {
                  "type": "string",
                  "description": "Only required for Tokopedia"
                },
                "price": {
                  "type": "number",
                  "description": "Target sales price"
                }
              },
              "required": [
                "platformName",
                "platformSkuId",
                "platformShopId",
                "price"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "API response code, always shown as “0”"
                },
                "msg": {
                  "type": "string",
                  "description": "API response message, always shown as “null”"
                },
                "data": {
                  "type": "boolean"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/order/manual/create": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Create Manual Order",
        "description": "## Description\n\nCreate a manual order in Desty Omnichannel using the authenticated merchant and tenant. This feature is in testing and has not been released to production.\n\n## Request rules\n\n* 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.\n* Use valid tenant warehouse and Master SKU values. Obtain `shippingAddress.districtId` from `/api/region/list`.\n* `shippingAddress.postal`, `courier`, and `paymentMethod` are required by final order validation.\n* 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.\n* 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.\n* 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.\n* The trimmed `clientRefNo` becomes the order number. Repeated references return `DUPLICATE_CLIENT_REF`, rather than returning the existing order.\n* 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.\n* For subsequent delivery confirmation, use the existing `/api/order/confirmDelivery` endpoint.\n\n## Request example\n\nResource identifiers below are placeholders or demo values and must be replaced with valid values for the tenant.\n\n``` json\n{\"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}\n```\n\n## Response example\n\n``` json\n{\"code\":\"0\",\"msg\":null,\"data\":{\"orderId\":123456789,\"displayedOrderSn\":\"MANUAL-DEMO-001\"},\"success\":true}\n```\n\n## Errors\n\nBusiness, 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`.\n\n| code | Meaning |\n| ---- | ------- |\n| INVALID_PARAMETER | Missing, malformed, out-of-range, or invalid warehouse/product parameters |\n| INVALID_TOKEN | Invalid, expired, or revoked access token |\n| LIMIT_REQUEST | Existing request rate limit exceeded |\n| DUPLICATE\\_CLIENT\\_REF | Reference number already exists within the tenant |\n| INVALID_REGION | Invalid shipping district |\n| INSUFFICIENT_STOCK | Insufficient available stock in the selected warehouse |\n| SERVER_ERROR | Downstream service unavailable or other server error |",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:Bearer <access_token>)",
            "required": true,
            "type": "string",
            "default": "Bearer <access_token>"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "clientRefNo": {
                  "type": "string",
                  "description": "Your order reference. Trimmed length: 1–60 characters, without control characters. Must be unique among existing order numbers within the tenant.",
                  "minLength": 1,
                  "maxLength": 60
                },
                "customer": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Required customer name; trimmed length at most 100 characters.",
                      "maxLength": 100
                    },
                    "phone": {
                      "type": "string",
                      "description": "Required valid phone number; validated and normalized by the customer phone rules. Input length at most 255 characters.",
                      "maxLength": 255
                    },
                    "email": {
                      "type": "string",
                      "description": "Optional valid email address; trimmed length at most 100 characters.",
                      "maxLength": 100
                    },
                    "tag": {
                      "type": "string",
                      "description": "Optional single customer tag; trimmed length at most 15 characters, without control characters. Blank values are ignored.",
                      "maxLength": 15
                    }
                  },
                  "required": [
                    "name",
                    "phone"
                  ]
                },
                "shippingAddress": {
                  "type": "object",
                  "properties": {
                    "districtId": {
                      "type": "string",
                      "description": "A valid Indonesian district ID returned by GET /api/region/list.",
                      "maxLength": 100
                    },
                    "addressDetail": {
                      "type": "string",
                      "description": "Required detailed address; trimmed length at most 500 characters.",
                      "maxLength": 500
                    },
                    "postal": {
                      "type": "string",
                      "description": "Required postal code; trimmed length at most 30 characters.",
                      "maxLength": 30
                    }
                  },
                  "required": [
                    "districtId",
                    "addressDetail",
                    "postal"
                  ]
                },
                "warehouseId": {
                  "type": "integer",
                  "description": "An active (not archived) Master warehouse ID belonging to the authenticated tenant."
                },
                "items": {
                  "type": "array",
                  "minItems": 1,
                  "description": "Non-empty product list. Duplicate Master SKU codes are not allowed. Product details are resolved by the server.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "masterSku": {
                        "type": "string",
                        "description": "Master SKU code, not an internal SKU ID. Trimmed length at most 255 characters.",
                        "maxLength": 255
                      },
                      "quantity": {
                        "type": "number",
                        "description": "Quantity from 1 to 999999. Rounded to a whole number using HALF_UP; send an integer to avoid rounding.",
                        "minimum": 1,
                        "maximum": 999999
                      },
                      "paidPrice": {
                        "type": "number",
                        "description": "Optional paid unit price in IDR; defaults to the current Master selling price and cannot exceed it. Rounded to a whole number using HALF_UP.",
                        "minimum": 0,
                        "maximum": 500000000
                      }
                    },
                    "required": [
                      "masterSku",
                      "quantity"
                    ]
                  }
                },
                "discount": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "fixed: fixed amount in IDR; percent: percentage. Case and surrounding whitespace are ignored.",
                      "enum": [
                        "fixed",
                        "percent"
                      ]
                    },
                    "value": {
                      "type": "number",
                      "description": "Non-negative discount value. Percentage cannot exceed 100; the calculated discount cannot exceed the item subtotal.",
                      "minimum": 0
                    }
                  },
                  "description": "Optional order-level discount. Supply both type and value when applying a discount."
                },
                "shippingFee": {
                  "type": "number",
                  "description": "Shipping fee in IDR. Defaults to 0; rounded to a whole number using HALF_UP.",
                  "minimum": 0,
                  "maximum": 500000000,
                  "default": 0
                },
                "otherFee": {
                  "type": "number",
                  "description": "Other fees in IDR. Defaults to 0; rounded to a whole number using HALF_UP.",
                  "minimum": 0,
                  "maximum": 500000000,
                  "default": 0
                },
                "courier": {
                  "type": "string",
                  "description": "Required courier name, trimmed, at most 100 characters, without control characters. Custom names are supported.",
                  "minLength": 1,
                  "maxLength": 100
                },
                "shipmentNo": {
                  "type": "string",
                  "description": "Optional tracking number; trimmed length at most 255 characters.",
                  "maxLength": 255
                },
                "paymentMethod": {
                  "type": "string",
                  "description": "Required payment method, trimmed, at most 50 characters, without control characters. Custom values are supported. COD is case-insensitive.",
                  "minLength": 1,
                  "maxLength": 50
                },
                "sellerNotes": {
                  "type": "string",
                  "description": "Optional seller notes; trimmed length at most 200 characters.",
                  "maxLength": 200
                },
                "markOrderAsCompleted": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "default": false,
                  "description": "True creates a completed order. Omitted, null, or false creates a ready-to-ship order."
                }
              },
              "required": [
                "clientRefNo",
                "customer",
                "shippingAddress",
                "warehouseId",
                "items",
                "courier",
                "paymentMethod"
              ],
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Business result code. 0 indicates success; other values indicate an error.",
                  "enum": [
                    "0",
                    "INVALID_PARAMETER",
                    "INVALID_TOKEN",
                    "LIMIT_REQUEST",
                    "DUPLICATE_CLIENT_REF",
                    "INVALID_REGION",
                    "INSUFFICIENT_STOCK",
                    "SERVER_ERROR"
                  ]
                },
                "msg": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Result message; normally null on success."
                },
                "data": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "orderId": {
                      "type": "integer",
                      "description": "Internal order ID (Java Long). Clients must preserve 64-bit integer precision."
                    },
                    "displayedOrderSn": {
                      "type": "string",
                      "description": "Final displayed order number, equal to the trimmed clientRefNo."
                    }
                  },
                  "required": [
                    "orderId",
                    "displayedOrderSn"
                  ],
                  "description": "Response data on success; null on failure."
                },
                "success": {
                  "type": "boolean",
                  "description": "True when code equals 0."
                }
              },
              "required": [
                "code",
                "success"
              ],
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        }
      }
    },
    "/api/region/list": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "List Indonesian Districts",
        "description": "## Description\nList Indonesian provinces, cities, and districts as paginated district records. Use `districtId` when creating a manual order. This feature is in testing and has not been released to production.\n\nUse the existing merchant-tenant Bearer token. Results are sorted lexicographically by `districtId`. A page beyond the last page returns an empty `results` array while retaining the totals. No request body is required.\n\nExample: `GET /api/region/list?pageNumber=1&pageSize=500`\n\nThe shared pagination fields are `pageNumber`, `pageSize`, `totalCount`, `totalPages`, and `results`.\n\n```json\n{\"code\":\"0\",\"msg\":null,\"data\":{\"pageNumber\":1,\"pageSize\":500,\"totalCount\":1,\"totalPages\":1,\"results\":[{\"districtId\":\"<actual district ID>\",\"province\":\"Demo province\",\"city\":\"Demo city\",\"district\":\"Demo district\"}]},\"success\":true}\n```\n\n## Errors\n- `INVALID_PARAMETER`: pageNumber is below 1, pageSize is outside 1–500, or a parameter has an invalid format.\n- `INVALID_TOKEN`: authentication failed.\n- `LIMIT_REQUEST`: existing request rate limit exceeded.\n- `SERVER_ERROR`: downstream service unavailable or another server error.\n\nBusiness, authentication, and rate-limit errors use HTTP 200; unexpected exceptions use HTTP 500. Always inspect the response `code`.\n",
        "consumes": [
          "text/plain"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:Bearer <access_token>)",
            "required": true,
            "type": "string",
            "default": "Bearer <access_token>"
          },
          {
            "name": "pageNumber",
            "in": "query",
            "required": false,
            "description": "Page number; defaults to 1, minimum 1.",
            "type": "string"
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Page size; defaults to 500, range 1–500.",
            "type": "string"
          },
          {
            "name": "raw",
            "in": "body",
            "description": "raw paramter",
            "schema": {
              "type": "string",
              "format": "binary",
              "default": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Business result code. 0 indicates success; other values indicate an error.",
                  "enum": [
                    "0",
                    "INVALID_PARAMETER",
                    "INVALID_TOKEN",
                    "LIMIT_REQUEST",
                    "SERVER_ERROR"
                  ]
                },
                "msg": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Result message; normally null on success."
                },
                "data": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "pageNumber": {
                      "type": "integer",
                      "description": "Current page number."
                    },
                    "pageSize": {
                      "type": "integer",
                      "description": "Page size."
                    },
                    "totalCount": {
                      "type": "integer",
                      "description": "Total number of districts."
                    },
                    "totalPages": {
                      "type": "integer",
                      "description": "Total number of pages."
                    },
                    "results": {
                      "type": "array",
                      "description": "District records on the requested page.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "districtId": {
                            "type": "string",
                            "description": "District ID to use as shippingAddress.districtId."
                          },
                          "province": {
                            "type": "string",
                            "description": "Province name."
                          },
                          "city": {
                            "type": "string",
                            "description": "City name."
                          },
                          "district": {
                            "type": "string",
                            "description": "District name."
                          }
                        },
                        "required": [
                          "districtId",
                          "province",
                          "city",
                          "district"
                        ]
                      }
                    }
                  },
                  "required": [
                    "pageNumber",
                    "pageSize",
                    "totalCount",
                    "totalPages",
                    "results"
                  ],
                  "description": "Response data on success; null on failure."
                },
                "success": {
                  "type": "boolean",
                  "description": "True when code equals 0."
                }
              },
              "required": [
                "code",
                "success"
              ],
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        }
      }
    },
    "/api/order/page": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "List Order",
        "description": "<span class=\"colour\" style=\"color:rgb(0, 0, 0)\">API to retrieve multiple order information from Desty Omnichannel. The information provided is not as complete as the Order Detail. Use List Order API to retrieve orderId then subsequently request GET Order Detail API.</span>",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "description": "Supported marketplace name: lazada, tokopedia, shopee, tiktok, blibli, zalora, destyStore, destyPos"
                },
                "startDate": {
                  "type": "number",
                  "mock": {
                    "mock": "@timestamp"
                  },
                  "description": "Order create time (Start time) using unix timestamp in milliseconds"
                },
                "endDate": {
                  "type": "number",
                  "description": "Order create time (Finish time) using unix timestamp in milliseconds"
                },
                "status": {
                  "type": "string",
                  "description": "Order status: Unpaid, New_Orders, Ready_To_Ship, Shipping, Completed, Cancellations, Returns"
                },
                "pageNumber": {
                  "type": "integer",
                  "description": "The number of the order pages. One pageNumber contains 500 pageSize."
                },
                "pageSize": {
                  "type": "integer",
                  "description": "The number of orders within a page. Already set to 500 by default."
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "pageNumber": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer",
                      "description": "Maximum pageSize is set to 500 by default"
                    },
                    "totalPages": {
                      "type": "integer"
                    },
                    "totalCount": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "orderId": {
                            "type": "string"
                          },
                          "orderSn": {
                            "type": "string"
                          },
                          "bookingSn": {
                            "type": "string"
                          },
                          "orderType": {
                            "type": "string"
                          },
                          "orderStatusList": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "platformOrderStatusList": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "orderCreateTime": {
                            "type": "number",
                            "mock": {
                              "mock": "@timestamp"
                            },
                            "description": "timestamp"
                          },
                          "orderUpdateTime": {
                            "type": "number",
                            "mock": {
                              "mock": "@timestamp"
                            },
                            "description": "timestamp"
                          },
                          "createTime": {
                            "type": "number",
                            "mock": {
                              "mock": "@timestamp"
                            },
                            "description": "timestamp"
                          },
                          "hasPaid": {
                            "type": "boolean"
                          },
                          "platform": {
                            "type": "string"
                          },
                          "platformName": {
                            "type": "string"
                          },
                          "storeId": {
                            "type": "string"
                          },
                          "storeName": {
                            "type": "string"
                          },
                          "codOrder": {
                            "type": "boolean"
                          },
                          "cancelBy": {
                            "type": "string"
                          },
                          "logisticStatus": {
                            "type": "string"
                          },
                          "orderPaymentTime": {
                            "type": "number"
                          },
                          "cancelReason": {
                            "type": "string"
                          },
                          "preOrder": {
                            "type": "boolean"
                          },
                          "trackingNumberList": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "packageOrganizedType": {
                            "type": "string",
                            "description": "Single / Splitted / Combined"
                          },
                          "shippedStatus": {
                            "type": "string",
                            "description": "NotShipped / PartiallyShipped / AllShipped"
                          },
                          "pickupCode": {
                            "type": "string"
                          },
                          "isStockReturned": {
                            "type": "boolean",
                            "description": "Whether putting back stock in Omni has been processed"
                          },
                          "shopifyThirdParty": {
                            "type": "boolean",
                            "description": "Whether an order is using Shopify third party app or not  (boolean value will only be displayed for Shopify order)"
                          },
                          "tiktokNDD": {
                            "type": "boolean",
                            "description": "Whether an order is using TikTok NDD or not (boolean value will only be displayed for TikTok order)"
                          },
                          "orderEditTimes": {
                            "type": "integer",
                            "description": "The number of times the order has been edited"
                          }
                        }
                      }
                    }
                  },
                  "description": "data"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/order/detail": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get Order Detail",
        "description": "<span class=\"colour\" style=\"color:rgb(0, 0, 0)\"><span><span>API to retrieve specific order information from Desty Omnichannel. An API request will only show one order information.</span></span></span>",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:)",
            "required": true,
            "type": "string",
            "default": ""
          },
          {
            "name": "orderId",
            "in": "query",
            "required": true,
            "description": "Desty Omnichannel internal Order ID retrieved from List Order API or Order Webhook, not marketplace Order ID",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "API response code, always shown as “0”"
                },
                "msg": {
                  "type": "string",
                  "description": "API response message, always shown as “null”"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "orderId": {
                      "type": "string",
                      "description": "Desty Omnichannel Order ID, not marketplace Order ID"
                    },
                    "orderSn": {
                      "type": "string",
                      "description": "Marketplace Order ID"
                    },
                    "bookingSn": {
                      "type": "string",
                      "description": "Marketplace Booking ID for Pengiriman Kilat Shopee (Shown if orderType = BOOKING_ORDER)"
                    },
                    "orderType": {
                      "type": "string",
                      "description": "DEFAULT_ORDER = Regular oder, \nMARKETPLACE_HANDLE_ORDER = Order handled and fulfilled by marketplace,\nBOOKING_ORDER = Shopee Advance Fulfillment Booking Order (Pengiriman Kilat)"
                    },
                    "orderStatusList": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Desty Omnichannel status: Unpaid, New_Orders, Ready_To_Ship, Shipping, Completed, Cancellations, Returns"
                    },
                    "subOrderStatusList": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Desty Omnichannel sub-status to distinguish order that has been arranged shipment (RTS) under “Ready_To_Ship” orderStatus. Value: To Process, Processed"
                    },
                    "platformOrderStatusList": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Marketplace order status"
                    },
                    "orderCreateTime": {
                      "type": "number",
                      "mock": {
                        "mock": "@timestamp"
                      },
                      "description": "Order create time start time using unix timestamp in milliseconds (Created time in marketplace)"
                    },
                    "orderUpdateTime": {
                      "type": "number",
                      "mock": {
                        "mock": "@timestamp"
                      },
                      "description": "Order update time start time using unix timestamp in milliseconds (Update time in marketplace; upon status change)"
                    },
                    "createTime": {
                      "type": "number",
                      "mock": {
                        "mock": "@timestamp"
                      },
                      "description": "Order create time start time using unix timestamp in milliseconds (Created time in Desty Omnichannel)"
                    },
                    "hasPaid": {
                      "type": "boolean",
                      "description": "true or false. true = order already paid; false = unpaid"
                    },
                    "orderPaymentTime": {
                      "type": "number",
                      "description": "Order payment time using unix timestamp in milliseconds (Payment time in marketplace)",
                      "mock": {
                        "mock": "@timestamp"
                      }
                    },
                    "includeTax": {
                      "type": "boolean",
                      "description": "true or false. true = order has tax; false = no tax"
                    },
                    "buyerNotes": {
                      "type": "string",
                      "description": "Order marketplace buyer notes"
                    },
                    "subTotal": {
                      "type": "number",
                      "description": "[Seller Sales Information & Buyer Payment] Order subtotal, sum up price of the item price (After product discount)"
                    },
                    "discount": {
                      "type": "number",
                      "description": "[Buyer Payment] Combined discount amount from platform and seller (Not product discount)"
                    },
                    "tax": {
                      "type": "number",
                      "description": "[Buyer Payment] Order-level tax. Usually shown as “0” because marketplace doesn’t put the tax on order level "
                    },
                    "totalPrice": {
                      "type": "number",
                      "description": "[Buyer Payment] Total amount that buyer paid for the order"
                    },
                    "totalSales": {
                      "type": "number"
                    },
                    "insuranceCost": {
                      "type": "number",
                      "description": "[Buyer Payment] Shipping insurance"
                    },
                    "paymentMethod": {
                      "type": "string",
                      "description": "Payment method name provided by corresponding marketplace"
                    },
                    "platform": {
                      "type": "string",
                      "description": "Always shown as “desty”"
                    },
                    "platformName": {
                      "type": "string",
                      "description": "Marketplace name: lazada, tokopedia, shopee, tiktok, blibli, zalora, destyStore, destyPos"
                    },
                    "preOrder": {
                      "type": "boolean",
                      "description": "true or false. true = preOrder; false = non-preOrder"
                    },
                    "codOrder": {
                      "type": "boolean",
                      "description": "true or false. true = COD payment; false = non-COD"
                    },
                    "storeId": {
                      "type": "string",
                      "description": "Marketplace Store ID"
                    },
                    "storeName": {
                      "type": "string",
                      "description": "Marketplace Store Name"
                    },
                    "packageCount": {
                      "type": "integer",
                      "description": "Package number, could be more than 1 if the order is split"
                    },
                    "totalWeight": {
                      "type": "number",
                      "description": "Order total item weight in gram"
                    },
                    "customerInfo": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Customer account name on the marketplace"
                        },
                        "phone": {
                          "type": "string",
                          "description": "Customer phone number. Usually shown as “null”"
                        },
                        "email": {
                          "type": "string",
                          "description": "Customer email. Usually shown as “null”"
                        }
                      }
                    },
                    "itemList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "itemOrderId": {
                            "type": "string",
                            "description": "Item Order ID"
                          },
                          "itemId": {
                            "type": "string",
                            "description": "Item ID"
                          },
                          "itemCode": {
                            "type": "string",
                            "description": "Master Product SKU Code (Shown as \"null\" if the ordered marketplace product isn't bound to master product)"
                          },
                          "itemExternalCode": {
                            "type": "string",
                            "description": "Marketplace Product SKU Code"
                          },
                          "itemName": {
                            "type": "string",
                            "description": "Product name"
                          },
                          "orderStatus": {
                            "type": "string",
                            "description": "Desty Omnichannel status: Unpaid, New_Orders, Ready_To_Ship, Shipping, Completed, Cancellations, Returns"
                          },
                          "platformOrderStatus": {
                            "type": "string",
                            "description": "Marketplace order status"
                          },
                          "description": {
                            "type": "string",
                            "description": "Product description"
                          },
                          "price": {
                            "type": "number",
                            "description": "Product price before discount (Same as originalPrice)"
                          },
                          "quantity": {
                            "type": "number",
                            "description": "Product order quantity"
                          },
                          "onHandStock": {
                            "type": "number",
                            "description": "Latest product On Hand stock"
                          },
                          "promotionStock": {
                            "type": "number",
                            "description": "Latest stock that is locked for upcoming marketplaces' promotion activities. Available qty will be deducted for Promotion Qty"
                          },
                          "discountAmount": {
                            "type": "number",
                            "description": "Product discount amount. Calculate manually if the value shows null or 0 (Due to the marketplace not send the product discount value to Desty).\n\nProduct discount = originalPrice - sellPrice"
                          },
                          "taxAmount": {
                            "type": "number",
                            "description": "Product level tax. Usually shown as “null” because the marketplace doesn’t put the tax on product level"
                          },
                          "sellPrice": {
                            "type": "number",
                            "description": "Product price after discount"
                          },
                          "originalPrice": {
                            "type": "number",
                            "description": "Product price before discount"
                          },
                          "locationName": {
                            "type": "string",
                            "description": "Master warehouse name. If marketplace warehouse binds to Desty Master Warehouse then locationName is using Desty's corresponding Master Warehouse name"
                          },
                          "locationId": {
                            "type": "string",
                            "description": "Master warehouse ID. If marketplace warehouse binds to Desty Master Warehouse then locationId is using Desty's corresponding Master Warehouse ID"
                          },
                          "platformWarehouseId": {
                            "type": "string",
                            "description": "Marketplace warehouse ID"
                          },
                          "platformWarehouseName": {
                            "type": "string",
                            "description": "Marketplace warehouse name"
                          },
                          "platformWarehouseAddress": {
                            "type": "string",
                            "description": "Marketplace warehouse address"
                          },
                          "imageUrl": {
                            "type": "string",
                            "description": "Marketplace product main image URL"
                          },
                          "returnQuantity": {
                            "type": "number"
                          },
                          "shippingDetail": {
                            "type": "object",
                            "properties": {
                              "shippingCost": {
                                "type": "number",
                                "description": "[Buyer Payment] Shipping fee paid by customer"
                              },
                              "shippingFullName": {
                                "type": "string",
                                "description": "Order receiver name"
                              },
                              "shippingAddress": {
                                "type": "string",
                                "description": "Order receiver address"
                              },
                              "shippingArea": {
                                "type": "string",
                                "description": "Order receiver area"
                              },
                              "shippingCity": {
                                "type": "string",
                                "description": "Order receiver city"
                              },
                              "shippingProvince": {
                                "type": "string",
                                "description": "Order receiver province"
                              },
                              "shippingPostCode": {
                                "type": "string",
                                "description": "Order receiver postcode"
                              },
                              "shippingPhone": {
                                "type": "string",
                                "description": "Order receiver phone number"
                              },
                              "deliveryDeadline": {
                                "type": "string",
                                "mock": {
                                  "mock": "@datetime"
                                },
                                "description": "Delivery deadline using unix timestamp in milliseconds"
                              },
                              "trackingNumber": {
                                "type": "string",
                                "description": "Courier tracking number"
                              },
                              "packageId": {
                                "type": "string",
                                "description": "Package ID"
                              },
                              "courier": {
                                "type": "string",
                                "description": "Shipping Courier"
                              },
                              "shipper": {
                                "type": "string",
                                "description": "Shipping Courier"
                              },
                              "portCode": {
                                "type": "string",
                                "description": "Port Code displayed on the shipping label"
                              },
                              "regionCode": {
                                "type": "string",
                                "description": "Region Code displayed on the shipping label"
                              },
                              "returnPortCode": {
                                "type": "string",
                                "description": "Return Port Code displayed on the shipping label"
                              },
                              "isShipped": {
                                "type": "boolean",
                                "description": "true or false. true = order is already shipped; false = order is not shipped yet"
                              }
                            }
                          }
                        }
                      }
                    },
                    "orderEditDetails": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "editTimes": {
                            "type": "integer",
                            "description": "Order editing sequence number (max. 3 edit)"
                          },
                          "itemList": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "editItemId": {
                                  "type": "string",
                                  "description": "Item ID after being edited"
                                },
                                "itemId": {
                                  "type": "string",
                                  "description": "Product Item ID"
                                },
                                "itemCode": {
                                  "type": "string",
                                  "description": "Master product SKU"
                                },
                                "itemExternalCode": {
                                  "type": "string"
                                },
                                "itemName": {
                                  "type": "string",
                                  "description": "Product name"
                                },
                                "imageUrl": {
                                  "type": "string",
                                  "description": "Product image URL"
                                },
                                "price": {
                                  "type": "number",
                                  "description": "Product price"
                                },
                                "quantity": {
                                  "type": "number",
                                  "description": "Latest edited product quantity"
                                },
                                "locationName": {
                                  "type": "string",
                                  "description": "Master warehouse name. If marketplace warehouse binds to Desty Master Warehouse then locationName is using Desty's corresponding Master Warehouse name"
                                },
                                "locationId": {
                                  "type": "string",
                                  "description": "Master warehouse ID. If marketplace warehouse binds to Desty Master Warehouse then locationId is using Desty's corresponding Master Warehouse ID"
                                },
                                "platformWarehouseId": {
                                  "type": "string",
                                  "description": "Marketplace warehouse ID"
                                },
                                "platformWarehouseName": {
                                  "type": "string",
                                  "description": "Marketplace warehouse name"
                                },
                                "platformWarehouseAddress": {
                                  "type": "string",
                                  "description": "Marketplace warehouse address"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "cancelBy": {
                      "type": "string",
                      "description": "Cancellation source"
                    },
                    "logisticStatus": {
                      "type": "string",
                      "description": "Logistic status for Shopee"
                    },
                    "cancelReason": {
                      "type": "string",
                      "description": "Cancellation reason from marketplace"
                    },
                    "packageOrganizeType": {
                      "type": "string",
                      "description": "Package type if the package order is split: Single, Splitted, Combined"
                    },
                    "pickupCode": {
                      "type": "string",
                      "description": "Pickup Code for Shopee Instant and Same day courier"
                    },
                    "refundAmount": {
                      "type": "number",
                      "description": "[Seller Sales Information] Total refund amount if there’s an order refund"
                    },
                    "sellerDiscount": {
                      "type": "number",
                      "description": "[Seller Sales Information] Total discount charged to seller"
                    },
                    "totalInvoice": {
                      "type": "number",
                      "description": "[Seller Sales Information] Total invoice is an amount that excludes service fee and shipping fees. totalInvoice = subTotal - refundAmount - sellerDiscount"
                    },
                    "finalShippingFee": {
                      "type": "number",
                      "description": "[Seller Sales Information] Amount of shipping fee charged to seller"
                    },
                    "serviceFee": {
                      "type": "number",
                      "description": "[Seller Sales Information] Amount of marketplace service fee charged to seller"
                    },
                    "escrowAmount": {
                      "type": "string",
                      "description": "[Seller Sales Information] Escrow amount (penyelesaian pembayaran). Only for Shopee and TikTok."
                    },
                    "otherCost": {
                      "type": "number",
                      "description": "[Buyer Payment] Any other cost charged to buyer"
                    },
                    "isStockReturned": {
                      "type": "boolean",
                      "description": "Whether putting back stock in Omni has been processed"
                    },
                    "shopifyThirdParty": {
                      "type": "boolean",
                      "description": "Whether an order is using Shopify third party app or not  (boolean value will only be displayed for Shopify order)"
                    },
                    "tiktokNDD": {
                      "type": "boolean",
                      "description": "Whether an order is using TikTok NDD or not (boolean value will only be displayed for TikTok order)"
                    },
                    "orderEditTimes": {
                      "type": "integer",
                      "description": "The number of times the order has been edited\t"
                    },
                    "hasReturn": {
                      "type": "boolean"
                    },
                    "returnOrderIdList": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  },
                  "description": "data"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        }
      }
    },
    "/api/order/accept": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Accept Order",
        "description": "only support tokopedia",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization ",
            "in": "header",
            "description": "Authorization  (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "orderId": {
                  "type": "string",
                  "description": "omni order no"
                }
              },
              "required": [
                "orderId"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "string"
                },
                "data": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "msg"
              ]
            }
          }
        }
      }
    },
    "/api/order/createPackage": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Create Package",
        "description": "<span><span>Only support Lazada, Blibli, and Zalora order with </span></span><span class=\"colour\" style=\"color:rgb(0, 0, 0)\">New_Orders. The entire product within the order package will be created, no splitting to different packages.</span>",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization ",
            "in": "header",
            "description": "Authorization  (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "orderId": {
                  "type": "string",
                  "description": "Desty Omnichannel internal Order ID retrieved from List Order API or Order Webhook, not marketplace Order ID"
                }
              },
              "required": [
                "orderId"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "API response code, always shown as “0”"
                },
                "msg": {
                  "type": "string",
                  "description": "API response message, always shown as “null”"
                },
                "data": {
                  "type": "boolean",
                  "description": "true or false. true = API response is successfully received; false = API response is failed"
                }
              },
              "required": [
                "code",
                "msg",
                "data"
              ]
            }
          }
        }
      }
    },
    "/api/order/pickup": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Request Order Pick Up",
        "description": "for the shipmentinfo . currently only support when order is Delivered by Seller. and support platform is lazada、tiktok、dstore and tokopedia dropoff",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization ",
            "in": "header",
            "description": "Authorization  (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "orderId": {
                  "type": "string",
                  "description": "omni order no"
                },
                "warehouseId": {
                  "type": "string"
                },
                "shipmentInfo": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "orderItemId": {
                        "type": "string"
                      },
                      "trackingNumber": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "orderItemId",
                      "trackingNumber"
                    ]
                  },
                  "description": "when order is Delivered by Seller."
                }
              },
              "required": [
                "orderId",
                "warehouseId"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "string"
                },
                "data": {
                  "type": "boolean"
                }
              },
              "required": [
                "code",
                "msg",
                "data"
              ]
            }
          }
        }
      }
    },
    "/api/order/confirmDelivery": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Request Order Confirm Delivery",
        "description": "currently only support when order is Delivered by Seller. and support platform is lazada、tiktok、dstore and bilbli bigproduct or bopis",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization ",
            "in": "header",
            "description": "Authorization  (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "orderId": {
                  "type": "string",
                  "description": "omni order no"
                },
                "isSuccess": {
                  "type": "boolean",
                  "description": "Whether it was successfully delivered to the buyer"
                },
                "blibliDeliveredDate": {
                  "type": "string"
                },
                "blibliRecipientName": {
                  "type": "string"
                },
                "blibliRecipientStatus": {
                  "type": "string"
                },
                "blibliSettlementCode": {
                  "type": "string"
                }
              },
              "required": [
                "orderId",
                "isSuccess"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "string"
                },
                "data": {
                  "type": "boolean"
                }
              },
              "required": [
                "code",
                "msg",
                "data"
              ]
            }
          }
        }
      }
    },
    "/api/order/print/label/bytes": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "GET Shipping Label File",
        "description": "API to retrieve shipping label, response will directly display the PDF file in byte array file. An API request will only show one shipping label.",
        "parameters": [
          {
            "name": "orderId",
            "in": "query",
            "required": true,
            "description": "Desty Omnichannel internal Order ID retrieved from List Order API or Order Webhook, not marketplace Order ID",
            "type": "string"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Label format options: \"sellercenter\" or \"desty\"",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "string",
              "description": "PDF file byte array"
            }
          }
        }
      }
    },
    "/api/order/print/label": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "GET Shipping Label URL",
        "description": "API to retrieve shipping label, response will show the URL of the PDF file. An API request will only show one shipping label.",
        "parameters": [
          {
            "name": "orderId",
            "in": "query",
            "required": true,
            "description": "Desty Omnichannel internal Order ID retrieved from List Order API or Order Webhook, not marketplace Order ID",
            "type": "string"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Label format options: \"sellercenter\" or \"desty\"",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "API response code, always shown as “0”"
                },
                "msg": {
                  "type": "string",
                  "description": "API response message, always shown as “null”"
                },
                "data": {
                  "type": "string",
                  "description": "URL of PDF. For Tokopedia, will return the URL of HTML, not PDF"
                }
              },
              "required": [
                "code",
                "msg",
                "data"
              ]
            }
          }
        }
      }
    },
    "/api/order/shipping/param/shopee": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "GET Shopee Shipping Parameters",
        "description": "",
        "parameters": [
          {
            "name": "orderId",
            "in": "query",
            "required": true,
            "description": "",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "string"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "shippingCarrier": {
                      "type": "string"
                    },
                    "deliverArea": {
                      "type": "string"
                    },
                    "codAmount": {
                      "type": "number"
                    },
                    "returnFirstSortCode": {
                      "type": "string"
                    },
                    "recipientSortCode": {
                      "type": "object",
                      "properties": {
                        "firstRecipientSortCode": {
                          "type": "string"
                        },
                        "secondRecipientSortCode": {
                          "type": "string"
                        },
                        "thirdRecipientSortCode": {
                          "type": "string"
                        }
                      },
                      "required": []
                    }
                  }
                }
              },
              "required": [
                "code",
                "msg"
              ]
            }
          }
        }
      }
    },
    "/api/order/putBackStock/items": {
      "get": {
        "tags": [
          "Order"
        ],
        "summary": "Get Order Put Back Item Info",
        "description": "<span class=\"colour\" style=\"color:rgb(0, 0, 0)\">API to g</span>et the corresponding bound Master item information of the order. Only DeliveryFailed \"Cancellations\" status orders support putting back stock. Item will automatically be converted to bundled child products if it is a bundled product.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "orderId",
            "in": "query",
            "required": true,
            "description": "Desty Omnichannel internal Order ID retrieved from List Return Order API, not marketplace ID",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuId": {
                        "type": "string"
                      },
                      "skuNumber": {
                        "type": "string",
                        "description": "skuCode"
                      },
                      "quantity": {
                        "type": "number",
                        "description": "The original quantity included in the order"
                      }
                    }
                  },
                  "description": "Returnable Items"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/order/putBackStock": {
      "post": {
        "tags": [
          "Order"
        ],
        "summary": "Order Put Back Stock",
        "description": "<span class=\"colour\" style=\"color:rgb(0, 0, 0)\">API to e</span>xecute product returns for the specified order. <span class=\"colour\" style=\"color:rgb(85, 85, 85)\">Only DeliveryFailed \"Cancellations\" status orders support putting back stock.</span> The returned items must be included in the Get Order Put Back Item Info and the return quantity must be less than or equal to the original order quantity.",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "orderId": {
                  "type": "string",
                  "description": "Desty Omnichannel internal Return Order ID retrieved from List Order API, not marketplace ID"
                },
                "warehouseId": {
                  "type": "string",
                  "description": "warehouse id, only warehouse_id retrieved on externalWarehouseId will be authenticated, mapped, and allowed to put back stock"
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuNumber": {
                        "type": "string",
                        "description": "skuCode"
                      },
                      "putBackQuantity": {
                        "type": "number",
                        "description": "Quantity returned"
                      },
                      "unitCost": {
                        "type": "number",
                        "description": "Required for FIFO/Average user"
                      }
                    },
                    "required": [
                      "skuNumber",
                      "putBackQuantity"
                    ]
                  },
                  "description": "List of returned items"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "required": [
                "orderId",
                "warehouseId"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "boolean",
                  "description": "true or false. true = API response is successfully received; false = API response is failed"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/return-order/detail": {
      "get": {
        "tags": [
          "Return Order"
        ],
        "summary": "Get Return Order Detail",
        "description": "<span class=\"colour\" style=\"color:rgb(0, 0, 0)\">API to retrieve specific return order information from Desty Omnichannel. An API request will only show one order information.</span>",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "returnOrderId",
            "in": "query",
            "required": true,
            "description": "Desty Omnichannel internal Return Order ID retrieved from List Return Order API, not marketplace ID",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "returnOrderId": {
                      "type": "string"
                    },
                    "returnOrderSn": {
                      "type": "string"
                    },
                    "returnType": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "orderId": {
                      "type": "string"
                    },
                    "orderSn": {
                      "type": "string"
                    },
                    "orderCreateTime": {
                      "type": "number",
                      "mock": {
                        "mock": "@timestamp"
                      },
                      "description": "timestamp"
                    },
                    "orderUpdateTime": {
                      "type": "number",
                      "mock": {
                        "mock": "@timestamp"
                      },
                      "description": "timestamp"
                    },
                    "platformName": {
                      "type": "string"
                    },
                    "storeId": {
                      "type": "string"
                    },
                    "storeName": {
                      "type": "string"
                    },
                    "initiator": {
                      "type": "string",
                      "description": "Return Initiator"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "buyerName": {
                      "type": "string"
                    },
                    "courier": {
                      "type": "string"
                    },
                    "shipmentNo": {
                      "type": "string"
                    },
                    "refundAmount": {
                      "type": "string"
                    },
                    "compensationAmount": {
                      "type": "string"
                    },
                    "actionDeadline": {
                      "type": "number",
                      "description": "timestamp",
                      "mock": {
                        "mock": "@timestamp"
                      }
                    },
                    "closeDeadline": {
                      "type": "number",
                      "description": "timestamp",
                      "mock": {
                        "mock": "@timestamp"
                      }
                    },
                    "isStockReturned": {
                      "type": "boolean",
                      "description": "Whether putting back stock in Omni has been processed"
                    },
                    "itemList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "returnItemId": {
                            "type": "string"
                          },
                          "itemId": {
                            "type": "string"
                          },
                          "itemCode": {
                            "type": "string",
                            "description": "Marketplace Sku Code"
                          },
                          "productName": {
                            "type": "string"
                          },
                          "quantity": {
                            "type": "number"
                          },
                          "refundAmount": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "description": "data",
                  "required": []
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/return-order/putBackStock/items": {
      "get": {
        "tags": [
          "Return Order"
        ],
        "summary": "Get Return Order Put Back Item Info",
        "description": "<span class=\"colour\" style=\"color:rgb(0, 0, 0)\">API to g</span>et the corresponding bound Master item information of the return order. Only \"Return\" type and \"Completed\" status orders support putting back stock. Item will automatically be converted to bundled child products if it is a bundled product.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "returnOrderId",
            "in": "query",
            "required": true,
            "description": "Desty Omnichannel internal Return Order ID retrieved from List Return Order API, not marketplace ID",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuId": {
                        "type": "string"
                      },
                      "skuNumber": {
                        "type": "string",
                        "description": "skuCode"
                      },
                      "quantity": {
                        "type": "number",
                        "description": "The original quantity included in the order"
                      }
                    }
                  },
                  "description": "Returnable Items"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/return-order/page": {
      "post": {
        "tags": [
          "Return Order"
        ],
        "summary": "List Return Order",
        "description": "<span class=\"colour\" style=\"color:rgb(0, 0, 0)\">API to retrieve multiple return order information from Desty Omnichannel. The information provided is not as complete as the Return Order Detail. Use List Return Order API to retrieve orderId then subsequently request GET Return Order Detail API.</span>",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "description": "Supported marketplace name: lazada, tokopedia, shopee, tiktok, blibli, zalora, destyStore, destyPos"
                },
                "returnType": {
                  "type": "string",
                  "description": "Return order type. Available value: Return / Refund / Replacement"
                },
                "startDate": {
                  "type": "number",
                  "mock": {
                    "mock": "@timestamp"
                  },
                  "description": "Return order create time (Start time) using unix timestamp in milliseconds"
                },
                "endDate": {
                  "type": "number",
                  "description": "Return order create time (Finish time) using unix timestamp in milliseconds"
                },
                "status": {
                  "type": "string",
                  "description": "Return order status. Available value: Pending / Processing / InDispute / Completed / Cancelled"
                },
                "pageNumber": {
                  "type": "integer",
                  "description": "The number of the pages. Counting starts from 1"
                },
                "pageSize": {
                  "type": "integer",
                  "description": "The number of orders within a page. Already set to 500 by default."
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "pageNumber": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer",
                      "description": "Maximum pageSize is set to 500 by default"
                    },
                    "totalPages": {
                      "type": "integer"
                    },
                    "totalCount": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "returnOrderId": {
                            "type": "string"
                          },
                          "returnOrderSn": {
                            "type": "string"
                          },
                          "returnType": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "orderId": {
                            "type": "string",
                            "description": "The original orderId associated with the return order"
                          },
                          "orderSn": {
                            "type": "string",
                            "description": "The original order serial number associated with the return order"
                          },
                          "orderCreateTime": {
                            "type": "number",
                            "mock": {
                              "mock": "@timestamp"
                            },
                            "description": "timestamp"
                          },
                          "orderUpdateTime": {
                            "type": "number",
                            "description": "timestamp",
                            "mock": {
                              "mock": "@timestamp"
                            }
                          },
                          "platformName": {
                            "type": "string"
                          },
                          "storeId": {
                            "type": "string"
                          },
                          "storeName": {
                            "type": "string"
                          },
                          "initiator": {
                            "type": "string",
                            "description": "Return Initiator"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "buyerName": {
                            "type": "string"
                          },
                          "courier": {
                            "type": "string"
                          },
                          "shipmentNo": {
                            "type": "string"
                          },
                          "refundAmount": {
                            "type": "number"
                          },
                          "compensationAmount": {
                            "type": "number"
                          },
                          "actionDeadline": {
                            "type": "number",
                            "description": "timestamp",
                            "mock": {
                              "mock": "@timestamp"
                            }
                          },
                          "closeDeadline": {
                            "type": "number",
                            "description": "timestamp",
                            "mock": {
                              "mock": "@timestamp"
                            }
                          },
                          "isStockReturned": {
                            "type": "boolean",
                            "description": "Whether putting back stock in Omni has been processed"
                          }
                        }
                      }
                    }
                  },
                  "description": "data"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/return-order/putBackStock": {
      "post": {
        "tags": [
          "Return Order"
        ],
        "summary": "Return Order Put Back Stock",
        "description": "<span class=\"colour\" style=\"color:rgb(0, 0, 0)\">API to e</span>xecute product returns for the specified return order. <span class=\"colour\" style=\"color:rgb(85, 85, 85)\">Only \"Return\" type and \"Completed\" status orders support putting back stock.</span> The returned items must be included in the Get Return Order Put Back Item Info and the return quantity must be less than or equal to the original order quantity.",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:undefined)",
            "required": true,
            "type": "string"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "returnOrderId": {
                  "type": "string",
                  "description": "Desty Omnichannel internal Return Order ID retrieved from List Return Order API, not marketplace ID"
                },
                "warehouseId": {
                  "type": "string",
                  "description": "warehouse id, only warehouse_id retrieved on externalWarehouseId will be authenticated, mapped, and allowed to put back stock"
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuNumber": {
                        "type": "string",
                        "description": "skuCode"
                      },
                      "putBackQuantity": {
                        "type": "number",
                        "description": "Quantity returned"
                      },
                      "unitCost": {
                        "type": "number",
                        "description": "Required for FIFO/Average user"
                      }
                    },
                    "required": [
                      "skuNumber",
                      "putBackQuantity"
                    ]
                  },
                  "description": "List of returned items"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "required": [
                "returnOrderId",
                "warehouseId"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "boolean",
                  "description": "true or false. true = API response is successfully received; false = API response is failed"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/inventory/stock/location/adjust": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "Adjust stock by location",
        "description": "* With FIFO/Average costing enabled, `SYNC` is unsupported and positive `ADD` requires `unitCost` per base unit.\n* SKU-location pairs are processed separately. A failed pair does not roll back successful pairs; SKU-level errors can fail all pairs for that SKU. Check `failureList` for details.\n\n### Request example\n\n``` json\n{\n  \"externalWarehouseId\": \"WH-DEMO\",\n  \"adjustType\": \"ADD\",\n  \"skus\": [\n    {\n      \"skuNumber\": \"SKU-DEMO-1\",\n      \"locations\": [\n        {\n          \"locationId\": 10001,\n          \"quantity\": 5,\n          \"unitCost\": 1000\n        }\n      ]\n    }\n  ]\n}\n```",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:Bearer <access_token>)",
            "required": true,
            "type": "string",
            "default": "Bearer <access_token>"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string",
                  "description": "External warehouse ID returned by POST /api/warehouse/list. Storage must be activated for this warehouse.",
                  "minLength": 1
                },
                "adjustType": {
                  "type": "string",
                  "description": "SYNC sets on-hand; ADD increases it; MINUS decreases it. Values are case-sensitive.",
                  "enum": [
                    "SYNC",
                    "ADD",
                    "MINUS"
                  ]
                },
                "skus": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuNumber": {
                        "type": "string",
                        "description": "Existing Master SKU code. Do not repeat the same SKU in skus[].",
                        "minLength": 1
                      },
                      "uom": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Optional default SKU unit name, matched case-insensitively. locations[].uom takes precedence; omit/empty both to use the base unit."
                      },
                      "locations": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "locationId": {
                              "type": [
                                "string",
                                "integer"
                              ],
                              "description": "Storable location in the selected warehouse, including Default Storage. Organizational locations are not supported. The SKU must already be associated. 64-bit ID; send as a decimal string (recommended) or a number."
                            },
                            "quantity": {
                              "type": "number",
                              "description": "Nonnegative quantity: SYNC sets final on-hand; ADD/MINUS use an increment/decrement. After UOM conversion: 0–999999, up to 6 decimal places. Stock, reservation and in-progress stock-taking checks apply.",
                              "minimum": 0
                            },
                            "uom": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Optional configured SKU unit name, matched case-insensitively. Takes precedence over skus[].uom; if both are omitted/empty, use the base unit."
                            },
                            "unitCost": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Optional cost per BASE unit in IDR; 0–150000000, up to 6 decimal places. Required for a positive ADD when FIFO/Average costing is enabled. Not converted when uom is supplied.",
                              "minimum": 0,
                              "maximum": 150000000
                            }
                          },
                          "required": [
                            "locationId",
                            "quantity"
                          ]
                        },
                        "description": "Location adjustments for this SKU. Do not repeat locationId within the same SKU.",
                        "minItems": 1,
                        "maxItems": 200
                      }
                    },
                    "required": [
                      "skuNumber",
                      "locations"
                    ]
                  },
                  "description": "At most 200 SKU-location pairs across the entire request.",
                  "minItems": 1,
                  "maxItems": 200
                }
              },
              "required": [
                "externalWarehouseId",
                "adjustType",
                "skus"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Business result code: \"0\" on success; otherwise INVALID_PARAMETER, INVALID_TOKEN, LIMIT_REQUEST or SERVER_ERROR. SERVER_ERROR with msg \"Previous setting is still in progress\" means another request for the same tenant is still running; it is retryable after a few seconds."
                },
                "msg": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Result message; normally null on success."
                },
                "data": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "failureList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "locationId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Failed location ID; null when the failure cannot be assigned to a location. 64-bit ID returned as a decimal string."
                          },
                          "skuNumber": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Failed Master SKU code."
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Failure reason."
                          }
                        }
                      },
                      "description": "Failed SKU-location pairs; successful pairs are not listed. code=\"0\" does not mean every pair succeeded. Empty means no reported failures."
                    }
                  },
                  "required": [
                    "failureList"
                  ]
                },
                "success": {
                  "type": "boolean",
                  "description": "True when code equals \"0\"."
                }
              },
              "required": [
                "code",
                "success"
              ]
            }
          }
        }
      }
    },
    "/api/inventory/stock/location/move": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "Move stock between locations within a warehouse",
        "description": "* Moves stock between two already-associated Storage locations in one warehouse; warehouse on-hand total is unchanged. Use `/api/warehouse/location/allocate` first if the normal destination lacks the SKU association.\n* Moves for the same SKU follow input order. Failed moves do not roll back successful moves; retry only failed items to avoid moving stock again.\n\n### Request example\n\n``` json\n{\n  \"externalWarehouseId\": \"WH-DEMO\",\n  \"moves\": [\n    {\n      \"skuNumber\": \"SKU-DEMO-1\",\n      \"fromLocationId\": 10001,\n      \"toLocationId\": 10003,\n      \"quantity\": 2\n    }\n  ]\n}\n```",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:Bearer <access_token>)",
            "required": true,
            "type": "string",
            "default": "Bearer <access_token>"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string",
                  "description": "External warehouse ID returned by POST /api/warehouse/list. Storage must be activated for this warehouse.",
                  "minLength": 1
                },
                "moves": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuNumber": {
                        "type": "string",
                        "description": "Existing Master SKU code.",
                        "minLength": 1
                      },
                      "fromLocationId": {
                        "type": [
                          "string",
                          "integer"
                        ],
                        "description": "Source storable location in the selected warehouse, including Default Storage. The SKU must already be associated. 64-bit ID; send as a decimal string (recommended) or a number."
                      },
                      "toLocationId": {
                        "type": [
                          "string",
                          "integer"
                        ],
                        "description": "Different destination storable location in the same warehouse, including Default Storage. The SKU must already be associated. 64-bit ID; send as a decimal string (recommended) or a number."
                      },
                      "quantity": {
                        "type": "number",
                        "description": "Positive quantity. After UOM conversion: >0 and <=999999, up to 6 decimal places. Source stock/reservation and in-progress stock-taking checks apply.",
                        "minimum": 0,
                        "exclusiveMinimum": true
                      },
                      "uom": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Optional SKU unit name, matched case-insensitively. Omitted/empty uses the base unit."
                      }
                    },
                    "required": [
                      "skuNumber",
                      "fromLocationId",
                      "toLocationId",
                      "quantity"
                    ]
                  },
                  "description": "At most 200 moves. Grouped by SKU; input order is preserved within each SKU. Failed moves do not stop later moves.",
                  "minItems": 1,
                  "maxItems": 200
                }
              },
              "required": [
                "externalWarehouseId",
                "moves"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Business result code: \"0\" on success; otherwise INVALID_PARAMETER, INVALID_TOKEN, LIMIT_REQUEST or SERVER_ERROR. SERVER_ERROR with msg \"Previous setting is still in progress\" means another request for the same tenant is still running; it is retryable after a few seconds."
                },
                "msg": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Result message; normally null on success."
                },
                "data": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "failureList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer",
                            "description": "Zero-based index in the original moves array.",
                            "minimum": 0
                          },
                          "skuNumber": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Failed Master SKU code."
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Failure reason."
                          }
                        },
                        "required": [
                          "index"
                        ]
                      },
                      "description": "Failed moves, identified by zero-based index in the input moves array; successful moves are not listed. code=\"0\" does not mean every move succeeded. Empty means no reported failures."
                    }
                  },
                  "required": [
                    "failureList"
                  ]
                },
                "success": {
                  "type": "boolean",
                  "description": "True when code equals \"0\"."
                }
              },
              "required": [
                "code",
                "success"
              ]
            }
          }
        }
      }
    },
    "/api/inventory/stock/location/query": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "Query stock and SKU allocations by location or SKU",
        "description": "Provide at least one nonempty filter: `locationIds` or `skuNumbers`. When both are supplied, return their intersection. Both pagination fields are required.\n\nReturns existing SKU-location associations only, including zero and negative stock; does not expand descendants.",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:Bearer <access_token>)",
            "required": true,
            "type": "string",
            "default": "Bearer <access_token>"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string",
                  "description": "External warehouse ID returned by POST /api/warehouse/list. Storage must be activated for this warehouse.",
                  "minLength": 1
                },
                "locationIds": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": [
                      "string",
                      "integer"
                    ],
                    "description": "Storage location ID in the selected warehouse, including Default Storage.64-bit ID; send as a decimal string (recommended) or a number."
                  },
                  "description": "Optional exact-location filter, at most 200 entries. IDs must identify storable locations in the selected warehouse, including Default Storage; Organizational locations are rejected. Does not expand descendants.",
                  "maxItems": 200
                },
                "skuNumbers": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string",
                    "description": "Master SKU code."
                  },
                  "description": "Optional SKU filter, at most 200 entries. Unmatched SKU codes produce no rows.",
                  "maxItems": 200
                },
                "pageNumber": {
                  "type": "integer",
                  "description": "Required page number, starting from 1. No default.",
                  "minimum": 1,
                  "format": "int64"
                },
                "pageSize": {
                  "type": "integer",
                  "description": "Required page size (1–200). No default.",
                  "minimum": 1,
                  "maximum": 200,
                  "format": "int64"
                }
              },
              "required": [
                "externalWarehouseId",
                "pageNumber",
                "pageSize"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Business result code: \"0\" on success; otherwise INVALID_PARAMETER, INVALID_TOKEN, LIMIT_REQUEST or SERVER_ERROR."
                },
                "msg": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Result message; normally null on success."
                },
                "data": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "pageNumber": {
                      "type": "integer",
                      "description": "Required page number, starting from 1. No default.",
                      "minimum": 1,
                      "format": "int64"
                    },
                    "pageSize": {
                      "type": "integer",
                      "description": "Required page size (1–200). No default.",
                      "minimum": 1,
                      "maximum": 200,
                      "format": "int64"
                    },
                    "totalCount": {
                      "type": "integer",
                      "description": "Number of matching SKU-location association rows before pagination. Returned as a number.",
                      "format": "int64",
                      "minimum": 0
                    },
                    "totalPages": {
                      "type": "integer",
                      "description": "Total number of result pages.",
                      "format": "int64",
                      "minimum": 0
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "locationId": {
                            "type": "string",
                            "description": "Location ID. 64-bit ID returned as a decimal string."
                          },
                          "path": {
                            "type": "string",
                            "description": "Warehouse name followed by the full location path, separated by ' / ' (space, slash, space), e.g. \"Gudang A / Zone 1 / Bin 01\"."
                          },
                          "isUnassigned": {
                            "type": "boolean",
                            "description": "True for Default Storage."
                          },
                          "skuNumber": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Master SKU code."
                          },
                          "productName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Product name."
                          },
                          "productId": {
                            "type": "string",
                            "description": "Internal Master SKU/product ID. 64-bit ID returned as a decimal string."
                          },
                          "onHand": {
                            "type": "number",
                            "description": "On-hand quantity in the SKU base unit. Decimal number; the number of decimal places varies (e.g. 0, 2, 4.0, 0.000000), so parse it as a decimal."
                          },
                          "reserved": {
                            "type": "number",
                            "description": "Reserved quantity in the SKU base unit. Decimal number; the number of decimal places varies (e.g. 0, 2, 4.0, 0.000000), so parse it as a decimal."
                          },
                          "locationFree": {
                            "type": "number",
                            "description": "onHand minus reserved. Warehouse buffer and promotion stock are not deducted. Decimal number; the number of decimal places varies (e.g. 0, 2, 4.0, 0.000000), so parse it as a decimal."
                          },
                          "stockToMarketplace": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Whether this location contributes stock to marketplaces."
                          }
                        },
                        "required": [
                          "locationId",
                          "path",
                          "isUnassigned",
                          "productId",
                          "onHand",
                          "reserved",
                          "locationFree"
                        ]
                      },
                      "description": "Existing SKU-location associations, including zero/negative stock, sorted by locationId then skuNumber ascending. Quantities use the SKU base unit; unmatched SKU codes yield no rows."
                    }
                  },
                  "required": [
                    "pageNumber",
                    "pageSize",
                    "totalCount",
                    "totalPages",
                    "results"
                  ]
                },
                "success": {
                  "type": "boolean",
                  "description": "True when code equals \"0\"."
                }
              },
              "required": [
                "code",
                "success"
              ]
            }
          }
        }
      }
    },
    "/api/inventory/stock/sync": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "Sync Product Stock",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "warehouseId": {
                  "type": "string",
                  "description": "warehouse id, only warehouse_id retrieved on externalWarehouseId will be authenticated, mapped, and allowed to adjust the stock"
                },
                "stocks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuNumber": {
                        "type": "string",
                        "description": "Master Product SKU Code"
                      },
                      "onHandStock": {
                        "type": "number",
                        "description": "Warehouse on-hand stock for adjustment"
                      },
                      "productName": {
                        "type": "string",
                        "description": "Corresponding product name"
                      },
                      "productId": {
                        "type": "string",
                        "description": "Corresponding product id"
                      },
                      "receivedDate": {
                        "type": "string",
                        "description": "Inventory inbound date"
                      },
                      "storedDate": {
                        "type": "string",
                        "description": "Inventory stored date"
                      },
                      "expiredDate": {
                        "type": "string",
                        "description": "Storing expiry date"
                      },
                      "uom": {
                        "type": "string",
                        "description": "uom"
                      }
                    },
                    "required": []
                  },
                  "description": "stockmax array size is 200"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "failureList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "skuNumber": {
                            "type": "string",
                            "description": "skuNumber"
                          },
                          "reason": {
                            "type": "string",
                            "description": "reason"
                          }
                        }
                      },
                      "description": "failureList is empty,means all have successd"
                    }
                  },
                  "description": "data"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        }
      }
    },
    "/api/inventory/stock/slot/adjust": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "[Retired] Adjust Slot Stock",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string"
                },
                "adjustType": {
                  "type": "string",
                  "description": "SYNC、ADD、MINUS"
                },
                "skus": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuNumber": {
                        "type": "string"
                      },
                      "uom": {
                        "type": "string"
                      },
                      "slots": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "slotId": {
                              "type": "number"
                            },
                            "quantity": {
                              "type": "number",
                              "description": "SYNC :quantity is final value, ADD: quantity is change value, MINUS : quantity is change value"
                            },
                            "uom": {
                              "type": "string",
                              "description": " If `slots[].uom` has a value, use `slots[].uom` as the first priority.If `slots[].uom` has no value, use `skus[].uom`.  If neither has a value, treat it as the base unit."
                            },
                            "unitCost": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "slotId",
                            "quantity"
                          ]
                        }
                      }
                    },
                    "required": [
                      "skuNumber",
                      "slots"
                    ]
                  }
                }
              },
              "required": [
                "externalWarehouseId",
                "adjustType",
                "skus"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "null"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "failureList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slotId": {
                            "type": "number"
                          },
                          "skuNumber": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/inventory/stock/add": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "Increase Product Stock",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "warehouseId": {
                  "type": "string",
                  "description": "warehouse id, only warehouse_id retrieved on externalWarehouseId will be authenticated, mapped, and allowed to adjust the stock"
                },
                "stocks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuNumber": {
                        "type": "string",
                        "description": "Master Product SKU Code"
                      },
                      "stockAdjustment": {
                        "type": "number",
                        "description": "Warehouse on-hand stock adjustment, Greater than or equal to 0"
                      },
                      "unitCost": {
                        "type": "number",
                        "description": "Corresponding Unit Cost Greater than or equal to 0, Required when using cost calculation method"
                      },
                      "productName": {
                        "type": "string",
                        "description": "Corresponding product name"
                      },
                      "productId": {
                        "type": "string",
                        "description": "Corresponding product id"
                      },
                      "receivedDate": {
                        "type": "string",
                        "description": "Inventory inbound date"
                      },
                      "storedDate": {
                        "type": "string",
                        "description": "Inventory stored date"
                      },
                      "expiredDate": {
                        "type": "string",
                        "description": "Storing expiry date"
                      },
                      "uom": {
                        "type": "string",
                        "description": "uom"
                      }
                    },
                    "required": [
                      "skuNumber",
                      "stockAdjustment"
                    ]
                  },
                  "description": "stockmax array size is 200"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "required": [
                "warehouseId",
                "stocks"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "failureList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "skuNumber": {
                            "type": "string",
                            "description": "skuNumber"
                          },
                          "reason": {
                            "type": "string",
                            "description": "reason"
                          }
                        }
                      },
                      "description": "failureList is empty,means all have successd"
                    }
                  },
                  "description": "data"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        }
      }
    },
    "/api/inventory/stock/minus": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "Decrease Product Stock",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "warehouseId": {
                  "type": "string",
                  "description": "warehouse id, only warehouse_id retrieved on externalWarehouseId will be authenticated, mapped, and allowed to adjust the stock"
                },
                "stocks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuNumber": {
                        "type": "string",
                        "description": "Master Product SKU Code"
                      },
                      "stockAdjustment": {
                        "type": "number",
                        "description": "Warehouse on-hand stock adjustment, Greater than or equal to 0"
                      },
                      "productName": {
                        "type": "string",
                        "description": "Corresponding product name"
                      },
                      "productId": {
                        "type": "string",
                        "description": "Corresponding product id"
                      },
                      "receivedDate": {
                        "type": "string",
                        "description": "Inventory inbound date"
                      },
                      "storedDate": {
                        "type": "string",
                        "description": "Inventory stored date"
                      },
                      "expiredDate": {
                        "type": "string",
                        "description": "Storing expiry date"
                      },
                      "uom": {
                        "type": "string",
                        "description": "uom"
                      }
                    },
                    "required": [
                      "skuNumber",
                      "stockAdjustment"
                    ]
                  },
                  "description": "stockmax array size is 200"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "required": [
                "warehouseId",
                "stocks"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "failureList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "skuNumber": {
                            "type": "string",
                            "description": "skuNumber"
                          },
                          "reason": {
                            "type": "string",
                            "description": "reason"
                          }
                        }
                      },
                      "description": "failureList is empty,means all have successd"
                    }
                  },
                  "description": "data"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        }
      }
    },
    "/api/inventory/purchase/page": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "GET Inventory Transfer List",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "pageNumber": {
                  "type": "integer"
                },
                "pageSize": {
                  "type": "integer"
                },
                "type": {
                  "type": "string",
                  "description": "orderType SUPPLIER_PURCHASE、INTERNAL_TRANSFER"
                },
                "status": {
                  "type": "string",
                  "description": "orderStatus   Pending、Partial、Completed、Closed"
                },
                "startDate": {
                  "type": "string",
                  "mock": {
                    "mock": "@datetime"
                  },
                  "description": "startDate"
                },
                "endDate": {
                  "type": "string",
                  "mock": {
                    "mock": "@datetime"
                  },
                  "description": "endDate"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "required": [
                "pageNumber",
                "pageSize"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "pageNumber": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    },
                    "totalCount": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "orderId": {
                            "type": "string"
                          },
                          "orderSn": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "description": "SUPPLIER_PURCHASE、INTERNAL_TRANSFER"
                          },
                          "createTime": {
                            "type": "string"
                          },
                          "transferOriginExternalWarehouseId": {
                            "type": "string"
                          },
                          "transferOrigin": {
                            "type": "string"
                          },
                          "transferDestinationExternalWarehouseId": {
                            "type": "string"
                          },
                          "transferDestination": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "description": "data"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/inventory/purchase/detail": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "GET Inventory Transfer Detail",
        "description": "",
        "parameters": [
          {
            "name": "orderId",
            "in": "query",
            "required": true,
            "description": "",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "orderId": {
                      "type": "integer",
                      "description": "orderId"
                    },
                    "type": {
                      "type": "string",
                      "description": "orderType\nSUPPLIER_PURCHASE  INTERNAL_TRANSFER"
                    },
                    "orderSn": {
                      "type": "string",
                      "description": "orderSn"
                    },
                    "status": {
                      "type": "string",
                      "description": "status  Pending、Partial、Completed、Closed"
                    },
                    "transferOriginExternalWarehouseId": {
                      "type": "string"
                    },
                    "transferOrigin": {
                      "type": "string",
                      "description": "originalName"
                    },
                    "transferDestinationExternalWarehouseId": {
                      "type": "string"
                    },
                    "transferDestination": {
                      "type": "string",
                      "description": "targetName"
                    },
                    "shippingDate": {
                      "type": "string",
                      "description": "shippingDate",
                      "mock": {
                        "mock": "@datetime"
                      }
                    },
                    "shippingCourier": {
                      "type": "string",
                      "description": "shippingCourier"
                    },
                    "paymentMethod": {
                      "type": "string",
                      "description": "paymentMethod"
                    },
                    "note": {
                      "type": "string",
                      "description": "note"
                    },
                    "subTotal": {
                      "type": "number",
                      "description": "subTotal"
                    },
                    "discountPrice": {
                      "type": "number",
                      "description": "discountPrice"
                    },
                    "discountPercentage": {
                      "type": "number",
                      "description": "discountPercentage"
                    },
                    "totalQuantity": {
                      "type": "number",
                      "description": "totalQuantity"
                    },
                    "purchaseTax": {
                      "type": "number",
                      "description": "purchaseTax"
                    },
                    "totalPrice": {
                      "type": "number",
                      "description": "totalPrice"
                    },
                    "taxType": {
                      "type": "string",
                      "description": "taxType"
                    },
                    "taxPercentage": {
                      "type": "number",
                      "description": "taxPercentage"
                    },
                    "supplier": {
                      "type": "object",
                      "properties": {
                        "supplierName": {
                          "type": "string"
                        },
                        "addressInfo": {
                          "type": "object",
                          "properties": {
                            "city": {
                              "type": "string"
                            },
                            "province": {
                              "type": "string"
                            },
                            "postalCode": {
                              "type": "string"
                            },
                            "address": {
                              "type": "string"
                            }
                          }
                        },
                        "contactInfo": {
                          "type": "object",
                          "properties": {
                            "contactName": {
                              "type": "string"
                            },
                            "email": {
                              "type": "string"
                            },
                            "phone": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "required": []
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "skuId": {
                            "type": "integer"
                          },
                          "productName": {
                            "type": "string"
                          },
                          "variantName": {
                            "type": "string"
                          },
                          "mainImageUrl": {
                            "type": "string"
                          },
                          "masterSku": {
                            "type": "string"
                          },
                          "barcode": {
                            "type": "string"
                          },
                          "quantity": {
                            "type": "number",
                            "default": "public static final BigDecimal ZERO;"
                          },
                          "acceptQuantity": {
                            "type": "number"
                          },
                          "originalPrice": {
                            "type": "number",
                            "default": "public static final BigDecimal ZERO;"
                          },
                          "discountPercentage": {
                            "type": "number",
                            "default": "public static final BigDecimal ZERO;"
                          },
                          "discountPrice": {
                            "type": "number",
                            "default": "public static final BigDecimal ZERO;"
                          },
                          "subTotal": {
                            "type": "number",
                            "default": "public static final BigDecimal ZERO;"
                          }
                        }
                      },
                      "description": "items"
                    }
                  },
                  "description": "data"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": ""
            }
          }
        }
      }
    },
    "/api/inventory/purchase/edit": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "POST Edit Inventory Transfer",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "orderId": {
                  "type": "number",
                  "description": "transferOrderId"
                },
                "action": {
                  "type": "string",
                  "description": "\"inbound\" or \"close\" or \"complete\""
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "skuNumber": {
                        "type": "string"
                      },
                      "acceptQuantity": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "skuNumber",
                      "acceptQuantity"
                    ]
                  },
                  "description": "Items represents the inbound products. Empty is not allowed when action is inbound"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#",
              "required": [
                "action",
                "orderId"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "code"
                },
                "msg": {
                  "type": "string",
                  "description": "msg"
                },
                "data": {
                  "type": "boolean",
                  "description": "data"
                }
              },
              "$schema": "http://json-schema.org/draft-04/schema#"
            }
          }
        }
      }
    },
    "/api/warehouse/location/allocate": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "Allocate SKUs to locations",
        "description": "Creates zero-stock SKU-location associations without moving Default Storage or changing quantities.\n\nEach location-SKU pair is processed independently. Check data.failureList for failed pairs with locationId, skuNumber and reason. Requests are limited to 200 original input pairs, including duplicate or invalid inputs. Requests above the limit return INVALID_PARAMETER before allocation.\n\n### Request example\n\n``` json\n{\n  \"externalWarehouseId\": \"WH-DEMO\",\n  \"allocations\": [\n    {\n      \"locationId\": 10001,\n      \"skuNumbers\": [\n        \"SKU-DEMO-1\",\n        \"SKU-DEMO-2\"\n      ]\n    }\n  ]\n}\n```\n\nRemoving a product allocation from a location is not available via OpenAPI. Use Desty Omni (Inventori > Pengaturan Inventori > Penyesuaian Stok) to remove it.",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:Bearer <access_token>)",
            "required": true,
            "type": "string",
            "default": "Bearer <access_token>"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string",
                  "description": "External warehouse ID from /api/warehouse/list. Storage must already be activated.",
                  "minLength": 1
                },
                "allocations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "locationId": {
                        "type": [
                          "string",
                          "integer"
                        ],
                        "description": "Normal STORAGE location in the selected warehouse. Organizational and Default Storage are not supported. 64-bit ID; send as a decimal string (recommended) or a number."
                      },
                      "skuNumbers": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "string",
                          "description": "Existing Master SKU code. Use the exact code."
                        },
                        "description": "Existing Master SKU codes; bundle-parent SKUs are not supported. Omitted/null/empty arrays are skipped."
                      }
                    },
                    "required": [
                      "locationId"
                    ]
                  },
                  "description": "Nonempty allocation groups. Each location-SKU pair is processed independently: an invalid SKU, a duplicate SKU entry or an existing association fails only that pair (see data.failureList); other pairs continue.",
                  "minItems": 1
                }
              },
              "required": [
                "externalWarehouseId",
                "allocations"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Business result code: \"0\" on success; otherwise INVALID_PARAMETER, INVALID_TOKEN, LIMIT_REQUEST or SERVER_ERROR. SERVER_ERROR with msg \"Previous setting is still in progress\" means another request for the same tenant is still running; it is retryable after a few seconds."
                },
                "msg": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Result message; normally null on success."
                },
                "data": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "failureList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "locationId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Failed target location ID; may be null if missing in the request. 64-bit ID returned as a decimal string."
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Failure reason."
                          },
                          "skuNumber": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "SKU number of the failed location-SKU pair, preserving the submitted value. May be null for an invalid or missing SKU input."
                          }
                        },
                        "required": [
                          "skuNumber"
                        ]
                      },
                      "description": "Failed location-SKU pairs, identified by locationId and skuNumber. Successful pairs are omitted. code=\"0\" can include pair failures. Empty means no reported failures."
                    }
                  },
                  "required": [
                    "failureList"
                  ]
                },
                "success": {
                  "type": "boolean",
                  "description": "True when code equals \"0\"."
                }
              },
              "required": [
                "code",
                "success"
              ]
            }
          }
        }
      }
    },
    "/api/warehouse/location/add": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "Create locations in batch",
        "description": "* The selected level determines STORAGE or ORGANIZATIONAL; individual locations cannot override it.\n* Limits include existing locations: 150 direct children per parent, 149 normal warehouse-root locations, and 5,000 locations per warehouse including Default Storage.\n* The first successful creation activates storage\\. The entire creation request is atomic\\. Name validation failures return INVALID\\_PARAMETER with all errors in data\\.errors\\[\\]\\, each containing index\\, locationName and reason\\. The index is zero\\-based and locationName preserves the original input\\. Capacity failures return INVALID\\_PARAMETER with current\\, limit and requested counts in msg and data=null\\. If both limits are exceeded\\, both reasons are returned\\.\n\n### Request example\n\n``` json\n{\n  \"externalWarehouseId\": \"WH-DEMO\",\n  \"parentLocationId\": 10000,\n  \"level\": 7,\n  \"locationNames\": [\n    \"Bin A\",\n    \"Bin B\"\n  ]\n}\n```\n\nDeleting a location is not available via OpenAPI. Use Desty Omni (WMS > Manajemen Penyimpanan) to delete it.",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:Bearer <access_token>)",
            "required": true,
            "type": "string",
            "default": "Bearer <access_token>"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string",
                  "description": "External warehouse ID returned by POST /api/warehouse/list. The warehouse must belong to the authenticated tenant.",
                  "minLength": 1
                },
                "parentLocationId": {
                  "type": [
                    "string",
                    "integer",
                    "null"
                  ],
                  "description": "Optional parent in the same warehouse. Omitted/null creates warehouse-root locations. Default Storage cannot be the parent. 64-bit ID; send as a decimal string (recommended) or a number."
                },
                "level": {
                  "type": "integer",
                  "description": "Target level NUMBER from /api/warehouse/location/level/list, not levelId. Must be deeper than the parent's level.",
                  "minimum": 1,
                  "maximum": 7
                },
                "locationNames": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "Final location name; trimmed, nonblank and at most 20 characters. Names must be unique in the batch and warehouse."
                  },
                  "description": "Final names under the same warehouse, parent and level. Trimmed names must be nonblank, at most 20 characters, and unique within the batch and warehouse.",
                  "minItems": 1,
                  "maxItems": 150
                }
              },
              "required": [
                "externalWarehouseId",
                "level",
                "locationNames"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Business result code: \"0\" on success; otherwise INVALID_PARAMETER, INVALID_TOKEN, LIMIT_REQUEST or SERVER_ERROR. SERVER_ERROR with msg \"Previous setting is still in progress\" means another request for the same tenant is still running; it is retryable after a few seconds."
                },
                "msg": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Result message; normally null on success."
                },
                "data": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "activatedByThisCall": {
                      "type": "boolean",
                      "description": "True when storage was inactive before this successful create request."
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "locationId": {
                            "type": "string",
                            "description": "Created location ID. 64-bit ID returned as a decimal string."
                          },
                          "locationName": {
                            "type": "string",
                            "description": "Created location name."
                          },
                          "level": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 7,
                            "description": "Actual level number of the created location. Skipped levels are supported."
                          },
                          "parentLocationId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "64-bit parent location ID encoded as a decimal string. Null for locations created directly under the warehouse."
                          },
                          "path": {
                            "type": "string",
                            "description": "Full location path prefixed by the warehouse name. Hierarchy segments are separated by \" / \". Uses the final name saved by SCM."
                          }
                        },
                        "required": [
                          "locationId",
                          "locationName",
                          "level",
                          "parentLocationId",
                          "path"
                        ]
                      },
                      "description": "Created locations."
                    },
                    "errors": {
                      "type": "array",
                      "minItems": 1,
                      "description": "All name validation errors. Returned with code INVALID_PARAMETER and no locations created. Each duplicate input occurrence is reported.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer",
                            "minimum": 0,
                            "description": "Zero-based index in the original locationNames array."
                          },
                          "locationName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Original input name, including whitespace or null."
                          },
                          "reason": {
                            "type": "string",
                            "description": "Validation failure reason for this input name."
                          }
                        },
                        "required": [
                          "index",
                          "locationName",
                          "reason"
                        ]
                      }
                    }
                  },
                  "anyOf": [
                    {
                      "required": [
                        "activatedByThisCall",
                        "results"
                      ]
                    },
                    {
                      "required": [
                        "errors"
                      ]
                    }
                  ]
                },
                "success": {
                  "type": "boolean",
                  "description": "True when code equals \"0\"."
                }
              },
              "required": [
                "code",
                "success"
              ]
            }
          }
        }
      }
    },
    "/api/warehouse/location/level/list": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "List company-level location settings",
        "description": "## Description\n\nList company-level location configuration.\n\n## Response example\n\n``` json\n{\n  \"code\": \"0\",\n  \"msg\": null,\n  \"data\": [\n    {\n      \"level\": 7,\n      \"name\": \"Bin\",\n      \"description\": \"Stock storage\",\n      \"storingPreference\": \"STORAGE\"\n    }\n  ],\n  \"success\": true\n}\n```\n\n## Errors\n\nCheck `code`, not only HTTP status. Invalid parameters, authentication and rate-limit errors normally use HTTP 200 with `INVALID_PARAMETER`, `INVALID_TOKEN` or `LIMIT_REQUEST`. Server/downstream errors use HTTP 500 with `SERVER_ERROR`.",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:Bearer <access_token>)",
            "required": true,
            "type": "string",
            "default": "Bearer <access_token>"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {}
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Business result code: \"0\" on success; otherwise INVALID_PARAMETER, INVALID_TOKEN, LIMIT_REQUEST or SERVER_ERROR."
                },
                "msg": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Result message; normally null on success."
                },
                "data": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "object",
                    "properties": {
                      "level": {
                        "type": "integer",
                        "description": "Location level number (1–7); not a storage level record ID.",
                        "minimum": 1,
                        "maximum": 7
                      },
                      "name": {
                        "type": "string",
                        "description": "Company-configured name of the level."
                      },
                      "description": {
                        "type": "string",
                        "description": "Company-configured description."
                      },
                      "storingPreference": {
                        "type": "string",
                        "description": "Whether locations at this level can store stock. Level 7 is returned as STORAGE.",
                        "enum": [
                          "STORAGE",
                          "ORGANIZATIONAL"
                        ]
                      }
                    },
                    "required": [
                      "level",
                      "name",
                      "description",
                      "storingPreference"
                    ]
                  },
                  "description": "Company-level location configuration."
                },
                "success": {
                  "type": "boolean",
                  "description": "True when code equals \"0\"."
                }
              },
              "required": [
                "code",
                "success"
              ]
            }
          }
        }
      }
    },
    "/api/warehouse/list": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "List warehouse information",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "pageNumber": {
                  "type": "integer"
                },
                "pageSize": {
                  "type": "integer"
                }
              },
              "required": [
                "pageSize",
                "pageNumber"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "object",
              "title": "empty object",
              "properties": {
                "pageNumber": {
                  "type": "integer"
                },
                "pageSize": {
                  "type": "integer"
                },
                "totalCount": {
                  "type": "integer"
                },
                "totalPages": {
                  "type": "integer"
                },
                "results": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "externalWarehouseId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "partner": {
                        "type": "string"
                      },
                      "address": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "province": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "platformWarehouses": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "platformWarehouseId": {
                              "type": "string"
                            },
                            "platformWarehouseName": {
                              "type": "string"
                            },
                            "platformWarehouseAddress": {
                              "type": "string"
                            },
                            "platformStoreId": {
                              "type": "string"
                            },
                            "platformName": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "required": []
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/warehouse/location/list": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "List warehouse locations with pagination",
        "description": "Returns a flat location list. Filters are combined; Default Storage participates in matching.\n\nPagination is optional: supply both `pageNumber` and `pageSize`, or omit both.",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization (Only:Bearer <access_token>)",
            "required": true,
            "type": "string",
            "default": "Bearer <access_token>"
          },
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string",
                  "description": "External warehouse ID from /api/warehouse/list, belonging to the authenticated tenant.",
                  "minLength": 1
                },
                "parentLocationId": {
                  "type": [
                    "string",
                    "integer",
                    "null"
                  ],
                  "description": "Optional parent location ID. Omit/null to search the whole warehouse. With a parent, return its direct children unless includeDescendants=true; exclude the parent itself. 64-bit ID; send as a decimal string (recommended) or a number."
                },
                "level": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Optional exact level-number filter; normally 1–7. A nonmatching level returns no rows."
                },
                "keyword": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Optional case-insensitive substring of the location's own name. Trimmed before filtering."
                },
                "includeDescendants": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "With parentLocationId: true includes all descendants; omitted/null/false includes direct children only.",
                  "default": false
                },
                "pageNumber": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Optional. Supply together with pageSize; omit both to return all matching locations.",
                  "minimum": 1,
                  "format": "int64"
                },
                "pageSize": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Optional (1–200). Supply together with pageNumber.",
                  "minimum": 1,
                  "maximum": 200,
                  "format": "int64"
                }
              },
              "required": [
                "externalWarehouseId"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Business result code: \"0\" on success; otherwise INVALID_PARAMETER, INVALID_TOKEN, LIMIT_REQUEST or SERVER_ERROR."
                },
                "msg": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Result message; normally null on success."
                },
                "data": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "storageActivated": {
                      "type": "boolean",
                      "description": "Whether Storage Locations are activated. If false, totalCount=0 and results=[]."
                    },
                    "totalCount": {
                      "type": "string",
                      "description": "Number of matching locations before pagination. Returned as a decimal string in this endpoint.",
                      "format": "int64",
                      "minimum": 0
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "locationId": {
                            "type": "string",
                            "description": "Location ID. 64-bit ID returned as a decimal string."
                          },
                          "locationName": {
                            "type": "string",
                            "description": "Location's own name, without ancestors."
                          },
                          "parentLocationId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Parent location ID; null when no parent. 64-bit ID returned as a decimal string."
                          },
                          "level": {
                            "type": "integer",
                            "description": "Location level number. Default Storage is returned at level 7.",
                            "minimum": 1,
                            "maximum": 7
                          },
                          "path": {
                            "type": "string",
                            "description": "Warehouse name followed by the location's full path, separated by ' / ' (space, slash, space), e.g. \"Gudang A / Zone 1 / Bin 01\"."
                          },
                          "isUnassigned": {
                            "type": "boolean",
                            "description": "True for the warehouse's Default Storage location."
                          },
                          "childCount": {
                            "type": "integer",
                            "description": "Number of direct child locations; not the total number of descendants.",
                            "minimum": 0
                          },
                          "skuCount": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Number of SKUs directly associated with a normal Storage location, including zero-stock associations. Null for Organizational and, in the current implementation, Default Storage."
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "OCCUPIED when directly associated product count is greater than zero; otherwise EMPTY. Null for Organizational.",
                            "enum": [
                              "OCCUPIED",
                              "EMPTY",
                              null
                            ]
                          },
                          "stockToMarketplace": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Marketplace-stock flag returned by the storage service. Organizational locations cannot operate this switch."
                          },
                          "storingPreference": {
                            "type": "string",
                            "enum": [
                              "ORGANIZATIONAL",
                              "STORAGE"
                            ],
                            "description": "Effective storage type inherited from the location level. The system Default Storage is STORAGE."
                          },
                          "updatedAt": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "format": "int64",
                            "description": "This location's last update time as a UTC Unix timestamp in milliseconds, encoded as a JSON number. For example, 1793689500123 represents 2026-11-03T07:05:00.123Z. Null when the source timestamp is absent."
                          }
                        },
                        "required": [
                          "locationId",
                          "locationName",
                          "level",
                          "path",
                          "isUnassigned",
                          "childCount",
                          "storingPreference",
                          "updatedAt"
                        ]
                      },
                      "description": "Flat list sorted by level, then locationId, ascending. Includes Default Storage when it matches the filters."
                    },
                    "pageNumber": {
                      "type": "integer",
                      "description": "Requested page number; omitted when pagination is not requested.",
                      "minimum": 1,
                      "format": "int64"
                    },
                    "pageSize": {
                      "type": "integer",
                      "description": "Requested page size; omitted when pagination is not requested.",
                      "minimum": 1,
                      "maximum": 200,
                      "format": "int64"
                    }
                  },
                  "required": [
                    "storageActivated",
                    "totalCount",
                    "results"
                  ]
                },
                "success": {
                  "type": "boolean",
                  "description": "True when code equals \"0\"."
                }
              },
              "required": [
                "code",
                "success"
              ]
            }
          }
        }
      }
    },
    "/api/warehouse/shelf/add": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "[Retired] Add Shelf",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string"
                },
                "shelfName": {
                  "type": "string",
                  "description": "The length of shelfName ranges from a minimum of 1 to a maximum of 30."
                }
              },
              "required": [
                "externalWarehouseId",
                "shelfName"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "null"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "shelfId": {
                      "type": "number"
                    },
                    "shelfName": {
                      "type": "string"
                    },
                    "masterWarehouseId": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/warehouse/slot/add": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "[Retired] Add Slot",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string"
                },
                "shelfId": {
                  "type": "number"
                },
                "slotName": {
                  "type": "string",
                  "description": "The length of slotName ranges from a minimum of 1 to a maximum of 15."
                }
              },
              "required": [
                "externalWarehouseId",
                "shelfId",
                "slotName"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "null"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "slotId": {
                      "type": "number"
                    },
                    "slotName": {
                      "type": "string"
                    },
                    "shelfId": {
                      "type": "number"
                    },
                    "shelfName": {
                      "type": "string"
                    },
                    "masterWarehouseId": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/warehouse/slot/allocate": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "[Retired] Allocate Slot",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string"
                },
                "allocations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "slotId": {
                        "type": "number"
                      },
                      "skuNumbers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "slotId",
                      "skuNumbers"
                    ]
                  }
                }
              },
              "required": [
                "externalWarehouseId",
                "allocations"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "null"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "failureList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slotId": {
                            "type": "number"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/warehouse/shelf/list": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "[Retired] Query Shelf List",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string"
                },
                "keyword": {
                  "type": "string"
                },
                "pageNumber": {
                  "type": "number"
                },
                "pageSize": {
                  "type": "number",
                  "description": "Max: 200"
                }
              },
              "required": [
                "externalWarehouseId",
                "pageNumber",
                "pageSize"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "null"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "pageNumber": {
                      "type": "number"
                    },
                    "pageSize": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "shelfId": {
                            "type": "number"
                          },
                          "shelfName": {
                            "type": "string"
                          },
                          "masterWarehouseId": {
                            "type": "number"
                          },
                          "slotCount": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "totalCount": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/warehouse/slot/list": {
      "post": {
        "tags": [
          "Warehouse"
        ],
        "summary": "[Retired] Query Slot List",
        "description": "",
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "root",
            "in": "body",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "externalWarehouseId": {
                  "type": "string"
                },
                "shelfId": {
                  "type": "number"
                },
                "keyword": {
                  "type": "string"
                },
                "pageNumber": {
                  "type": "number"
                },
                "pageSize": {
                  "type": "number"
                }
              },
              "required": [
                "externalWarehouseId",
                "pageNumber",
                "pageSize"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "msg": {
                  "type": "null"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "pageNumber": {
                      "type": "number"
                    },
                    "pageSize": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slotId": {
                            "type": "number"
                          },
                          "slotName": {
                            "type": "string"
                          },
                          "shelfId": {
                            "type": "number"
                          },
                          "masterWarehouseId": {
                            "type": "number"
                          },
                          "allocatedProducts": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "productId": {
                                  "type": "number"
                                },
                                "skuNumber": {
                                  "type": "string"
                                },
                                "productName": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "totalCount": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}