The "Create Shipping Carrier" API allows adding a new shipping carrier.
http
POST https://services.leadconnectorhq.com/store/shipping-carrierAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | Yes | 6578278e879ad2646715ba9c | Account Id or Agency Id |
altType | string | Yes | Possible values: 'account' | |
name | string | Yes | FedEx | Name of the shipping carrier |
callbackUrl | string | Yes | https://example.com/get-shipping-rates | The URL endpoint that GHL needs to retrieve shipping rates. This must be a public URL. |
services(object[]): An array of available shipping carrier servicesname(string, required): Name of the shipping carrier service Example:Priority Mail Express Internationalvalue(string, required): Value of the shipping carrier service Example:PriorityMailExpressInternational
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
allowsMultipleServiceSelection | boolean | No | True | The seller can choose multiple services while creating shipping rates if this is true. |
Responses
201 - Successful response
status(boolean, required): Status of api action Example:Truemessage(string): Success message Example:Successfully createddata(object, required): Shipping carrier data
json
{
"status": true,
"message": "Successfully created"
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/store/shipping-carrier' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"name": "FedEx",
"callbackUrl": "https://example.com/get-shipping-rates",
"services": [
{
"name": "Priority Mail Express International",
"value": "PriorityMailExpressInternational"
}
],
"allowsMultipleServiceSelection": true
}'const response = await fetch('https://services.leadconnectorhq.com/store/shipping-carrier', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "name": "FedEx", "callbackUrl": "https://example.com/get-shipping-rates", "services": [{"name": "Priority Mail Express International", "value": "PriorityMailExpressInternational"}], "allowsMultipleServiceSelection": true}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/store/shipping-carrier',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "name": "FedEx", "callbackUrl": "https://example.com/get-shipping-rates", "services": [{"name": "Priority Mail Express International", "value": "PriorityMailExpressInternational"}], "allowsMultipleServiceSelection": true},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/store/shipping-carrier');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'name': 'FedEx', 'callbackUrl': 'https://example.com/get-shipping-rates', 'services': [{'name': 'Priority Mail Express International', 'value': 'PriorityMailExpressInternational'}], 'allowsMultipleServiceSelection': true}),
]);
$data = json_decode(curl_exec($ch), true);