add metadata to an order
curl --request POST \
--url https://api.production.orderprotection.com/v1/orders/metadata/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "badge",
"badgeType": "success",
"label": "Order Risk: Low",
"lowContrast": true,
"iconPosition": "left"
}
'import requests
url = "https://api.production.orderprotection.com/v1/orders/metadata/{id}"
payload = {
"type": "badge",
"badgeType": "success",
"label": "Order Risk: Low",
"lowContrast": True,
"iconPosition": "left"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'badge',
badgeType: 'success',
label: 'Order Risk: Low',
lowContrast: true,
iconPosition: 'left'
})
};
fetch('https://api.production.orderprotection.com/v1/orders/metadata/{id}', 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.production.orderprotection.com/v1/orders/metadata/{id}",
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([
'type' => 'badge',
'badgeType' => 'success',
'label' => 'Order Risk: Low',
'lowContrast' => true,
'iconPosition' => 'left'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.production.orderprotection.com/v1/orders/metadata/{id}"
payload := strings.NewReader("{\n \"type\": \"badge\",\n \"badgeType\": \"success\",\n \"label\": \"Order Risk: Low\",\n \"lowContrast\": true,\n \"iconPosition\": \"left\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.production.orderprotection.com/v1/orders/metadata/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"badge\",\n \"badgeType\": \"success\",\n \"label\": \"Order Risk: Low\",\n \"lowContrast\": true,\n \"iconPosition\": \"left\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v1/orders/metadata/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"badge\",\n \"badgeType\": \"success\",\n \"label\": \"Order Risk: Low\",\n \"lowContrast\": true,\n \"iconPosition\": \"left\"\n}"
response = http.request(request)
puts response.read_bodyMetadata
Add metadata
Add metadata to an Order in the form of a Badge or Activity feed item
POST
/
v1
/
orders
/
metadata
/
{id}
add metadata to an order
curl --request POST \
--url https://api.production.orderprotection.com/v1/orders/metadata/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "badge",
"badgeType": "success",
"label": "Order Risk: Low",
"lowContrast": true,
"iconPosition": "left"
}
'import requests
url = "https://api.production.orderprotection.com/v1/orders/metadata/{id}"
payload = {
"type": "badge",
"badgeType": "success",
"label": "Order Risk: Low",
"lowContrast": True,
"iconPosition": "left"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'badge',
badgeType: 'success',
label: 'Order Risk: Low',
lowContrast: true,
iconPosition: 'left'
})
};
fetch('https://api.production.orderprotection.com/v1/orders/metadata/{id}', 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.production.orderprotection.com/v1/orders/metadata/{id}",
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([
'type' => 'badge',
'badgeType' => 'success',
'label' => 'Order Risk: Low',
'lowContrast' => true,
'iconPosition' => 'left'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.production.orderprotection.com/v1/orders/metadata/{id}"
payload := strings.NewReader("{\n \"type\": \"badge\",\n \"badgeType\": \"success\",\n \"label\": \"Order Risk: Low\",\n \"lowContrast\": true,\n \"iconPosition\": \"left\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.production.orderprotection.com/v1/orders/metadata/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"badge\",\n \"badgeType\": \"success\",\n \"label\": \"Order Risk: Low\",\n \"lowContrast\": true,\n \"iconPosition\": \"left\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v1/orders/metadata/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"badge\",\n \"badgeType\": \"success\",\n \"label\": \"Order Risk: Low\",\n \"lowContrast\": true,\n \"iconPosition\": \"left\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Example:
"badge"
Available options:
success, warning, danger, neutral, secondary Example:
"success"
Example:
"Order Risk: Low"
The icon to use
Available options:
AddBook, ApiLogo, ArmraLogo, ArrowsRightLeft, BigCommerce, CheckCircle, CircleLogo, ClaimInfoSubscribedRightArrows, ClaimTodoApprovedDeniedSolidArrow, ClaimTodoClosedSolidArrow, ClaimTodoDashedArrow, ClaimTodoOnholdDashedArrow, ClaimTodoPendingDashedArrow, ClaimTodoSolidLine, DatePicker, EarthGlobeTimezone, FolderCheck, FollowUp, IconApprove, IconArmra, IconAvatar, IconBuilding, IconCheck, IconClose, IconCreditCard, IconCustom, IconDanger, IconDollar, IconEdit, IconGoogle, IconInfo, IconLock, IconLogo, IconRefund, IconSend, IconShipment, IconShopify, IconWarning, ImageCancel, LineAlign, LineAngleDoubleLeft, LineAngleDoubleRight, LineAngleDown, LineAngleLeft, LineAngleRight, LineAngleUp, LineAppleAlt, LineArchive, LineArrow, LineArrowDownRight, LineArrowLeft, LineArrowRight, LineBars, LineBold, LineBolt, LineBookMedical, LineBox, LineBuilding, LineCameraQuestion, LineChart, LineChatBubbleUser, LineCheckCircle, LineClipboardAlt, LineCodeBranch, LineCoins, LineCommentAlt, LineCommentAltBlock, LineCommentDots, LineCommentMessage, LineCommentQuestion, LineComparison, LineCopy, LineCornerUpLeftAlt, LineCornerUpRightAlt, LineCreditCard, LineDashboard, LineDownloadAlt, LineDraggabledots, LineEllipsisH, LineExclamationCircle, LineExclamationOctagon, LineExport, LineExternalLinkAlt, LineEye, LineEyeSlash, LineFileCopyAlt, LineFileLandscape, LineFilter, LineFire, LineFolder, LineFolderOpen, LineFont, LineGithubAlt, LineGlobe, LineImport, LineInfoCircle, LineItalic, LineLeftIndent, LineLinkAlt, LineListOl, LineListUl, LineLock, LineMessage, LineMinusCircle, LineMoney, LineMoneyWithdraw, LineMoon, LinePalette, LinePaperclip, LinePen, LinePhone, LinePlus, LinePlusCircle, LinePlusSquare, LineRefresh, LineRightIndentAlt, LineRocket, LineSearch, LineSetting, LineShield, LineSlack, LineSort, LineStar, LineSun, LineSwatchbook, LineSync, LineTable, LineTag, LineTimes, LineTimesCircle, LineToggleOff, LineToggleOn, LineTransaction, LineTrashAlt, LineUnderline, LineUsdCircle, LineUsersAlt, MagentoLogo, NoResponse, OutsideOp, Package, PackageArrived, PlayCircle, PlusCircle, QueueList, RefreshResentMail, ShieldCheck, Shipstation, ShopifyAvatar, ShopifyBag, SolidStar, TableDeleteColumn, TableDeleteRow, TableInsertColumnAfter, TableInsertColumnBefore, TableInsertRowAbove, TableInsertRowAfter, TipaltiLogo, XCircle, XMark Available options:
left, right Example:
"left"
Response
201 - undefined

