Skip to main content

Pickup

Schedule

import karrio
from karrio.core.models import PickupRequest

request = PickupRequest(...)

pickup, messages = karrio.Pickup.schedule(request).from_(carrier_gateway).parse()

Parameters

PickupRequest

NameTypeDescription
pickup_datestrrequired
ready_timestrrequired
closing_timestrrequired
addressAddressrequired
parcelsList[Parcel]
instructionstr
package_locationstr
optionsdict

Address

NameTypeDescription
idstr
postal_codestr
citystr
person_namestr
company_namestr
country_codestr
emailstr
phone_numberstr
state_codestr
residentialbool
address_line1str
address_line2str
federal_tax_idstr
state_tax_idstr
extraAddressExtra

AddressExtra

NameTypeDescription
street_namestr
street_numberstr
street_typestr
suburbstr
suitestr

Parcel

NameTypeDescription
idstr
weightfloat
widthfloat
heightfloat
lengthfloat
packaging_typestr
package_presetstr
descriptionstr
contentstr
is_documentbool
weight_unitstr
dimension_unitstr

Response

PickupDetails

NameTypeDescription
carrier_namestrrequired
carrier_idstrrequired
confirmation_numberstrrequired
pickup_datestr
pickup_chargeChargeDetails
ready_timestr
closing_timestr
idstr

ChargeDetails

NameTypeDescription
namestr
amountfloat
currencystr

Message

NameTypeDescription
carrier_namestrrequired
carrier_idstrrequired
messageUnion[str, Any]
codestr
detailsdict

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

NameTypeDescription
confirmation_numberstrrequired
pickup_datestrrequired
ready_timestrrequired
closing_timestrrequired
addressAddressrequired
parcelsList[Parcel]
instructionstr
package_locationstr
optionsdict

Address

NameTypeDescription
idstr
postal_codestr
citystr
person_namestr
company_namestr
country_codestr
emailstr
phone_numberstr
state_codestr
residentialbool
address_line1str
address_line2str
federal_tax_idstr
state_tax_idstr
extraAddressExtra

AddressExtra

NameTypeDescription
street_namestr
street_numberstr
street_typestr
suburbstr
suitestr

Parcel

NameTypeDescription
idstr
weightfloat
widthfloat
heightfloat
lengthfloat
packaging_typestr
package_presetstr
descriptionstr
contentstr
is_documentbool
weight_unitstr
dimension_unitstr

Response

PickupDetails

NameTypeDescription
carrier_namestrrequired
carrier_idstrrequired
confirmation_numberstrrequired
pickup_datestr
pickup_chargeChargeDetails
ready_timestr
closing_timestr
idstr

ChargeDetails

NameTypeDescription
namestr
amountfloat
currencystr

Message

NameTypeDescription
carrier_namestrrequired
carrier_idstrrequired
messageUnion[str, Any]
codestr
detailsdict

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

NameTypeDescription
confirmation_numberstrrequired
addressAddress
pickup_datestr
reasonstr

Address

NameTypeDescription
idstr
postal_codestr
citystr
person_namestr
company_namestr
country_codestr
emailstr
phone_numberstr
state_codestr
residentialbool
address_line1str
address_line2str
federal_tax_idstr
state_tax_idstr
extraAddressExtra

AddressExtra

NameTypeDescription
street_namestr
street_numberstr
street_typestr
suburbstr
suitestr

Response

ConfirmationDetails

NameTypeDescription
carrier_namestrrequired
carrier_idstrrequired
successboolrequired
operationstrrequired

Message

NameTypeDescription
carrier_namestrrequired
carrier_idstrrequired
messageUnion[str, Any]
codestr
detailsdict

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",
# )