Pickup
Schedule
import karrio
from karrio.core.models import PickupRequest
request = PickupRequest(...)
pickup, messages = karrio.Pickup.schedule(request).from_(carrier_gateway).parse()
Parameters
PickupRequest
Name | Type | Description |
---|---|---|
pickup_date | str | required |
ready_time | str | required |
closing_time | str | required |
address | Address | required |
parcels | List[Parcel] | |
instruction | str | |
package_location | str | |
options | dict |
Address
Name | Type | Description |
---|---|---|
id | str | |
postal_code | str | |
city | str | |
person_name | str | |
company_name | str | |
country_code | str | |
email | str | |
phone_number | str | |
state_code | str | |
residential | bool | |
address_line1 | str | |
address_line2 | str | |
federal_tax_id | str | |
state_tax_id | str | |
extra | AddressExtra |
AddressExtra
Name | Type | Description |
---|---|---|
street_name | str | |
street_number | str | |
street_type | str | |
suburb | str | |
suite | str |
Parcel
Name | Type | Description |
---|---|---|
id | str | |
weight | float | |
width | float | |
height | float | |
length | float | |
packaging_type | str | |
package_preset | str | |
description | str | |
content | str | |
is_document | bool | |
weight_unit | str | |
dimension_unit | str |
Response
PickupDetails
Name | Type | Description |
---|---|---|
carrier_name | str | required |
carrier_id | str | required |
confirmation_number | str | required |
pickup_date | str | |
pickup_charge | ChargeDetails | |
ready_time | str | |
closing_time | str | |
id | str |
ChargeDetails
Name | Type | Description |
---|---|---|
name | str | |
amount | float | |
currency | str |
Message
Name | Type | Description |
---|---|---|
carrier_name | str | required |
carrier_id | str | required |
message | Union[str, Any] | |
code | str | |
details | dict |
Code sample
import karrio
from karrio.core.models import PickupRequest, Address
address = Address(
postal_code="V6M2V9",
city="Vancouver",
country_code="CA",
state_code="BC",
address_line1="5840 Oak St"
)
request = karrio.Pickup.schedule(
PickupRequest(
pickup_date="2015-01-28",
address=address,
instruction="Door at Back",
ready_time="15:00",
closing_time="17:00",
options={"loading_dock_flag": True},
)
)
pickup, messages = request.from_(carrier_gateway).parse()
On success
print(pickup)
# PickupDetails(
# carrier_name="canpar",
# carrier_id="canpar",
# confirmation_number="10000696",
# pickup_date="2015-01-28 15:00:00",
# pickup_charge=None,
# ready_time=None,
# closing_time=None,
# id=None,
# )
Update
import karrio
from karrio.core.models import PickupUpdateRequest
request = PickupUpdateRequest(...)
pickup, messages = karrio.Pickup.update(request).from_(carrier_gateway).parse()
Parameters
PickupUpdateRequest
Name | Type | Description |
---|---|---|
confirmation_number | str | required |
pickup_date | str | required |
ready_time | str | required |
closing_time | str | required |
address | Address | required |
parcels | List[Parcel] | |
instruction | str | |
package_location | str | |
options | dict |
Address
Name | Type | Description |
---|---|---|
id | str | |
postal_code | str | |
city | str | |
person_name | str | |
company_name | str | |
country_code | str | |
email | str | |
phone_number | str | |
state_code | str | |
residential | bool | |
address_line1 | str | |
address_line2 | str | |
federal_tax_id | str | |
state_tax_id | str | |
extra | AddressExtra |
AddressExtra
Name | Type | Description |
---|---|---|
street_name | str | |
street_number | str | |
street_type | str | |
suburb | str | |
suite | str |
Parcel
Name | Type | Description |
---|---|---|
id | str | |
weight | float | |
width | float | |
height | float | |
length | float | |
packaging_type | str | |
package_preset | str | |
description | str | |
content | str | |
is_document | bool | |
weight_unit | str | |
dimension_unit | str |
Response
PickupDetails
Name | Type | Description |
---|---|---|
carrier_name | str | required |
carrier_id | str | required |
confirmation_number | str | required |
pickup_date | str | |
pickup_charge | ChargeDetails | |
ready_time | str | |
closing_time | str | |
id | str |
ChargeDetails
Name | Type | Description |
---|---|---|
name | str | |
amount | float | |
currency | str |
Message
Name | Type | Description |
---|---|---|
carrier_name | str | required |
carrier_id | str | required |
message | Union[str, Any] | |
code | str | |
details | dict |
Code sample
import karrio
from karrio.core.models import PickupUpdateRequest, Address
address = Address(
postal_code="V6M2V9",
city="Vancouver",
country_code="CA",
state_code="BC",
address_line1="5840 Oak St"
)
request = karrio.Pickup.update(
PickupUpdateRequest(
confirmation_number="45L6KJ56LK5", # Previously scheduled pickup confirmation number
pickup_date="2015-01-28",
address=address,
instruction="Door at Back",
ready_time="15:00",
closing_time="17:00",
options={"loading_dock_flag": True},
)
)
pickup, messages = request.from_(gateway).parse()
On success
print(pickup)
# PickupDetails(
# carrier_name="canpar",
# carrier_id="canpar",
# confirmation_number="10000696",
# pickup_date="2015-01-28 15:00:00",
# pickup_charge=None,
# ready_time=None,
# closing_time=None,
# id=None,
# )
Cancel
import karrio
from karrio.core.models import PickupCancelRequest
request = PickupCancelRequest(...)
confirmation, messages = karrio.Pickup.cancel(request).from_(carrier_gateway).parse()
Parameters
PickupCancelRequest
Name | Type | Description |
---|---|---|
confirmation_number | str | required |
address | Address | |
pickup_date | str | |
reason | str |
Address
Name | Type | Description |
---|---|---|
id | str | |
postal_code | str | |
city | str | |
person_name | str | |
company_name | str | |
country_code | str | |
email | str | |
phone_number | str | |
state_code | str | |
residential | bool | |
address_line1 | str | |
address_line2 | str | |
federal_tax_id | str | |
state_tax_id | str | |
extra | AddressExtra |
AddressExtra
Name | Type | Description |
---|---|---|
street_name | str | |
street_number | str | |
street_type | str | |
suburb | str | |
suite | str |
Response
ConfirmationDetails
Name | Type | Description |
---|---|---|
carrier_name | str | required |
carrier_id | str | required |
success | bool | required |
operation | str | required |
Message
Name | Type | Description |
---|---|---|
carrier_name | str | required |
carrier_id | str | required |
message | Union[str, Any] | |
code | str | |
details | dict |
Code sample
import karrio
from karrio.core.models import PickupCancelRequest
request = karrio.Pickup.cancel(
PickupCancelRequest(
confirmation_number="45L6KJ56LK5", # Previously scheduled pickup confirmation number
)
)
confirmation, messages = request.from_(gateway).parse()
Tracking output
print(tracking_details_list)
# ConfirmationDetails(
# carrier_name="canpar",
# carrier_id="canpar",
# success=True,
# operation="Cancel Pickup",
# )