Create Fulfillment
curl --request POST \
--url https://api.production.orderprotection.com/v1/orders/{sourceOrderId}/fulfillments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceItemIds": [
{
"sourceItemId": "1478",
"quantity": 1
},
{
"sourceItemId": "1479",
"quantity": 2
}
],
"fulfillmentStatus": "Fulfilled",
"sourceFulfillmentId": "fulfillment-123",
"trackingCompany": "FedEx",
"trackingNumber": [
"AB0303456",
"CD0303457"
],
"trackingUrl": [
"https://example-follow-shipment.com/AB0303456",
"https://example-follow-shipment.com/CD0303457"
],
"createdAt": "2024-03-20T12:00:00Z",
"updatedAt": "2024-03-20T12:00:00Z"
}
'import requests
url = "https://api.production.orderprotection.com/v1/orders/{sourceOrderId}/fulfillments"
payload = {
"sourceItemIds": [
{
"sourceItemId": "1478",
"quantity": 1
},
{
"sourceItemId": "1479",
"quantity": 2
}
],
"fulfillmentStatus": "Fulfilled",
"sourceFulfillmentId": "fulfillment-123",
"trackingCompany": "FedEx",
"trackingNumber": ["AB0303456", "CD0303457"],
"trackingUrl": ["https://example-follow-shipment.com/AB0303456", "https://example-follow-shipment.com/CD0303457"],
"createdAt": "2024-03-20T12:00:00Z",
"updatedAt": "2024-03-20T12:00:00Z"
}
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({
sourceItemIds: [{sourceItemId: '1478', quantity: 1}, {sourceItemId: '1479', quantity: 2}],
fulfillmentStatus: 'Fulfilled',
sourceFulfillmentId: 'fulfillment-123',
trackingCompany: 'FedEx',
trackingNumber: ['AB0303456', 'CD0303457'],
trackingUrl: [
'https://example-follow-shipment.com/AB0303456',
'https://example-follow-shipment.com/CD0303457'
],
createdAt: '2024-03-20T12:00:00Z',
updatedAt: '2024-03-20T12:00:00Z'
})
};
fetch('https://api.production.orderprotection.com/v1/orders/{sourceOrderId}/fulfillments', 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/{sourceOrderId}/fulfillments",
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([
'sourceItemIds' => [
[
'sourceItemId' => '1478',
'quantity' => 1
],
[
'sourceItemId' => '1479',
'quantity' => 2
]
],
'fulfillmentStatus' => 'Fulfilled',
'sourceFulfillmentId' => 'fulfillment-123',
'trackingCompany' => 'FedEx',
'trackingNumber' => [
'AB0303456',
'CD0303457'
],
'trackingUrl' => [
'https://example-follow-shipment.com/AB0303456',
'https://example-follow-shipment.com/CD0303457'
],
'createdAt' => '2024-03-20T12:00:00Z',
'updatedAt' => '2024-03-20T12:00:00Z'
]),
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/{sourceOrderId}/fulfillments"
payload := strings.NewReader("{\n \"sourceItemIds\": [\n {\n \"sourceItemId\": \"1478\",\n \"quantity\": 1\n },\n {\n \"sourceItemId\": \"1479\",\n \"quantity\": 2\n }\n ],\n \"fulfillmentStatus\": \"Fulfilled\",\n \"sourceFulfillmentId\": \"fulfillment-123\",\n \"trackingCompany\": \"FedEx\",\n \"trackingNumber\": [\n \"AB0303456\",\n \"CD0303457\"\n ],\n \"trackingUrl\": [\n \"https://example-follow-shipment.com/AB0303456\",\n \"https://example-follow-shipment.com/CD0303457\"\n ],\n \"createdAt\": \"2024-03-20T12:00:00Z\",\n \"updatedAt\": \"2024-03-20T12:00:00Z\"\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/{sourceOrderId}/fulfillments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceItemIds\": [\n {\n \"sourceItemId\": \"1478\",\n \"quantity\": 1\n },\n {\n \"sourceItemId\": \"1479\",\n \"quantity\": 2\n }\n ],\n \"fulfillmentStatus\": \"Fulfilled\",\n \"sourceFulfillmentId\": \"fulfillment-123\",\n \"trackingCompany\": \"FedEx\",\n \"trackingNumber\": [\n \"AB0303456\",\n \"CD0303457\"\n ],\n \"trackingUrl\": [\n \"https://example-follow-shipment.com/AB0303456\",\n \"https://example-follow-shipment.com/CD0303457\"\n ],\n \"createdAt\": \"2024-03-20T12:00:00Z\",\n \"updatedAt\": \"2024-03-20T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v1/orders/{sourceOrderId}/fulfillments")
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 \"sourceItemIds\": [\n {\n \"sourceItemId\": \"1478\",\n \"quantity\": 1\n },\n {\n \"sourceItemId\": \"1479\",\n \"quantity\": 2\n }\n ],\n \"fulfillmentStatus\": \"Fulfilled\",\n \"sourceFulfillmentId\": \"fulfillment-123\",\n \"trackingCompany\": \"FedEx\",\n \"trackingNumber\": [\n \"AB0303456\",\n \"CD0303457\"\n ],\n \"trackingUrl\": [\n \"https://example-follow-shipment.com/AB0303456\",\n \"https://example-follow-shipment.com/CD0303457\"\n ],\n \"createdAt\": \"2024-03-20T12:00:00Z\",\n \"updatedAt\": \"2024-03-20T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"message": "'sourceOrderId' is required",
"statusCode": 400
}{
"message": "Unauthorized",
"statusCode": 401
}{
"message": "Not Found",
"error": "Not Found",
"statusCode": 404
}Fulfillments
Create Fulfillment
POST
/
v1
/
orders
/
{sourceOrderId}
/
fulfillments
Create Fulfillment
curl --request POST \
--url https://api.production.orderprotection.com/v1/orders/{sourceOrderId}/fulfillments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceItemIds": [
{
"sourceItemId": "1478",
"quantity": 1
},
{
"sourceItemId": "1479",
"quantity": 2
}
],
"fulfillmentStatus": "Fulfilled",
"sourceFulfillmentId": "fulfillment-123",
"trackingCompany": "FedEx",
"trackingNumber": [
"AB0303456",
"CD0303457"
],
"trackingUrl": [
"https://example-follow-shipment.com/AB0303456",
"https://example-follow-shipment.com/CD0303457"
],
"createdAt": "2024-03-20T12:00:00Z",
"updatedAt": "2024-03-20T12:00:00Z"
}
'import requests
url = "https://api.production.orderprotection.com/v1/orders/{sourceOrderId}/fulfillments"
payload = {
"sourceItemIds": [
{
"sourceItemId": "1478",
"quantity": 1
},
{
"sourceItemId": "1479",
"quantity": 2
}
],
"fulfillmentStatus": "Fulfilled",
"sourceFulfillmentId": "fulfillment-123",
"trackingCompany": "FedEx",
"trackingNumber": ["AB0303456", "CD0303457"],
"trackingUrl": ["https://example-follow-shipment.com/AB0303456", "https://example-follow-shipment.com/CD0303457"],
"createdAt": "2024-03-20T12:00:00Z",
"updatedAt": "2024-03-20T12:00:00Z"
}
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({
sourceItemIds: [{sourceItemId: '1478', quantity: 1}, {sourceItemId: '1479', quantity: 2}],
fulfillmentStatus: 'Fulfilled',
sourceFulfillmentId: 'fulfillment-123',
trackingCompany: 'FedEx',
trackingNumber: ['AB0303456', 'CD0303457'],
trackingUrl: [
'https://example-follow-shipment.com/AB0303456',
'https://example-follow-shipment.com/CD0303457'
],
createdAt: '2024-03-20T12:00:00Z',
updatedAt: '2024-03-20T12:00:00Z'
})
};
fetch('https://api.production.orderprotection.com/v1/orders/{sourceOrderId}/fulfillments', 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/{sourceOrderId}/fulfillments",
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([
'sourceItemIds' => [
[
'sourceItemId' => '1478',
'quantity' => 1
],
[
'sourceItemId' => '1479',
'quantity' => 2
]
],
'fulfillmentStatus' => 'Fulfilled',
'sourceFulfillmentId' => 'fulfillment-123',
'trackingCompany' => 'FedEx',
'trackingNumber' => [
'AB0303456',
'CD0303457'
],
'trackingUrl' => [
'https://example-follow-shipment.com/AB0303456',
'https://example-follow-shipment.com/CD0303457'
],
'createdAt' => '2024-03-20T12:00:00Z',
'updatedAt' => '2024-03-20T12:00:00Z'
]),
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/{sourceOrderId}/fulfillments"
payload := strings.NewReader("{\n \"sourceItemIds\": [\n {\n \"sourceItemId\": \"1478\",\n \"quantity\": 1\n },\n {\n \"sourceItemId\": \"1479\",\n \"quantity\": 2\n }\n ],\n \"fulfillmentStatus\": \"Fulfilled\",\n \"sourceFulfillmentId\": \"fulfillment-123\",\n \"trackingCompany\": \"FedEx\",\n \"trackingNumber\": [\n \"AB0303456\",\n \"CD0303457\"\n ],\n \"trackingUrl\": [\n \"https://example-follow-shipment.com/AB0303456\",\n \"https://example-follow-shipment.com/CD0303457\"\n ],\n \"createdAt\": \"2024-03-20T12:00:00Z\",\n \"updatedAt\": \"2024-03-20T12:00:00Z\"\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/{sourceOrderId}/fulfillments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceItemIds\": [\n {\n \"sourceItemId\": \"1478\",\n \"quantity\": 1\n },\n {\n \"sourceItemId\": \"1479\",\n \"quantity\": 2\n }\n ],\n \"fulfillmentStatus\": \"Fulfilled\",\n \"sourceFulfillmentId\": \"fulfillment-123\",\n \"trackingCompany\": \"FedEx\",\n \"trackingNumber\": [\n \"AB0303456\",\n \"CD0303457\"\n ],\n \"trackingUrl\": [\n \"https://example-follow-shipment.com/AB0303456\",\n \"https://example-follow-shipment.com/CD0303457\"\n ],\n \"createdAt\": \"2024-03-20T12:00:00Z\",\n \"updatedAt\": \"2024-03-20T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.production.orderprotection.com/v1/orders/{sourceOrderId}/fulfillments")
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 \"sourceItemIds\": [\n {\n \"sourceItemId\": \"1478\",\n \"quantity\": 1\n },\n {\n \"sourceItemId\": \"1479\",\n \"quantity\": 2\n }\n ],\n \"fulfillmentStatus\": \"Fulfilled\",\n \"sourceFulfillmentId\": \"fulfillment-123\",\n \"trackingCompany\": \"FedEx\",\n \"trackingNumber\": [\n \"AB0303456\",\n \"CD0303457\"\n ],\n \"trackingUrl\": [\n \"https://example-follow-shipment.com/AB0303456\",\n \"https://example-follow-shipment.com/CD0303457\"\n ],\n \"createdAt\": \"2024-03-20T12:00:00Z\",\n \"updatedAt\": \"2024-03-20T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok"
}{
"message": "'sourceOrderId' is required",
"statusCode": 400
}{
"message": "Unauthorized",
"statusCode": 401
}{
"message": "Not Found",
"error": "Not Found",
"statusCode": 404
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Array of order items objects with the sourceItemId and quantity
Example:
[
{ "sourceItemId": "1478", "quantity": 1 },
{ "sourceItemId": "1479", "quantity": 2 }
]
Fulfillment Status
Available options:
DELIVERED, FULFILLED, UNFULFILLED, PARTIALLY_FULFILLED, AWAITING_SHIPMENT, SCHEDULED, ON_HOLD, ATTEMPTED_DELIVERY, CARRIER_PICKED_UP, CONFIRMED, DELAYED, FAILURE, IN_TRANSIT, LABEL_PRINTED, LABEL_PURCHASED, OUT_FOR_DELIVERY, PICKED_UP, READY_FOR_PICKUP Example:
"Fulfilled"
Source Fulfillment ID. This will allow you to update your fulfillment using your internal fulfillment ID
Example:
"fulfillment-123"
Tracking Company
Example:
"FedEx"
Array of Tracking Numbers
Example:
["AB0303456", "CD0303457"]
Array of Tracking URLs
Example:
[
"https://example-follow-shipment.com/AB0303456",
"https://example-follow-shipment.com/CD0303457"
]
Creation date of the fulfillment. If null, the createdAt date will be created automatically.
Example:
"2024-03-20T12:00:00Z"
Last update date of the fulfillment. If null, the updatedAt date will be created automatically.
Example:
"2024-03-20T12:00:00Z"
Response
The fulfillment has been successfully created.
Example:
"ok"
⌘I

