curl --request POST \
--url https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"code": "2",
"files": [
"https://example.com/files/labels.pdf"
],
"comments": [
"Label every unit on the bottom side"
],
"seller_products_skus": [
"SKU-12345"
]
}
]
'import requests
url = "https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas"
payload = [
{
"code": "2",
"files": ["https://example.com/files/labels.pdf"],
"comments": ["Label every unit on the bottom side"],
"seller_products_skus": ["SKU-12345"]
}
]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
code: '2',
files: ['https://example.com/files/labels.pdf'],
comments: ['Label every unit on the bottom side'],
seller_products_skus: ['SKU-12345']
}
])
};
fetch('https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'code' => '2',
'files' => [
'https://example.com/files/labels.pdf'
],
'comments' => [
'Label every unit on the bottom side'
],
'seller_products_skus' => [
'SKU-12345'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas"
payload := strings.NewReader("[\n {\n \"code\": \"2\",\n \"files\": [\n \"https://example.com/files/labels.pdf\"\n ],\n \"comments\": [\n \"Label every unit on the bottom side\"\n ],\n \"seller_products_skus\": [\n \"SKU-12345\"\n ]\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"code\": \"2\",\n \"files\": [\n \"https://example.com/files/labels.pdf\"\n ],\n \"comments\": [\n \"Label every unit on the bottom side\"\n ],\n \"seller_products_skus\": [\n \"SKU-12345\"\n ]\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"code\": \"2\",\n \"files\": [\n \"https://example.com/files/labels.pdf\"\n ],\n \"comments\": [\n \"Label every unit on the bottom side\"\n ],\n \"seller_products_skus\": [\n \"SKU-12345\"\n ]\n }\n]"
response = http.request(request)
puts response.read_bodyAdd vas to order
Adds one or more value added services (VAS) to an existing B2B sell order.
Preconditions
- The order is a B2B order (created with a
business). - The order is in state
1(Received - valid),13(on stand by - not able to fulfil - no stock) or26(All items reserved - fulfillment on hold). See sell order states. - Each VAS is enabled for the order’s business and is not already on the order.
filesandcommentsare only accepted for VAS whose rules allow them at creation, andseller_products_skusonly for VAS applied per line item. Every SKU must be a product of the order.
VAS codes are listed in VAS codes.
Files are sent as public URLs, not uploaded: Melonn downloads each URL and stores its
own copy. The URL must end in .pdf, .jpg, .jpeg, .png, .xlsx, .docx or .csv
(case-insensitive; a query string after the extension makes it fail) and must be
downloadable without authentication.
curl --request POST \
--url https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"code": "2",
"files": [
"https://example.com/files/labels.pdf"
],
"comments": [
"Label every unit on the bottom side"
],
"seller_products_skus": [
"SKU-12345"
]
}
]
'import requests
url = "https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas"
payload = [
{
"code": "2",
"files": ["https://example.com/files/labels.pdf"],
"comments": ["Label every unit on the bottom side"],
"seller_products_skus": ["SKU-12345"]
}
]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
code: '2',
files: ['https://example.com/files/labels.pdf'],
comments: ['Label every unit on the bottom side'],
seller_products_skus: ['SKU-12345']
}
])
};
fetch('https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'code' => '2',
'files' => [
'https://example.com/files/labels.pdf'
],
'comments' => [
'Label every unit on the bottom side'
],
'seller_products_skus' => [
'SKU-12345'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas"
payload := strings.NewReader("[\n {\n \"code\": \"2\",\n \"files\": [\n \"https://example.com/files/labels.pdf\"\n ],\n \"comments\": [\n \"Label every unit on the bottom side\"\n ],\n \"seller_products_skus\": [\n \"SKU-12345\"\n ]\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"code\": \"2\",\n \"files\": [\n \"https://example.com/files/labels.pdf\"\n ],\n \"comments\": [\n \"Label every unit on the bottom side\"\n ],\n \"seller_products_skus\": [\n \"SKU-12345\"\n ]\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbita.melonn.com/sell-orders/{external_order_number}/vas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"code\": \"2\",\n \"files\": [\n \"https://example.com/files/labels.pdf\"\n ],\n \"comments\": [\n \"Label every unit on the bottom side\"\n ],\n \"seller_products_skus\": [\n \"SKU-12345\"\n ]\n }\n]"
response = http.request(request)
puts response.read_bodyAuthorizations
Path Parameters
The order number you assigned to the sell order when you created it.
Body
1Public URLs of files for the VAS. Each must end in .pdf, .jpg, .jpeg, .png, .xlsx, .docx or .csv. Only for VAS that allow files.
Instructions for the VAS. Only for VAS that allow comments.
SKUs of the order's products the VAS applies to. Only for VAS applied per line item; every SKU must be a product of the order.
Response
The VAS were added to the order.
Confirmation message.