Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.1 kB
3
Indexable
Never
import requests

url = "https://api.shipit.cl/v/shipments"

payload = {
    "reference": "pruebasSS6",
    "kind": 0,
    "platform": 2,
        "destiny": {
        "kind": "home_delivery",
        "street": "el nocedal",
        "number": "7330",
        "commune_id": 307,
        "commune_name": "la reina",
        "full_name": "Seba"
    },
    "sizes": {
        "length": "10.0",
        "height": "10.0",
        "width": "10.0",
        "weight": "1.0"
    },
    "items": 1,
    "sandbox": False,
    "courier": {
        "name": "moova",
        "id": 2,
        "payable": "false",
        "selected": "true",
        "algorithm": "1",
        "algorithm_days": "0",
        "without_courier": "false",
        "country_id": 2,
    },
    "insurance": {
        "ticket_amount": "0.0",
        "extra": "false"
    },
}
headers = {
    "Accept": "application/vnd.shipit.v4",
    "Content-Type": "application/json",
    "X-Shipit-Email": "staff@shipit.cl",
    "X-Shipit-Access-Token": ""
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)