Skip to main content
The “update Shipping Zone” API allows update a shipping zone to the system.
PUT https://services.leadconnectorhq.com/store/shipping-zone/{shippingZoneId}

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

shippingZoneId
string
default:"6578278e879ad2646715ba9c"
required
ID of the item that needs to be returned

Body

altId
string
default:"6578278e879ad2646715ba9c"
Account Id or Agency Id
altType
string
Posibles valores: ‘account’
name
string
default:"North zone"
Name of the shipping zone
countries
object[]
List of countries that are available

Respuestas

status
boolean
default:"True"
required
Status of api action
message
string
default:"Successfully created"
Success message
data
object
required
Shipping zone data
{
  "status": true,
  "message": "Successfully created"
}
{}
{}
{}

Ejemplo

curl -X PUT 'https://services.leadconnectorhq.com/store/shipping-zone/YOUR_shippingZoneId' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "altId": "6578278e879ad2646715ba9c",
  "altType": "account",
  "name": "North zone",
  "countries": [
    {
      "code": "US",
      "states": [
        {}
      ]
    }
  ]
}'
const response = await fetch('https://services.leadconnectorhq.com/store/shipping-zone/YOUR_shippingZoneId', {
  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": "North zone", "countries": [{"code": "US", "states": [{}]}]}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'PUT',
    'https://services.leadconnectorhq.com/store/shipping-zone/YOUR_shippingZoneId',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "name": "North zone", "countries": [{"code": "US", "states": [{}]}]},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/store/shipping-zone/YOUR_shippingZoneId');
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': 'North zone', 'countries': [{'code': 'US', 'states': [{}]}]}),
]);
$data = json_decode(curl_exec($ch), true);