curl -X POST "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/fulfillments" \
-H "Content-Type: application/json" \
-H "public-api-key: <public-api-key>" \
-H "private-secret-key: <private-secret-key>" \
-d '{
"status": "PARTIAL",
"fulfillments": [
{
"id": "string",
"type": "CUSTOM",
"status": "PARTIAL",
"description": "string",
"carriers": [
{
"id": "string",
"tracking_id": [
"string"
],
"tracking_url": [
"string"
],
"shipped_at": "2024-01-01",
"delivered_at": "2024-01-01"
}
]
}
],
"carriers": null
}' const response = await fetch ( `https://api-sandbox.whitelabel.com/v1/payments/${ payment_id }/fulfillments` , {
method: 'POST' ,
headers: { 'Content-Type' : 'application/json' , 'public-api-key' : '<public-api-key>' , 'private-secret-key' : '<private-secret-key>' },
body: JSON . stringify ({
"status" : "PARTIAL" ,
"fulfillments" : [
{
"id" : "string" ,
"type" : "CUSTOM" ,
"status" : "PARTIAL" ,
"description" : "string" ,
"carriers" : [
{
"id" : "string" ,
"tracking_id" : [
"string"
],
"tracking_url" : [
"string"
],
"shipped_at" : "2024-01-01" ,
"delivered_at" : "2024-01-01"
}
]
}
],
"carriers" : null
})
});
const data = await response. json (); import requests
response = requests.request(
"POST" ,
"https://api-sandbox.whitelabel.com/v1/payments/ {payment_id} /fulfillments" ,
headers = { "public-api-key" : "<public-api-key>" , "private-secret-key" : "<private-secret-key>" },
json = {
"status" : "PARTIAL" ,
"fulfillments" : [
{
"id" : "string" ,
"type" : "CUSTOM" ,
"status" : "PARTIAL" ,
"description" : "string" ,
"carriers" : [
{
"id" : "string" ,
"tracking_id" : [
"string"
],
"tracking_url" : [
"string"
],
"shipped_at" : "2024-01-01" ,
"delivered_at" : "2024-01-01"
}
]
}
],
"carriers" : None
},
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/fulfillments" );
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , "POST" );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [ "Content-Type: application/json" , "public-api-key: <public-api-key>" , "private-secret-key: <private-secret-key>" ]);
curl_setopt ($ch, CURLOPT_POSTFIELDS , '{
"status": "PARTIAL",
"fulfillments": [
{
"id": "string",
"type": "CUSTOM",
"status": "PARTIAL",
"description": "string",
"carriers": [
{
"id": "string",
"tracking_id": [
"string"
],
"tracking_url": [
"string"
],
"shipped_at": "2024-01-01",
"delivered_at": "2024-01-01"
}
]
}
],
"carriers": null
}' );
$response = curl_exec ($ch);
curl_close ($ch); package main
import (
" fmt "
" io "
" net/http "
" strings "
)
func main () {
req, _ := http. NewRequest ( "POST" , "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/fulfillments" , strings. NewReader ( `{
"status": "PARTIAL",
"fulfillments": [
{
"id": "string",
"type": "CUSTOM",
"status": "PARTIAL",
"description": "string",
"carriers": [
{
"id": "string",
"tracking_id": [
"string"
],
"tracking_url": [
"string"
],
"shipped_at": "2024-01-01",
"delivered_at": "2024-01-01"
}
]
}
],
"carriers": null
}` ))
req.Header. Set ( "Content-Type" , "application/json" )
req.Header. Set ( "public-api-key" , "<public-api-key>" )
req.Header. Set ( "private-secret-key" , "<private-secret-key>" )
resp, err := http.DefaultClient. Do (req)
if err != nil {
panic (err)
}
defer resp.Body. Close ()
data, _ := io. ReadAll (resp.Body)
fmt. Println ( string (data))
} HttpClient client = HttpClient. newHttpClient ();
HttpRequest request = HttpRequest. newBuilder ()
. uri (URI. create ( "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/fulfillments" ))
. header ( "Content-Type" , "application/json" )
. header ( "public-api-key" , "<public-api-key>" )
. header ( "private-secret-key" , "<private-secret-key>" )
. method ( "POST" , HttpRequest.BodyPublishers. ofString ( "{ \n \" status \" : \" PARTIAL \" , \n \" fulfillments \" : [ \n { \n \" id \" : \" string \" , \n \" type \" : \" CUSTOM \" , \n \" status \" : \" PARTIAL \" , \n \" description \" : \" string \" , \n \" carriers \" : [ \n { \n \" id \" : \" string \" , \n \" tracking_id \" : [ \n \" string \"\n ], \n \" tracking_url \" : [ \n \" string \"\n ], \n \" shipped_at \" : \" 2024-01-01 \" , \n \" delivered_at \" : \" 2024-01-01 \"\n } \n ] \n } \n ], \n \" carriers \" : null \n }" ))
. build ();
HttpResponse < String > response = client. send (request, HttpResponse.BodyHandlers. ofString ());
System.out. println (response. body ()); require "net/http"
require "uri"
uri = URI ( "https://api-sandbox.whitelabel.com/v1/payments/<payment_id>/fulfillments" )
http = Net :: HTTP . new (uri. host , uri. port )
http. use_ssl = uri. scheme == "https"
request = Net :: HTTP :: Post . new (uri)
request[ "Content-Type" ] = "application/json"
request[ "public-api-key" ] = "<public-api-key>"
request[ "private-secret-key" ] = "<private-secret-key>"
request. body = "{ \n \" status \" : \" PARTIAL \" , \n \" fulfillments \" : [ \n { \n \" id \" : \" string \" , \n \" type \" : \" CUSTOM \" , \n \" status \" : \" PARTIAL \" , \n \" description \" : \" string \" , \n \" carriers \" : [ \n { \n \" id \" : \" string \" , \n \" tracking_id \" : [ \n \" string \"\n ], \n \" tracking_url \" : [ \n \" string \"\n ], \n \" shipped_at \" : \" 2024-01-01 \" , \n \" delivered_at \" : \" 2024-01-01 \"\n } \n ] \n } \n ], \n \" carriers \" : null \n }"
response = http. request (request)
puts response. body ⧉