API reference
Shipping API
Set up delivery profiles, shipping zones and rates, including pincode-based rates.
Available Brands and agencies
Use the Shipping API to manage how your store ships. A delivery profile groups variants. Each profile has shipping zones, which are sets of countries. Each zone has shipping rates, which set the price and delivery time for matching carts.
Calls are made from your server with a channel API key. The key identifies your store, so no merchant id appears in the paths.
Live checkout delivery estimates are shown by Shopflo checkout. An API to query serviceability for a pincode is not available yet.
Base URL: https://api.shopflo.co
Authentication: Merchant API key
A channel API key from your Shopflo dashboard, sent as the whole value of the Authorization header.
Endpoints
Delivery profiles
Create a delivery profile
/pe/api/v2/delivery-profile
Creates a delivery profile. A profile groups the variants that share the same shipping zones and rates.
Request body
- delivery_profile_idstringRequired
An id you choose. It must be unique among your delivery profiles. Required on create. Leave it out on update.
- namestringOptional
Profile name.
- is_defaultbooleanOptional
Marks the profile Shopflo uses for variants that belong to no profile.
- platformstringOptional
Defaults to
SHOPFLO. Values:SHOPIFY,SHOPFLO,WOO_COMMERCE,MAGENTO,BIG_COMMERCE,SQUARE,ECWID,OPEN_CART,DUKAAN,CUSTOM,OTHER. - variant_idsarray of stringOptional
The variants that use this profile. A variant belongs to one profile, so assigning it here moves it out of any other profile.
- is_activebooleanOptional
Defaults to true. On update, leaving it out sets it to true.
Response fields in data
- delivery_profile_idstringRequired
The profile id.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Profile name.
- is_defaultbooleanOptional
Whether this is the profile used for variants that belong to no profile.
- platformstringOptional
Where the profile comes from.
- is_activebooleanOptional
Whether the profile is active.
- product_variants_countintegerOptional
How many variants are assigned to the profile.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
A variant belongs to one profile. Variants in variant_ids are removed from any other profile first. Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
409 | GE_001 | A delivery profile with this delivery_profile_id already exists for your store. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X POST "https://api.shopflo.co/pe/api/v2/delivery-profile" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"delivery_profile_id": "your_profile_id",
"name": "Standard delivery",
"is_default": true,
"variant_ids": ["44123456789", "44123456790"]
}'const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
delivery_profile_id: "your_profile_id",
name: "Standard delivery",
is_default: true,
variant_ids: ["44123456789", "44123456790"]
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/pe/api/v2/delivery-profile",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"delivery_profile_id": "your_profile_id",
"name": "Standard delivery",
"is_default": True,
"variant_ids": ["44123456789", "44123456790"]
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"delivery_profile_id": "your_profile_id",
"name": "Standard delivery",
"is_default": true,
"variant_ids": ["44123456789", "44123456790"]
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"delivery_profile_id": "your_profile_id",
"name": "Standard delivery",
"is_default": true,
"variant_ids": ["44123456789", "44123456790"]
}`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/pe/api/v2/delivery-profile", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'delivery_profile_id' => 'your_profile_id',
'name' => 'Standard delivery',
'is_default' => true,
'variant_ids' => ['44123456789', '44123456790']
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Delivery Profile Created Successfully",
"data": {
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "Standard delivery",
"is_default": true,
"platform": "SHOPFLO",
"is_active": true,
"product_variants_count": 2,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}List delivery profiles
/pe/api/v2/delivery-profile
Returns all your delivery profiles.
Response fields in data
- delivery_profile_idstringRequired
The profile id.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Profile name.
- is_defaultbooleanOptional
Whether this is the profile used for variants that belong to no profile.
- platformstringOptional
Where the profile comes from.
- is_activebooleanOptional
Whether the profile is active.
- product_variants_countintegerOptional
How many variants are assigned to the profile.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
data is an array of profiles with the fields below.
Errors
| Status | Code | When |
|---|---|---|
404 | GE_004 | You have no delivery profiles yet. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS "https://api.shopflo.co/pe/api/v2/delivery-profile" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/pe/api/v2/delivery-profile",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/pe/api/v2/delivery-profile", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "All Delivery Profiles For Merchant",
"data": [
{
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "Standard delivery",
"is_default": true,
"platform": "SHOPFLO",
"is_active": true,
"product_variants_count": 2,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
]
}Get a delivery profile
/pe/api/v2/delivery-profile/{delivery_profile_id}
Returns one delivery profile.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
Response fields in data
- delivery_profile_idstringRequired
The profile id.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Profile name.
- is_defaultbooleanOptional
Whether this is the profile used for variants that belong to no profile.
- platformstringOptional
Where the profile comes from.
- is_activebooleanOptional
Whether the profile is active.
- product_variants_countintegerOptional
How many variants are assigned to the profile.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No delivery profile with this id exists for your store. |
curl -sS "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Delivery Profile Fetched Successfully",
"data": {
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "Standard delivery",
"is_default": true,
"platform": "SHOPFLO",
"is_active": true,
"product_variants_count": 2,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Update a delivery profile
/pe/api/v2/delivery-profile/{delivery_profile_id}
Changes a delivery profile. Fields you leave out keep their value, except is_active, which becomes true when you leave it out.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
Request body
- namestringOptional
Profile name.
- is_defaultbooleanOptional
Marks the profile Shopflo uses for variants that belong to no profile.
- platformstringOptional
Defaults to
SHOPFLO. Values:SHOPIFY,SHOPFLO,WOO_COMMERCE,MAGENTO,BIG_COMMERCE,SQUARE,ECWID,OPEN_CART,DUKAAN,CUSTOM,OTHER. - variant_idsarray of stringOptional
The variants that use this profile. A variant belongs to one profile, so assigning it here moves it out of any other profile.
- is_activebooleanOptional
Defaults to true. On update, leaving it out sets it to true.
Response fields in data
- delivery_profile_idstringRequired
The profile id.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Profile name.
- is_defaultbooleanOptional
Whether this is the profile used for variants that belong to no profile.
- platformstringOptional
Where the profile comes from.
- is_activebooleanOptional
Whether the profile is active.
- product_variants_countintegerOptional
How many variants are assigned to the profile.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
variant_ids replaces the profile's variants. Send an empty array to remove all of them. Leave variant_ids out to keep the current variants. Variants you add are removed from any other profile. Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No delivery profile with this id exists for your store. |
curl -sS -X PATCH "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Express delivery",
"is_active": true
}'const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Express delivery",
is_active: true
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"name": "Express delivery",
"is_active": True
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"name": "Express delivery",
"is_active": true
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"name": "Express delivery",
"is_active": true
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Express delivery',
'is_active' => true
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Delivery Profile Updated Successfully",
"data": {
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "Standard delivery",
"is_default": true,
"platform": "SHOPFLO",
"is_active": true,
"product_variants_count": 2,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Delete a delivery profile
/pe/api/v2/delivery-profile/{delivery_profile_id}
Deletes a delivery profile and returns it as it was.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
Response fields in data
- delivery_profile_idstringRequired
The profile id.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Profile name.
- is_defaultbooleanOptional
Whether this is the profile used for variants that belong to no profile.
- platformstringOptional
Where the profile comes from.
- is_activebooleanOptional
Whether the profile is active.
- product_variants_countintegerOptional
How many variants are assigned to the profile.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No delivery profile with this id exists for your store. |
curl -sS -X DELETE "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id", {
method: "DELETE",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.delete(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Delivery Profile Deleted Successfully",
"data": {
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "Standard delivery",
"is_default": true,
"platform": "SHOPFLO",
"is_active": true,
"product_variants_count": 2,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Find the profile of variants
/pe/api/v2/delivery-profile/variant-profile
Returns the delivery profile each variant belongs to.
Query parameters
- variant-idsstringRequired
Variant ids separated by commas. The query parameter name has a hyphen.
Response fields in data
- delivery_profile_idstringRequired
The profile id.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Profile name.
- is_defaultbooleanOptional
Whether this is the profile used for variants that belong to no profile.
- platformstringOptional
Where the profile comes from.
- is_activebooleanOptional
Whether the profile is active.
- product_variants_countintegerOptional
How many variants are assigned to the profile.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
data is an object. Each key is a variant id and each value is a delivery profile with the fields below. If none of the variants is assigned to a profile, every variant maps to your default profile. If some are assigned, only those variants appear.
Errors
| Status | Code | When |
|---|---|---|
404 | GE_004 | None of the variants is in a profile and you have no delivery profiles. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS "https://api.shopflo.co/pe/api/v2/delivery-profile/variant-profile?variant-ids=44123456789,44123456790" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/variant-profile?variant-ids=44123456789,44123456790", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/pe/api/v2/delivery-profile/variant-profile?variant-ids=44123456789,44123456790",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/variant-profile?variant-ids=44123456789,44123456790"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/pe/api/v2/delivery-profile/variant-profile?variant-ids=44123456789,44123456790", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/variant-profile?variant-ids=44123456789,44123456790");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Delivery Profile For Variant Ids",
"data": {
"44123456789": {
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "Standard delivery",
"is_default": true,
"platform": "SHOPFLO",
"is_active": true,
"product_variants_count": 2,
"created_at": 1766000000000,
"updated_at": 1766000000000
},
"44123456790": {
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "Standard delivery",
"is_default": true,
"platform": "SHOPFLO",
"is_active": true,
"product_variants_count": 2,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}
}Add products to a delivery profile
/pe/api/v2/delivery-profile/{delivery_profile_id}/add-products
Moves every variant of the given products into this delivery profile. The change is applied in the background after the response is sent.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
Request body
- product_idsarray of stringRequired
The products to add. Product ids that are not in your catalog are skipped.
Response fields in data
- delivery_profile_idstringRequired
The profile id.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Profile name.
- is_defaultbooleanOptional
Whether this is the profile used for variants that belong to no profile.
- platformstringOptional
Where the profile comes from.
- is_activebooleanOptional
Whether the profile is active.
- product_variants_countintegerOptional
How many variants are assigned to the profile.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
The response shows the profile as it was before the move finishes, so product_variants_count can be out of date. Fetch the profile again to see the new count. A variant belongs to one profile, so each moved variant leaves its old profile.
Errors
| Status | Code | When |
|---|---|---|
404 | GE_004 | The delivery profile does not exist, or a product in the list has no variants. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X PUT "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/add-products" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"product_ids": ["prod_123"]
}'const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/add-products", {
method: "PUT",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
product_ids: ["prod_123"]
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.put(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/add-products",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"product_ids": ["prod_123"]
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"product_ids": ["prod_123"]
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/add-products"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"product_ids": ["prod_123"]
}`)
req, err := http.NewRequest("PUT", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/add-products", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/add-products");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'product_ids' => ['prod_123']
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product Added To Delivery Profile Successfully",
"data": {
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "Standard delivery",
"is_default": true,
"platform": "SHOPFLO",
"is_active": true,
"product_variants_count": 2,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Shipping zones
Create a shipping zone
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone
Creates a shipping zone inside a delivery profile. A zone is a set of countries, and it holds the shipping rates for them.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
Request body
- namestringOptional
Zone name.
- countriesarrayOptional
The countries the zone covers. On update, sending a non-empty list replaces the current countries.
- country_codestringRequired
Country code, for example
IN. - namestringOptional
Country name.
- taxnumberOptional
Tax for the country.
- tax_namestringOptional
Tax name.
- provincesarrayRequired
Provinces or states within the country. Send an empty array when the zone covers the whole country.
- province_codestringRequired
Province or state code.
- namestringOptional
Province or state name.
- ratesarrayOptional
Rates to create with the zone. Each item has the fields of Create a shipping rate.
- platformstringOptional
Defaults to
SHOPFLO. - is_activebooleanOptional
Defaults to true. On update, leaving it out sets it to true.
Response fields in data
- idstringRequired
The shipping zone id.
- delivery_profile_idstringRequired
The delivery profile the zone belongs to.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Zone name.
- platformstringOptional
Where the zone comes from.
- is_activebooleanOptional
Whether the zone is active.
- countriesarrayOptional
Present on create, and on get when
include-countriesis true. Each country hascountry_code,name,tax,tax_nameandprovinces. - ratesarrayOptional
Present on create when you sent rates, and on get when
include-ratesis true. Each item has the fields of a shipping rate. - created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Every country needs a provinces array, even an empty one. Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X POST "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "India",
"countries": [
{
"country_code": "IN",
"name": "India",
"provinces": []
}
]
}'const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "India",
countries: [
{
country_code: "IN",
name: "India",
provinces: []
}
]
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"name": "India",
"countries": [
{
"country_code": "IN",
"name": "India",
"provinces": []
}
]
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"name": "India",
"countries": [
{
"country_code": "IN",
"name": "India",
"provinces": []
}
]
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"name": "India",
"countries": [
{
"country_code": "IN",
"name": "India",
"provinces": []
}
]
}`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'India',
'countries' => [
[
'country_code' => 'IN',
'name' => 'India',
'provinces' => []
]
]
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zone Created Successfully",
"data": {
"id": "your_zone_id",
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "India",
"platform": "SHOPFLO",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}List shipping zones
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone
Returns the shipping zones of a delivery profile, without their countries or rates.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
Response fields in data
- idstringRequired
The shipping zone id.
- delivery_profile_idstringRequired
The delivery profile the zone belongs to.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Zone name.
- platformstringOptional
Where the zone comes from.
- is_activebooleanOptional
Whether the zone is active.
- countriesarrayOptional
Present on create, and on get when
include-countriesis true. Each country hascountry_code,name,tax,tax_nameandprovinces. - ratesarrayOptional
Present on create when you sent rates, and on get when
include-ratesis true. Each item has the fields of a shipping rate. - created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
data is an array of zones.
Errors
| Status | Code | When |
|---|---|---|
404 | GE_004 | The delivery profile has no shipping zones. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zones Fetched Successfully",
"data": [
{
"id": "your_zone_id",
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "India",
"platform": "SHOPFLO",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
]
}Get a shipping zone
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}
Returns one shipping zone. Add the query parameters to include its countries, provinces and rates.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
Query parameters
- include-ratesbooleanOptional
Set to true to include the zone's rates.
- include-countriesbooleanOptional
Set to true to include the zone's countries.
- include-provincesbooleanOptional
Set to true, together with
include-countries, to include the provinces of each country.
Response fields in data
- idstringRequired
The shipping zone id.
- delivery_profile_idstringRequired
The delivery profile the zone belongs to.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Zone name.
- platformstringOptional
Where the zone comes from.
- is_activebooleanOptional
Whether the zone is active.
- countriesarrayOptional
Present on create, and on get when
include-countriesis true. Each country hascountry_code,name,tax,tax_nameandprovinces. - ratesarrayOptional
Present on create when you sent rates, and on get when
include-ratesis true. Each item has the fields of a shipping rate. - created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No shipping zone with this id exists in this delivery profile. |
curl -sS "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id?include-rates=true&include-countries=true" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id?include-rates=true&include-countries=true", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id?include-rates=true&include-countries=true",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id?include-rates=true&include-countries=true"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id?include-rates=true&include-countries=true", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id?include-rates=true&include-countries=true");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zone Fetched Successfully",
"data": {
"id": "your_zone_id",
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "India",
"platform": "SHOPFLO",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Update a shipping zone
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}
Changes a shipping zone. Fields you leave out keep their value, except is_active, which becomes true when you leave it out.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
Request body
- namestringOptional
Zone name.
- countriesarrayOptional
The countries the zone covers. On update, sending a non-empty list replaces the current countries.
- country_codestringRequired
Country code, for example
IN. - namestringOptional
Country name.
- taxnumberOptional
Tax for the country.
- tax_namestringOptional
Tax name.
- provincesarrayRequired
Provinces or states within the country. Send an empty array when the zone covers the whole country.
- province_codestringRequired
Province or state code.
- namestringOptional
Province or state name.
- platformstringOptional
Defaults to
SHOPFLO. - is_activebooleanOptional
Defaults to true. On update, leaving it out sets it to true.
Response fields in data
- idstringRequired
The shipping zone id.
- delivery_profile_idstringRequired
The delivery profile the zone belongs to.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Zone name.
- platformstringOptional
Where the zone comes from.
- is_activebooleanOptional
Whether the zone is active.
- countriesarrayOptional
Present on create, and on get when
include-countriesis true. Each country hascountry_code,name,tax,tax_nameandprovinces. - ratesarrayOptional
Present on create when you sent rates, and on get when
include-ratesis true. Each item has the fields of a shipping rate. - created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Rates are not changed here. Use the shipping rate endpoints.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No shipping zone with this id exists in this delivery profile. |
curl -sS -X PATCH "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "India and Nepal",
"is_active": true
}'const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "India and Nepal",
is_active: true
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"name": "India and Nepal",
"is_active": True
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"name": "India and Nepal",
"is_active": true
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"name": "India and Nepal",
"is_active": true
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'India and Nepal',
'is_active' => true
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zone Updated Successfully",
"data": {
"id": "your_zone_id",
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "India",
"platform": "SHOPFLO",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Delete a shipping zone
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}
Deletes a shipping zone and returns it as it was.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
Response fields in data
- idstringRequired
The shipping zone id.
- delivery_profile_idstringRequired
The delivery profile the zone belongs to.
- merchant_idstringRequired
Your merchant id.
- namestringOptional
Zone name.
- platformstringOptional
Where the zone comes from.
- is_activebooleanOptional
Whether the zone is active.
- countriesarrayOptional
Present on create, and on get when
include-countriesis true. Each country hascountry_code,name,tax,tax_nameandprovinces. - ratesarrayOptional
Present on create when you sent rates, and on get when
include-ratesis true. Each item has the fields of a shipping rate. - created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No shipping zone with this id exists in this delivery profile. |
curl -sS -X DELETE "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id", {
method: "DELETE",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.delete(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zone Deleted Successfully",
"data": {
"id": "your_zone_id",
"delivery_profile_id": "your_profile_id",
"merchant_id": "your_merchant_id",
"name": "India",
"platform": "SHOPFLO",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Shipping rates
Create a shipping rate
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}/shipping-rate
Creates a shipping rate in a shipping zone. A rate says what shipping costs and how long it takes for carts that match its subtotal or weight range.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
Request body
- namestringRequired
Rate name shown to shoppers.
- descriptionstringOptional
Description.
- shipping_rate_typestringRequired
PRICE_BASEDorWEIGHT_BASED.PINCODE_BASEDis described in the notes.RULE_BASEDalso exists and is not covered here. - pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal the rate applies to.
- max_order_subtotalnumberOptional
Largest cart subtotal the rate applies to.
- min_weight_subtotalnumberOptional
Smallest cart weight the rate applies to.
- max_weight_subtotalnumberOptional
Largest cart weight the rate applies to.
- weight_unitstringOptional
KG,G,LBorOZ. - cod_enabledbooleanOptional
Whether cash on delivery is available with this rate.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text shown to shoppers.
- is_activebooleanOptional
Defaults to true. On update, leaving it out sets it to true.
Response fields in data
- idstringRequired
The shipping rate id.
- merchant_idstringRequired
Your merchant id.
- shipping_zone_idstringRequired
The zone the rate belongs to.
- namestringRequired
Rate name.
- descriptionstringOptional
Description.
- shipping_rate_typestringRequired
The rate type.
- pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal.
- max_order_subtotalnumberOptional
Largest cart subtotal.
- min_weight_subtotalnumberOptional
Smallest cart weight.
- max_weight_subtotalnumberOptional
Largest cart weight.
- weight_unitstringOptional
Weight unit.
- cod_enabledbooleanOptional
Cash on delivery available.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text.
- is_activebooleanOptional
Whether the rate is active.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
If you send max_order_subtotal without min_order_subtotal, the minimum is set to 0.
A PINCODE_BASED rate needs a pincode file, and the file is uploaded from the Shopflo dashboard. If you send PINCODE_BASED here, the rate is stored as a price based rate, or as a weight based rate when you send a weight range.
Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | name is missing (Name is required while shipping rate creation) or shipping_rate_type is missing or not a valid value (Shipping Rate Type is Mandatory). |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X POST "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49,
"max_order_subtotal": 999,
"cod_enabled": true,
"cod_extra_charges": 30,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days"
}'const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Standard",
shipping_rate_type: "PRICE_BASED",
price: 49,
max_order_subtotal: 999,
cod_enabled: true,
cod_extra_charges: 30,
min_days_to_deliver: 3,
max_days_to_deliver: 5,
etd_text: "Delivered in 3 to 5 days"
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49,
"max_order_subtotal": 999,
"cod_enabled": True,
"cod_extra_charges": 30,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days"
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49,
"max_order_subtotal": 999,
"cod_enabled": true,
"cod_extra_charges": 30,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days"
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49,
"max_order_subtotal": 999,
"cod_enabled": true,
"cod_extra_charges": 30,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days"
}`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Standard',
'shipping_rate_type' => 'PRICE_BASED',
'price' => 49,
'max_order_subtotal' => 999,
'cod_enabled' => true,
'cod_extra_charges' => 30,
'min_days_to_deliver' => 3,
'max_days_to_deliver' => 5,
'etd_text' => 'Delivered in 3 to 5 days'
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zone Rate Created Successfully",
"data": {
"id": "your_rate_id",
"merchant_id": "your_merchant_id",
"shipping_zone_id": "your_zone_id",
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49.0,
"min_order_subtotal": 0.0,
"max_order_subtotal": 999.0,
"cod_enabled": true,
"cod_extra_charges": 30.0,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}List shipping rates
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}/shipping-rate
Returns the shipping rates of a shipping zone, oldest first.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
Response fields in data
- idstringRequired
The shipping rate id.
- merchant_idstringRequired
Your merchant id.
- shipping_zone_idstringRequired
The zone the rate belongs to.
- namestringRequired
Rate name.
- descriptionstringOptional
Description.
- shipping_rate_typestringRequired
The rate type.
- pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal.
- max_order_subtotalnumberOptional
Largest cart subtotal.
- min_weight_subtotalnumberOptional
Smallest cart weight.
- max_weight_subtotalnumberOptional
Largest cart weight.
- weight_unitstringOptional
Weight unit.
- cod_enabledbooleanOptional
Cash on delivery available.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text.
- is_activebooleanOptional
Whether the rate is active.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
data is an array of rates. The message text of this response reads Shipping Zones Created Successfully. Ignore it.
Errors
| Status | Code | When |
|---|---|---|
404 | GE_004 | The shipping zone has no shipping rates. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zones Created Successfully",
"data": [
{
"id": "your_rate_id",
"merchant_id": "your_merchant_id",
"shipping_zone_id": "your_zone_id",
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49.0,
"min_order_subtotal": 0.0,
"max_order_subtotal": 999.0,
"cod_enabled": true,
"cod_extra_charges": 30.0,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
]
}Get a shipping rate
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}/shipping-rate/{shipping_rate_id}
Returns one shipping rate.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
- shipping_rate_idstringRequired
The shipping rate.
Response fields in data
- idstringRequired
The shipping rate id.
- merchant_idstringRequired
Your merchant id.
- shipping_zone_idstringRequired
The zone the rate belongs to.
- namestringRequired
Rate name.
- descriptionstringOptional
Description.
- shipping_rate_typestringRequired
The rate type.
- pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal.
- max_order_subtotalnumberOptional
Largest cart subtotal.
- min_weight_subtotalnumberOptional
Smallest cart weight.
- max_weight_subtotalnumberOptional
Largest cart weight.
- weight_unitstringOptional
Weight unit.
- cod_enabledbooleanOptional
Cash on delivery available.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text.
- is_activebooleanOptional
Whether the rate is active.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No shipping rate with this id exists in this shipping zone. |
curl -sS "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zone Rate Fetched",
"data": {
"id": "your_rate_id",
"merchant_id": "your_merchant_id",
"shipping_zone_id": "your_zone_id",
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49.0,
"min_order_subtotal": 0.0,
"max_order_subtotal": 999.0,
"cod_enabled": true,
"cod_extra_charges": 30.0,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Update a shipping rate
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}/shipping-rate/{shipping_rate_id}
Changes a shipping rate. Send the complete rate each time. For these fields, leaving one out clears it: min_order_subtotal, max_order_subtotal, min_weight_subtotal, max_weight_subtotal, min_days_to_deliver, max_days_to_deliver and etd_text. If max_order_subtotal is set and min_order_subtotal is not, the minimum becomes 0. is_active becomes true when you leave it out.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
- shipping_rate_idstringRequired
The shipping rate.
Request body
- namestringOptional
Rate name shown to shoppers.
- descriptionstringOptional
Description.
- shipping_rate_typestringOptional
PRICE_BASEDorWEIGHT_BASED.PINCODE_BASEDis described in the notes.RULE_BASEDalso exists and is not covered here. - pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal the rate applies to.
- max_order_subtotalnumberOptional
Largest cart subtotal the rate applies to.
- min_weight_subtotalnumberOptional
Smallest cart weight the rate applies to.
- max_weight_subtotalnumberOptional
Largest cart weight the rate applies to.
- weight_unitstringOptional
KG,G,LBorOZ. - cod_enabledbooleanOptional
Whether cash on delivery is available with this rate.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text shown to shoppers.
- is_activebooleanOptional
Defaults to true. On update, leaving it out sets it to true.
Response fields in data
- idstringRequired
The shipping rate id.
- merchant_idstringRequired
Your merchant id.
- shipping_zone_idstringRequired
The zone the rate belongs to.
- namestringRequired
Rate name.
- descriptionstringOptional
Description.
- shipping_rate_typestringRequired
The rate type.
- pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal.
- max_order_subtotalnumberOptional
Largest cart subtotal.
- min_weight_subtotalnumberOptional
Smallest cart weight.
- max_weight_subtotalnumberOptional
Largest cart weight.
- weight_unitstringOptional
Weight unit.
- cod_enabledbooleanOptional
Cash on delivery available.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text.
- is_activebooleanOptional
Whether the rate is active.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No shipping rate with this id exists in this shipping zone. |
curl -sS -X PATCH "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"price": 59,
"max_order_subtotal": 999,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true
}'const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
price: 59,
max_order_subtotal: 999,
min_days_to_deliver: 3,
max_days_to_deliver: 5,
etd_text: "Delivered in 3 to 5 days",
is_active: true
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"price": 59,
"max_order_subtotal": 999,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": True
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"price": 59,
"max_order_subtotal": 999,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"price": 59,
"max_order_subtotal": 999,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'price' => 59,
'max_order_subtotal' => 999,
'min_days_to_deliver' => 3,
'max_days_to_deliver' => 5,
'etd_text' => 'Delivered in 3 to 5 days',
'is_active' => true
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zone Rate Updated Successfully",
"data": {
"id": "your_rate_id",
"merchant_id": "your_merchant_id",
"shipping_zone_id": "your_zone_id",
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49.0,
"min_order_subtotal": 0.0,
"max_order_subtotal": 999.0,
"cod_enabled": true,
"cod_extra_charges": 30.0,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Delete a shipping rate
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}/shipping-rate/{shipping_rate_id}
Deletes a shipping rate and returns it as it was.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
- shipping_rate_idstringRequired
The shipping rate.
Response fields in data
- idstringRequired
The shipping rate id.
- merchant_idstringRequired
Your merchant id.
- shipping_zone_idstringRequired
The zone the rate belongs to.
- namestringRequired
Rate name.
- descriptionstringOptional
Description.
- shipping_rate_typestringRequired
The rate type.
- pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal.
- max_order_subtotalnumberOptional
Largest cart subtotal.
- min_weight_subtotalnumberOptional
Smallest cart weight.
- max_weight_subtotalnumberOptional
Largest cart weight.
- weight_unitstringOptional
Weight unit.
- cod_enabledbooleanOptional
Cash on delivery available.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text.
- is_activebooleanOptional
Whether the rate is active.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No shipping rate with this id exists in this shipping zone. |
curl -sS -X DELETE "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id", {
method: "DELETE",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.delete(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zone Rate Deleted Successfully",
"data": {
"id": "your_rate_id",
"merchant_id": "your_merchant_id",
"shipping_zone_id": "your_zone_id",
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49.0,
"min_order_subtotal": 0.0,
"max_order_subtotal": 999.0,
"cod_enabled": true,
"cod_extra_charges": 30.0,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Turn a shipping rate on or off
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}/shipping-rate/{shipping_rate_id}/toggle-status
Flips the rate between active and inactive and returns it. A rate with no stored state counts as active, so the first call turns it off.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
- shipping_rate_idstringRequired
The shipping rate.
Response fields in data
- idstringRequired
The shipping rate id.
- merchant_idstringRequired
Your merchant id.
- shipping_zone_idstringRequired
The zone the rate belongs to.
- namestringRequired
Rate name.
- descriptionstringOptional
Description.
- shipping_rate_typestringRequired
The rate type.
- pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal.
- max_order_subtotalnumberOptional
Largest cart subtotal.
- min_weight_subtotalnumberOptional
Smallest cart weight.
- max_weight_subtotalnumberOptional
Largest cart weight.
- weight_unitstringOptional
Weight unit.
- cod_enabledbooleanOptional
Cash on delivery available.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text.
- is_activebooleanOptional
Whether the rate is active.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No shipping rate with this id exists in this shipping zone. |
curl -sS -X PATCH "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id/toggle-status" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id/toggle-status", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id/toggle-status",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id/toggle-status"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("PATCH", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id/toggle-status", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/your_rate_id/toggle-status");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping rate status toggled successfully",
"data": {
"id": "your_rate_id",
"merchant_id": "your_merchant_id",
"shipping_zone_id": "your_zone_id",
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49.0,
"min_order_subtotal": 0.0,
"max_order_subtotal": 999.0,
"cod_enabled": true,
"cod_extra_charges": 30.0,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
}Update several shipping rates
/pe/api/v2/delivery-profile/{delivery_profile_id}/shipping-zone/{shipping_zone_id}/shipping-rate/bulk
Updates many rates of one shipping zone in one call. Each item follows the rules of Update a shipping rate, so send the complete rate for each one.
Path parameters
- delivery_profile_idstringRequired
The delivery profile.
- shipping_zone_idstringRequired
The shipping zone.
Request body
- (array)arrayRequired
One object per rate to update.
- idstringRequired
The id of the rate to update. It must exist in this shipping zone.
- namestringOptional
Rate name shown to shoppers.
- descriptionstringOptional
Description.
- shipping_rate_typestringOptional
PRICE_BASEDorWEIGHT_BASED.PINCODE_BASEDis described in the notes.RULE_BASEDalso exists and is not covered here. - pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal the rate applies to.
- max_order_subtotalnumberOptional
Largest cart subtotal the rate applies to.
- min_weight_subtotalnumberOptional
Smallest cart weight the rate applies to.
- max_weight_subtotalnumberOptional
Largest cart weight the rate applies to.
- weight_unitstringOptional
KG,G,LBorOZ. - cod_enabledbooleanOptional
Whether cash on delivery is available with this rate.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text shown to shoppers.
- is_activebooleanOptional
Defaults to true. On update, leaving it out sets it to true.
Response fields in data
- idstringRequired
The shipping rate id.
- merchant_idstringRequired
Your merchant id.
- shipping_zone_idstringRequired
The zone the rate belongs to.
- namestringRequired
Rate name.
- descriptionstringOptional
Description.
- shipping_rate_typestringRequired
The rate type.
- pricenumberOptional
The shipping charge.
- min_order_subtotalnumberOptional
Smallest cart subtotal.
- max_order_subtotalnumberOptional
Largest cart subtotal.
- min_weight_subtotalnumberOptional
Smallest cart weight.
- max_weight_subtotalnumberOptional
Largest cart weight.
- weight_unitstringOptional
Weight unit.
- cod_enabledbooleanOptional
Cash on delivery available.
- cod_extra_chargesnumberOptional
Extra charge for cash on delivery.
- min_days_to_deliverintegerOptional
Fastest delivery, in days.
- max_days_to_deliverintegerOptional
Slowest delivery, in days.
- etd_textstringOptional
Delivery estimate text.
- is_activebooleanOptional
Whether the rate is active.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
The request body is a JSON array, not an object. data is an array of the updated rates. The updates run in one transaction.
Errors
| Status | Code | When |
|---|---|---|
404 | GE_004 | A rate in the list does not exist in this shipping zone. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X PATCH "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/bulk" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '[
{
"id": "your_rate_id",
"price": 59,
"max_order_subtotal": 999,
"is_active": true
}
]'const res = await fetch("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/bulk", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify([
{
id: "your_rate_id",
price: 59,
max_order_subtotal: 999,
is_active: true
}
]),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/bulk",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json=[
{
"id": "your_rate_id",
"price": 59,
"max_order_subtotal": 999,
"is_active": True
}
],
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
[
{
"id": "your_rate_id",
"price": 59,
"max_order_subtotal": 999,
"is_active": true
}
]
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/bulk"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`[
{
"id": "your_rate_id",
"price": 59,
"max_order_subtotal": 999,
"is_active": true
}
]`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/bulk", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/pe/api/v2/delivery-profile/your_profile_id/shipping-zone/your_zone_id/shipping-rate/bulk");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
[
'id' => 'your_rate_id',
'price' => 59,
'max_order_subtotal' => 999,
'is_active' => true
]
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Shipping Zone Rate Updated Successfully",
"data": [
{
"id": "your_rate_id",
"merchant_id": "your_merchant_id",
"shipping_zone_id": "your_zone_id",
"name": "Standard",
"shipping_rate_type": "PRICE_BASED",
"price": 49.0,
"min_order_subtotal": 0.0,
"max_order_subtotal": 999.0,
"cod_enabled": true,
"cod_extra_charges": 30.0,
"min_days_to_deliver": 3,
"max_days_to_deliver": 5,
"etd_text": "Delivered in 3 to 5 days",
"is_active": true,
"created_at": 1766000000000,
"updated_at": 1766000000000
}
]
}