canonical: https://jentic.com/apis/canadapost-postescanada.ca/canadapost

# Canadapost Postescanada Ca Canada Post Rating API

Jentic publishes the only available OpenAPI specification for Canada Post Rating API, keeping it validated and agent-ready. The Canada Post Rating Web Service returns shipping rates, available services, prices, and transit times for parcels moving within Canada and internationally. The single POST `/rs/ship/price` endpoint accepts an XML request describing origin and destination postal codes, parcel dimensions, weight, and optional service or contract identifiers, then returns priced service options for use in checkout and shipping-label workflows.

## For AI agents

Retrieve Canada Post shipping rates, services, prices, and transit times for a parcel via a single XML-based pricing endpoint.

## Scope

Does not handle label printing, manifest creation, or parcel tracking - use for retrieving Canada Post rate quotes and service options only.

## Capabilities

- Quote Canada Post shipping rates for a parcel between two postal codes via `/rs/ship/price`
- Compare service tiers such as Regular Parcel, Expedited Parcel, Xpresspost, and Priority for a single shipment
- Return transit-time estimates alongside priced service options for delivery-date promises
- Apply contract or commercial customer rates by passing a mailed-by or contract identifier in the request
- Compute international rates by varying the destination country and postal code in the rating request

## Use cases

### Checkout Shipping Cost Calculator

E-commerce sites selling into Canada need to display real-time shipping costs at checkout. POST `/rs/ship/price` with the origin postal code, customer destination, and parcel weight returns priced service options that the cart can render as selectable shipping methods, including transit-time estimates customers see before paying.

Example prompt: POST `/rs/ship/price` with origin K1A 0B1 and destination V6B 4N7 for a 1.5 kg parcel and present the customer with Regular, Expedited, and Xpresspost options.

### Multi-Carrier Rate Comparison

Shipping platforms route parcels to the cheapest or fastest carrier per shipment. Calling Canada Post's `/rs/ship/price` alongside FedEx, UPS, and other carrier rate endpoints lets a routing engine pick the best option per parcel and per service-level promise.

Example prompt: POST `/rs/ship/price` for the parcel, call equivalent FedEx and UPS rate endpoints, then select the carrier with the lowest priced service that meets the promised delivery date.

### Commercial Contract Rate Quoting

High-volume shippers with Canada Post commercial contracts need contract-specific pricing rather than retail rates. The rating endpoint accepts mailed-by or contract identifiers in the request body to return rates negotiated under a commercial agreement.

Example prompt: POST `/rs/ship/price` with the contract's mailed-by identifier set, retrieve contract-specific pricing, and surface it on internal shipping dashboards.

### AI Agent Shipping Workflows via Jentic

Through Jentic, an agent searches for 'get a Canada Post shipping rate', loads the input schema for `/rs/ship/price`, and executes the call without managing the Basic Auth credential. Jentic's vault holds the userid:password pair so it never enters the agent's prompt context.

Example prompt: Use the Jentic SDK to search 'get a Canada Post shipping rate', load the `/rs/ship/price` operation schema, and execute it with origin postal code, destination postal code, and parcel weight.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/rs/ship/price` | Get Canada Post shipping rates for a parcel |

## Key resources

- **Rating** — Submit a parcel description and receive priced service options with transit times

## Why Jentic

- **Setup:** Wiring the Canada Post Rating API by hand means encoding your userid and password into HTTP Basic auth and building the XML rate request for the price route yourself. Through Jentic you install once, import Canada Post from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** This API exposes a single rate-quote operation that takes the shipment details in the request body, so the agent is scoped to that one operation. You choose the operations it may call, so it stays limited to retrieving rate quotes and nothing else.
- **Credential handling:** Your Canada Post userid and password are stored once, encrypted, by your own Jentic One instance and combined into the Basic Authorization header at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get a Canada Post shipping rate', and Jentic returns the POST `/rs/ship/price` operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Shippo API** — Shippo aggregates many carriers including Canada Post into a single multi-carrier API, where the Canada Post Rating API is direct and carrier-specific.
- **FedEx Web Services** — FedEx provides international shipping rates and services that complement Canada Post's domestic Canadian strengths.
- **DHL Shipment Tracking Unified API** — DHL tracking complements Canada Post pricing when an order ships via Canada Post but transits through DHL international handover.

## FAQ

### Why is there no official OpenAPI spec for Canada Post Rating API?

Canada Post does not publish an OpenAPI specification - its developer portal documents the service in HTML and XSD form only. Jentic generates and maintains this spec so that AI agents and developers can call Canada Post Rating API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Canada Post Rating API use?

It uses HTTP Basic authentication with the userid:password pair issued by Canada Post in the developer portal. Through Jentic, the credential is stored in your Jentic One instance and injected into the Authorization header at execution time, so the raw secret never enters the agent's prompt context.

### Does the API accept JSON requests?

No. The `/rs/ship/price` endpoint exchanges Canada Post's XML rating-service schema. Send the XML request body with the appropriate content type and parse the XML response. Jentic surfaces the operation's request shape so the agent can populate it correctly.

### How do I quote a shipping rate through Jentic?

Run pip install jentic, then search 'get a Canada Post shipping rate' through the Jentic SDK. Jentic returns POST `/rs/ship/price` with its input schema. Provide origin postal code, destination postal code, and parcel weight, then execute the operation.

### Are there separate test and production environments?

Yes. The OpenAPI spec lists two servers: production at https://soa-gw.canadapost.ca and development at https://ct.soa-gw.canadapost.ca. Use the development environment with test credentials before switching to production.

### Can I retrieve transit times alongside prices?

Yes. The rating response includes a service-standard block per priced service that lists the expected transit days and the guaranteed delivery flag, which lets a shipping calculator render a delivery-date promise next to each option.

### Can I limit what my agent is allowed to do with the Canada Post Rating API?

Yes. Because Jentic One is self-hosted, you decide which operations your agent may call, and this API exposes only a single rate-quote operation, POST `/rs/ship/price`, so the agent is scoped to retrieving shipping rates and service options and nothing else. Your Canada Post userid and password are stored once in your own instance and injected into the Basic Authorization header at execution time, so the agent never sees the raw credential. The rules you set decide the operations and credentials the agent can use, keeping it limited to pricing parcels between two postal codes.
