curl --request POST \
--url https://api.orbita.melonn.com/sell-orders \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"external_order_number": "TESTING-PUBLIC-API_0192",
"external_order_id": "TESTING-PUBLIC-API_0192",
"hold_fulfillment_after_processing": true,
"business": {
"id": "Testing-business-SC",
"delivery_location_id": "Testing-location-SC"
},
"warehouse_code": "MED-2",
"tags": [
"TESTING-RC"
],
"shipping_method_code": "MEL-15",
"line_items": [
{
"sku": "S0001",
"quantity": 3
},
{
"sku": "S0002",
"quantity": 2
}
],
"sell_order_vas": [
{
"code": "2",
"files": [],
"comments": [
"Testing"
],
"seller_products_skus": [
"S0001"
]
}
]
}
'{
"message": "Order created successfully",
"sell_order": {
"internal_order_number": "M1732567774501662",
"external_order_number": "TESTING-PUBLIC-API_0192",
"external_order_id": "TESTING-PUBLIC-API_0192"
}
}Create sell order
Creates a sell order and requests its fulfillment. The same endpoint creates D2C orders (to an end
consumer) and B2B orders (to a business). The presence of the business object decides which one:
D2C (no business) | B2B (business present) | |
|---|---|---|
| Recipient and address | buyer and shipping_info are required. The address is geocoded; if it cannot be geocoded the order is rejected. | Taken from the business and its delivery location. buyer and shipping_info are ignored. |
warehouse_code | Optional. When omitted, Melonn assigns the warehouse. | Required. |
business.delivery_location_id | n/a | Required, except for the official destinations MEL-MELI-FULL and MEL-AMAZON-FBA (see Reference data), whose orders ship to the warehouse address. |
sell_order_vas | Ignored. | Optional. When omitted, the business’s default VAS are applied. Codes must be enabled for the business. |
payment_on_delivery_amount | Optional cash-on-delivery amount. | Ignored. |
Common rules:
shipping_method_codemust exist (see Reference data) and must be the shipping method Melonn would assign to this order for your configuration, products and destination; otherwise the order is rejected withShipping method is invalid. The same applies towarehouse_code(Warehouse is invalid).- Every
line_items[].skumust be one of your products. A kit (composite product) is expanded into its components; for B2B orders the kit assembly VAS (code5) is added automatically. - Melonn does not enforce uniqueness of
external_order_number: sending the same request twice creates two orders. - With
hold_fulfillment_after_processing: truethe order stops once its items are reserved (state26, All items reserved - fulfillment on hold) until you release it with Release hold fulfillment. tagsare attached after the order is created.
The response returns the internal_order_number Melonn assigned. States are described in
Sell order states.
curl --request POST \
--url https://api.orbita.melonn.com/sell-orders \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"external_order_number": "TESTING-PUBLIC-API_0192",
"external_order_id": "TESTING-PUBLIC-API_0192",
"hold_fulfillment_after_processing": true,
"business": {
"id": "Testing-business-SC",
"delivery_location_id": "Testing-location-SC"
},
"warehouse_code": "MED-2",
"tags": [
"TESTING-RC"
],
"shipping_method_code": "MEL-15",
"line_items": [
{
"sku": "S0001",
"quantity": 3
},
{
"sku": "S0002",
"quantity": 2
}
],
"sell_order_vas": [
{
"code": "2",
"files": [],
"comments": [
"Testing"
],
"seller_products_skus": [
"S0001"
]
}
]
}
'{
"message": "Order created successfully",
"sell_order": {
"internal_order_number": "M1732567774501662",
"external_order_number": "TESTING-PUBLIC-API_0192",
"external_order_id": "TESTING-PUBLIC-API_0192"
}
}Authorizations
Body
Include business to create a B2B order; omit it to create a D2C order. See the endpoint description for
the fields each type requires.
Your order number. Used to look the order up later. Not checked for uniqueness.
Your order id.
Code of the shipping method (see Reference data).
Products and quantities ordered.
Show child attributes
Show child attributes
When true, the order is put on hold once its items are reserved and is not prepared until you release
it. Optional, false by default.
Code of the warehouse that fulfills the order (see Reference data). Required for B2B orders. Optional for D2C orders; when omitted Melonn assigns it.
Free-text tags to attach to the order.
Presence makes the order B2B. The business that receives the order. It must already exist (see the Business endpoints).
Show child attributes
Show child attributes
B2B only. Value-added services for the order (see Reference data). Each code must be enabled for the business. When omitted, the business's default VAS are applied.
Show child attributes
Show child attributes
Required for D2C orders; ignored for B2B orders. Delivery address and recipient.
Show child attributes
Show child attributes
Required for D2C orders; ignored for B2B orders (the buyer is the business).
Show child attributes
Show child attributes
D2C only. Amount the carrier collects from the buyer on delivery (cash on delivery). The shipping method must support cash on delivery. Ignored for B2B orders.