The “update Shipping Carrier” API allows update a shipping carrier to the system.
PUT https://services.leadconnectorhq.com/store/shipping-carrier/{shippingCarrierId}
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.
Path parameters
shippingCarrierId
string
default:"6578278e879ad2646715ba9c"
required
ID of the shipping carrier that needs to be returned
Body
altId
string
default:"6578278e879ad2646715ba9c"
Account Id or Agency Id
Posibles valores: ‘account’
Name of the shipping carrier
callbackUrl
string
default:"https://example.com/get-shipping-rates"
The URL endpoint that GHL needs to retrieve shipping rates. This must be a public URL.
An array of available shipping carrier services
name
string
default:"Priority Mail Express International"
required
Name of the shipping carrier service
value
string
default:"PriorityMailExpressInternational"
required
Value of the shipping carrier service
allowsMultipleServiceSelection
The seller can choose multiple services while creating shipping rates if this is true.
Respuestas
200 - Successful response
status
boolean
default:"True"
required
Status of api action
message
string
default:"Successfully created"
Success message
{
"status": true,
"message": "Successfully created"
}
422 - Unprocessable Entity
Ejemplo
curl -X PUT 'https://services.leadconnectorhq.com/store/shipping-carrier/YOUR_shippingCarrierId' \
-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/YOUR_shippingCarrierId', {
method: 'PUT',
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(
'PUT',
'https://services.leadconnectorhq.com/store/shipping-carrier/YOUR_shippingCarrierId',
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/YOUR_shippingCarrierId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
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);