Skip to main content

Python library for Shipday API

Project description

Shipday Python SDK

The Shipday Python sdk provides easier access to Shipday API's Python applications and scripts.


See the shipday api docs for Python.


Python 3.6 or higher


pip install shipday


Import Shipday from shipday package.

from shipday import Shipday

You need to provide the shipday api-key in order to use the library. Example usages looks like following:-

API_KEY = '##########.#######################'
my_shipday = Shipday(api_key=API_KEY)

This my_shipday object contains two services (CarrierService and OrderService) which you can use to get your job done. Here are few examples,

Carrier Service

To get all your carriers, use get_carriers() function of the CarrierService. Following example prints the number of carriers you have -

my_carriers = my_shipday.CarrierService.get_carriers()
print('I have {} carriers'.format(len(my_carriers)))

To add a carrier, you need to create a CarrierRequest and send it using add_carrier() function of CarrierService. See the example below -

from shipday.carrier import CarrierRequest

carrier_req = CarrierRequest(name='Library carrier',

To delete a carrier, use delete_carrier() function of the CarrierService. For example-


Order Service

To get all the orders, use get_orders() function of the OrderService.

my_orders = my_shipday.OrderService.get_orders()

To add an order, you need to create an Order object and send it using insert_order() function of OrderService. For example -

from shipday.order import Address, Customer, Pickup, OrderItem, Order

new_order = Order(orderNumber='100')

# Add customer details
new_order.customer = Customer(
    name='Shahriar', email='shahriar@shahriar.shipday', phone_number='+88012367124',
    address=Address(street='556 Crestlake Dr', city='San Francisco', state='California', country='USA')
# Don't worry if you forget to send a parameter, you can also set it later like following line = 'CA 94132'

# Add pickup details
new_order.pickup = Pickup(
    name='My pickup point', phone_number='+8832462374'
new_order.pickup.address = Address(street='890 Geneva Av', city='San Fransisco', state='California', zip='CA 94132',

# Add order items
new_order.order_items = [OrderItem(name='Pizza', unit_price=10.0, quantity=1)]
    OrderItem(name='Popcorn Shrimp', quantity=1, unit_price=5)


To get retrive orders by order number, use get_order function. This will return a list of orders matching the given order_number.

orders = my_shipday.OrderService.get_order(order_number='#1')

To assign an order to a carrier, use assign_order() function. For example,

my_shipday.OrderService.assign_order(order_id=7995257, carrier_id=242324)

To delete an order, use delete_order() function. For example,


You can also query orders using query() function. For that you need to create a OrderQuery object. Following code retrieves all orders from last 24 hours -

from shipday.order import OrderQuery

query = OrderQuery()

from datetime import datetime, timedelta

query.start_time = - timedelta(days=1)


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shipday-1.0.0.tar.gz (10.7 kB view hashes)

Uploaded source

Built Distribution

shipday-1.0.0-py3-none-any.whl (15.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page