Skip to main content

SendCloud Shipping Provider Integration for django-SHOP

This integrates the SendCloud API for django-SHOP version 1.0 and above.

Installation

for django-SHOP version 1.0 and later:

pip install djangoshop-sendcloud<1.1

Preparation

At SendCloud create an account.

In your personal account settings, click on Settings. There:

  • Add a Sender Address.
  • In Financial > Direct Debit add your recurring payment settings. There your bank account is charged with € 0.01, but this may take a few hours or even one day until everything is checked.
  • In Selected Shop select SendCloud API with a name of your choice. There, extract the Public Key and the Secret Key (see below).

Configuration

In settings.py of the merchant's project:

Add 'shop_sendcloud' to INSTALLED_APPS.

Add 'shop_sendcloud.modifiers.SendcloudShippingModifier' to the list of SHOP_CART_MODIFIERS.

Add 'shop_sendcloud.shipping.OrderWorkflowMixin' to the list of SHOP_ORDER_WORKFLOWS.

If you run django-SHOP with partial delivery, replace the OrderItemSerializer with the one provided: SHOP_ORDER_ITEM_SERIALIZER = 'shop_sendcloud.serializers.OrderItemSerializer' and change the workflow to:

SHOP_ORDER_WORKFLOWS = [
    ...
    'shop_sendcloud.workflows.CommonOrderWorkflowMixin',
    'shop.shipping.workflows.PartialDeliveryWorkflowMixin',
]

Otherwise, without partial delivery, change the workflow to:

SHOP_ORDER_WORKFLOWS = [
    ...
    'shop_sendcloud.workflows.SingularOrderWorkflowMixin',
    'shop.shipping.workflows.CommissionGoodsWorkflowMixin',
]

Add the Public Key and the Secret Key as provided by SendCloud (see above):

SHOP_SENDCLOUD = {
  'API_KEY': '<public-key-as-provided-by-SendCloud>',
  'API_SECRET': '<secret-key-as-provided-by-SendCloud>',
}

Since SendClouds sets the Shipping ID for us, we disable that field in the backend, using SHOP_MANUAL_SHIPPING_ID = False.

SendCloud requires a specific address model, therefore ensure that you "materialize" the one provided with djangoshop-sendcloud and not the defaults from shop/models/defaults/address.

Typically, it's enough to import the alternative classes for BillingAddress, ShippingAddress and Customer into models.py of your merchant implementation:

from shop_sendcloud.models.address import BillingAddress, ShippingAddress
from shop_sendcloud.models.customer import Customer

Initialization

Create two additional database tables as required by djangoshop-sendcloud:

python manange.py migrate djangoshop_sendcloud

Finally, load all possible shipping options into your shop:

python manange.py sendcloud_import

remember to run this job on a regular basis, say once a week, to update shipping prices.

Usage

When django-SHOP renders the form Shipping Method inside the checkout view, additional options will be available. For each carrier configured in the SendCloud backend, an extra radio button appears. Whatever the customer selects, will be stored inside django-SHOP's OrderModel.

In the Django Admin backend, only after fulfilling the order, a new button apprears named PRINT SHIPPING LABEL. Clicking on that button fetches a PDF document from the SendCloud API and forwards it to the Django Admin interface, from where it can be printed out.

Metadata

Release files for djangoshop-sendcloud 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djangoshop-sendcloud 1.2.1
File Size Uploaded Provenance Actions
djangoshop-sendcloud-1.2.1.tar.gz 11.5 kB Without provenance Details for djangoshop-sendcloud-1.2.1.tar.gz

Release files / djangoshop-sendcloud-1.2.1.tar.gz

Download URL djangoshop-sendcloud-1.2.1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6eed4711c8cd5f6ad2168969f8b9b1b910f469b8d1337f371ea7813a647c6198
BLAKE2b-256 checksum
How to use checksums
5007422aae61192cb6fd23e2e345eb1d5bfdbbfc9715783c4da3058725f52c82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Security for djangoshop-sendcloud 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page