Schedule a meeting

Bag

Create Bag Via Hub

URL

PROD https://api.skypostal.com

TEST https://api-test.skypostal.com

Endpoint

POST /wcf-services/service-bags.svc/bags/create-bag-via-hub

Request Parameters

Parameters

user_info

Object - Required

User Info Definition.

bag_info

Object - Required

Bag Info Definition.

User Info Definition

Parameters

user_code

Integer - Required

This is the user code provided by Skypostal.

user_key

String - Required

This is the app key provided by Skypostal.

app_key

String - Required

This is the app key provided by Skypostal.

Bag Info Definition

Parameters

bag_header

Object - Required

Bag header definition.

bag_detail

Object - Required

Bag detail definition.

Bag header definition

Parameters

copa_id

Integer - Required

Client identificator provided by Skypostal.

client_bag_reference

String - Required

Reference for the bag.

departure_point

Object - Required

Departure point definition.

entry_point

Object - Required

Entry point definition.

via_hub

Object - If null or not sent, default US-MIA hub will be used

Entry point definition.

options

Object - Required

Options definition.

Departure point definition

Parameters

country_iso_code

String - Required

2 characters iso code. (e.g. BR, MX, US, etc.).

iata_code

String - Required

Point of entry - IATA Code.

gateway_type

Integer - Required

Transportation Type Definition.

Entry point definition

Parameters

country_iso_code

String - Required

2 characters iso code. (e.g. BR, MX, US, etc.).

iata_code

String - Required

Point of entry - IATA Code.

gateway_type

Integer - Required

Transportation Type Definition.

Transportation Type Definition

Value

Description

1.

Air.

2.

Land.

3.

Sea.

Options definition

Parameters

Description

bag_type

Integer - Required Only for Packet

1 for bag max 30kg, 2 for pallet max 500kg.

bag_service_type

String - Required Only for Packet

Applies for packet service and has to match one from the table.

import_service_type

String - Required

Import Service Type Definition. Value matching any of the list.

clearance_value_type

String - Required

2-char clearance value type. Default: NV ("No Value Specified"). For MX Available options: "HV" and "LV". For "High Value" and "Low Value" respectively.

bag_image_format

String - Valid Only For Packet

Bag Image format. Available options: "PDF" and "PNG".

Bag Service Type Definition.

String value matching any of the following list:

Value

Description

NX

For shipments created with rate service code 301.

IX

For shipments created with rate service code 302.

XP

For shipments created with rate service code 303.

Import Service Type Definition.

String value matching any of the following list:

Value

Description

DDU

Customs Unpaid.

DDP

Customs Paid.

Bag detail definition

Parameters

external_tracking

String - Required

Identifier of the shipment to manifest, can send label, awb, extr_tracking.

Remember

user_code, user_key and app_key are generic credentials, make sure to request your own for TEST and PROD environemnts.

Comments

This endpoint returns the bag_id

The command should be run as in the following example:

{
    "user_info": {
        "user_code": 123123,
        "user_key": "ok",
        "app_key": "ok"
    },
    "bag_info": {
        "bag_header": {
            "copa_id": 616,
            "client_bag_reference": "bag-number-01",
            "departure_point": {
                "country_iso_code": "CN",
                "iata_code": "PVG",
                "gateway_type": 1
            },
            "entry_point": {
                "country_iso_code": "CL",
                "iata_code": "SCL",
                "gateway_type": 1
            },
            "via_hub" : { 
                "country_iso_code" : "US", 
                "iata_code" : "MIA", 
                "gateway_type" : 1 
            },
            "options": {
                "bag_type": 1,
                "bag_service_type": "",
                "import_service_type": "DDU",
                "clearance_value_type": "NV",
                "bag_image_format": null
            }
        },
        "bag_detail": [
            {
                "external_tracking": "item-number-01"
            },
            {
                "external_tracking": "item-number-02"
            },
            {
                "external_tracking": "item-number-03"
            },
            {
                "external_tracking": "item-number-04"
            },
            {
                "external_tracking": "item-number-05"
            }
        ]
    }
}

The command will return the following format:

{
    "additional_info": {
        "internal": [],
        "server": {
            "server_id": null,
            "server_time": 4.1814098
        }
    },
    "data": [
        {
            "_verify": true,
            "bag_id": 293419,
            "bag_status": "CLOSED",
            "bag_total_items": 3,
            "bag_total_weight_kg": 3,
            "client_bag_reference": "bag-number-01",
            "error": {
                "error_description": "",
                "error_location": "",
                "system_error": false
            },
            "provider_bag_info": {
                "provider_bag_label_image": null,
                "provider_bag_label_zpl": "",
                "provider_bag_number": ""
            }
        }
    ]
}