Partially update shipping detail
curl --request PATCH \
--url https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '
{
"type": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"isPickup": true,
"locationNumber": 15,
"altPickupPerson": {
"name": "Pat E Kake",
"email": "test@example.com"
},
"pickupPerson": {
"name": "Pat E Kake",
"email": "test@example.com"
},
"warehouseId": "XYZ-1234",
"storeId": "ABC-123",
"shippingCost": 150.25,
"shippingMethodId": "dfsae-2d32113-32lpdd",
"shippingDiscount": 150.25,
"shippingMethodName": "Express Delivery"
}
'import requests
url = "https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}"
payload = {
"type": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"isPickup": True,
"locationNumber": 15,
"altPickupPerson": {
"name": "Pat E Kake",
"email": "test@example.com"
},
"pickupPerson": {
"name": "Pat E Kake",
"email": "test@example.com"
},
"warehouseId": "XYZ-1234",
"storeId": "ABC-123",
"shippingCost": 150.25,
"shippingMethodId": "dfsae-2d32113-32lpdd",
"shippingDiscount": 150.25,
"shippingMethodName": "Express Delivery"
}
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-fabric-tenant-id': '<x-fabric-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'SHIP_TO_ADDRESS',
taxCode: 'FR1000',
isPickup: true,
locationNumber: 15,
altPickupPerson: {name: 'Pat E Kake', email: 'test@example.com'},
pickupPerson: {name: 'Pat E Kake', email: 'test@example.com'},
warehouseId: 'XYZ-1234',
storeId: 'ABC-123',
shippingCost: 150.25,
shippingMethodId: 'dfsae-2d32113-32lpdd',
shippingDiscount: 150.25,
shippingMethodName: 'Express Delivery'
})
};
fetch('https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}', 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.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'SHIP_TO_ADDRESS',
'taxCode' => 'FR1000',
'isPickup' => true,
'locationNumber' => 15,
'altPickupPerson' => [
'name' => 'Pat E Kake',
'email' => 'test@example.com'
],
'pickupPerson' => [
'name' => 'Pat E Kake',
'email' => 'test@example.com'
],
'warehouseId' => 'XYZ-1234',
'storeId' => 'ABC-123',
'shippingCost' => 150.25,
'shippingMethodId' => 'dfsae-2d32113-32lpdd',
'shippingDiscount' => 150.25,
'shippingMethodName' => 'Express Delivery'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$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.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}"
payload := strings.NewReader("{\n \"type\": \"SHIP_TO_ADDRESS\",\n \"taxCode\": \"FR1000\",\n \"isPickup\": true,\n \"locationNumber\": 15,\n \"altPickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"pickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"warehouseId\": \"XYZ-1234\",\n \"storeId\": \"ABC-123\",\n \"shippingCost\": 150.25,\n \"shippingMethodId\": \"dfsae-2d32113-32lpdd\",\n \"shippingDiscount\": 150.25,\n \"shippingMethodName\": \"Express Delivery\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
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.patch("https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"SHIP_TO_ADDRESS\",\n \"taxCode\": \"FR1000\",\n \"isPickup\": true,\n \"locationNumber\": 15,\n \"altPickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"pickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"warehouseId\": \"XYZ-1234\",\n \"storeId\": \"ABC-123\",\n \"shippingCost\": 150.25,\n \"shippingMethodId\": \"dfsae-2d32113-32lpdd\",\n \"shippingDiscount\": 150.25,\n \"shippingMethodName\": \"Express Delivery\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"SHIP_TO_ADDRESS\",\n \"taxCode\": \"FR1000\",\n \"isPickup\": true,\n \"locationNumber\": 15,\n \"altPickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"pickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"warehouseId\": \"XYZ-1234\",\n \"storeId\": \"ABC-123\",\n \"shippingCost\": 150.25,\n \"shippingMethodId\": \"dfsae-2d32113-32lpdd\",\n \"shippingDiscount\": 150.25,\n \"shippingMethodName\": \"Express Delivery\"\n}"
response = http.request(request)
puts response.read_body{
"id": "fef78121-bee3-4448-bf1c-d5b5461dbda2",
"createdAt": "2022-09-06T14:07:17.000Z",
"updatedAt": "2022-09-06T14:07:17.000Z",
"address": {
"addressLine1": "123 Main St.",
"city": "Seattle",
"region": "WA",
"country": "USA",
"postalCode": "98121",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"attention": "Billing manager",
"email": "test@example.com",
"type": "shipping",
"name": "Pat E Kake",
"phone": {
"number": "123-456-7899",
"type": "MOBILE"
}
},
"type": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"isPickup": true,
"altPickupPerson": {
"name": "Pat E Kake",
"phone": {
"number": "123-456-7899",
"type": "MOBILE"
},
"email": "test@example.com"
},
"pickupPerson": {
"name": "Pat E Kake",
"phone": {
"number": "123-456-7899",
"type": "MOBILE"
},
"email": "test@example.com"
},
"warehouseId": "XYZ-1234",
"storeId": "ABC-123",
"shippingCost": 150.25,
"shippingMethodId": "dfsae-2d32113-32lpdd",
"shippingDiscount": 150.25,
"shippingMethodName": "Express Delivery"
}{
"type": "BAD_REQUEST",
"message": "Bad Request"
}{
"type": "UNAUTHORIZED",
"message": "Unauthorized User"
}{
"type": "NOT_FOUND",
"message": "Cart not found"
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}Partially update shipping detail
Partially updates information for the specified shipping detail ID. Shipping details include the shipment’s delivery address, settings, pickup person’s details, warehouse ID, store ID, and more.
PATCH
/
carts
/
{cartId}
/
shipping-details
/
{shippingDetailId}
Partially update shipping detail
curl --request PATCH \
--url https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '
{
"type": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"isPickup": true,
"locationNumber": 15,
"altPickupPerson": {
"name": "Pat E Kake",
"email": "test@example.com"
},
"pickupPerson": {
"name": "Pat E Kake",
"email": "test@example.com"
},
"warehouseId": "XYZ-1234",
"storeId": "ABC-123",
"shippingCost": 150.25,
"shippingMethodId": "dfsae-2d32113-32lpdd",
"shippingDiscount": 150.25,
"shippingMethodName": "Express Delivery"
}
'import requests
url = "https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}"
payload = {
"type": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"isPickup": True,
"locationNumber": 15,
"altPickupPerson": {
"name": "Pat E Kake",
"email": "test@example.com"
},
"pickupPerson": {
"name": "Pat E Kake",
"email": "test@example.com"
},
"warehouseId": "XYZ-1234",
"storeId": "ABC-123",
"shippingCost": 150.25,
"shippingMethodId": "dfsae-2d32113-32lpdd",
"shippingDiscount": 150.25,
"shippingMethodName": "Express Delivery"
}
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-fabric-tenant-id': '<x-fabric-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'SHIP_TO_ADDRESS',
taxCode: 'FR1000',
isPickup: true,
locationNumber: 15,
altPickupPerson: {name: 'Pat E Kake', email: 'test@example.com'},
pickupPerson: {name: 'Pat E Kake', email: 'test@example.com'},
warehouseId: 'XYZ-1234',
storeId: 'ABC-123',
shippingCost: 150.25,
shippingMethodId: 'dfsae-2d32113-32lpdd',
shippingDiscount: 150.25,
shippingMethodName: 'Express Delivery'
})
};
fetch('https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}', 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.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'SHIP_TO_ADDRESS',
'taxCode' => 'FR1000',
'isPickup' => true,
'locationNumber' => 15,
'altPickupPerson' => [
'name' => 'Pat E Kake',
'email' => 'test@example.com'
],
'pickupPerson' => [
'name' => 'Pat E Kake',
'email' => 'test@example.com'
],
'warehouseId' => 'XYZ-1234',
'storeId' => 'ABC-123',
'shippingCost' => 150.25,
'shippingMethodId' => 'dfsae-2d32113-32lpdd',
'shippingDiscount' => 150.25,
'shippingMethodName' => 'Express Delivery'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$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.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}"
payload := strings.NewReader("{\n \"type\": \"SHIP_TO_ADDRESS\",\n \"taxCode\": \"FR1000\",\n \"isPickup\": true,\n \"locationNumber\": 15,\n \"altPickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"pickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"warehouseId\": \"XYZ-1234\",\n \"storeId\": \"ABC-123\",\n \"shippingCost\": 150.25,\n \"shippingMethodId\": \"dfsae-2d32113-32lpdd\",\n \"shippingDiscount\": 150.25,\n \"shippingMethodName\": \"Express Delivery\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
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.patch("https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"SHIP_TO_ADDRESS\",\n \"taxCode\": \"FR1000\",\n \"isPickup\": true,\n \"locationNumber\": 15,\n \"altPickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"pickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"warehouseId\": \"XYZ-1234\",\n \"storeId\": \"ABC-123\",\n \"shippingCost\": 150.25,\n \"shippingMethodId\": \"dfsae-2d32113-32lpdd\",\n \"shippingDiscount\": 150.25,\n \"shippingMethodName\": \"Express Delivery\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/carts/{cartId}/shipping-details/{shippingDetailId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"SHIP_TO_ADDRESS\",\n \"taxCode\": \"FR1000\",\n \"isPickup\": true,\n \"locationNumber\": 15,\n \"altPickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"pickupPerson\": {\n \"name\": \"Pat E Kake\",\n \"email\": \"test@example.com\"\n },\n \"warehouseId\": \"XYZ-1234\",\n \"storeId\": \"ABC-123\",\n \"shippingCost\": 150.25,\n \"shippingMethodId\": \"dfsae-2d32113-32lpdd\",\n \"shippingDiscount\": 150.25,\n \"shippingMethodName\": \"Express Delivery\"\n}"
response = http.request(request)
puts response.read_body{
"id": "fef78121-bee3-4448-bf1c-d5b5461dbda2",
"createdAt": "2022-09-06T14:07:17.000Z",
"updatedAt": "2022-09-06T14:07:17.000Z",
"address": {
"addressLine1": "123 Main St.",
"city": "Seattle",
"region": "WA",
"country": "USA",
"postalCode": "98121",
"addressLine2": "Suite 100",
"addressLine3": "Seventh floor",
"addressLine4": "Attention: Pat E. Kake",
"attention": "Billing manager",
"email": "test@example.com",
"type": "shipping",
"name": "Pat E Kake",
"phone": {
"number": "123-456-7899",
"type": "MOBILE"
}
},
"type": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"isPickup": true,
"altPickupPerson": {
"name": "Pat E Kake",
"phone": {
"number": "123-456-7899",
"type": "MOBILE"
},
"email": "test@example.com"
},
"pickupPerson": {
"name": "Pat E Kake",
"phone": {
"number": "123-456-7899",
"type": "MOBILE"
},
"email": "test@example.com"
},
"warehouseId": "XYZ-1234",
"storeId": "ABC-123",
"shippingCost": 150.25,
"shippingMethodId": "dfsae-2d32113-32lpdd",
"shippingDiscount": 150.25,
"shippingMethodName": "Express Delivery"
}{
"type": "BAD_REQUEST",
"message": "Bad Request"
}{
"type": "UNAUTHORIZED",
"message": "Unauthorized User"
}{
"type": "NOT_FOUND",
"message": "Cart not found"
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}Authorizations
Headers
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
Path Parameters
Body
application/json
Request body containing shipping details to be updated
Request body to update shipping details
Response
OK
Shipping Details
Was this page helpful?
