@openpets/royal-mail
v1.0.0
Published
Access Royal Mail developer APIs for tracking events and summaries, proof of delivery signatures, Local Collect locations, Delivery Office Finder, and API Shipping V2 operations.
Maintainers
Readme
Royal Mail
OpenPets plugin for Royal Mail developer APIs.
This pet is marked incomplete because Royal Mail publishes API product pages and technical PDF guides, but no public downloadable OpenAPI specification was available when this pet was created. Royal Mail's Local Collect V3 guide says the Swagger definition can be obtained via the developer portal or Royal Mail Team Customer Solutions.
Setup
Create a Royal Mail Developer Portal account, register an application, and subscribe it to the APIs you plan to use. Some APIs require approval from a Royal Mail account manager or Team Customer Solutions before credentials can call live endpoints.
cp .env.example .envRequired:
ROYAL_MAIL_CLIENT_ID=your-client-idOptional:
ROYAL_MAIL_CLIENT_SECRET=your-client-secret
ROYAL_MAIL_ACCEPT_TERMS=yes
ROYAL_MAIL_READ_ONLY=trueEndpoint overrides are available if Royal Mail assigns a different base URL for your plan:
ROYAL_MAIL_TRACKING_BASE_URL=https://api.royalmail.net/mailpieces/v2
ROYAL_MAIL_LOCAL_COLLECT_BASE_URL=https://api.royalmail.net/localcollect/v3
ROYAL_MAIL_DELIVERY_OFFICE_BASE_URL=https://api.royalmail.net/deliveryofficefinder/v1
ROYAL_MAIL_SHIPPING_BASE_URL=https://api.royalmail.net/shipping/v2Tools
royal-mail-test-connectionroyal-mail-get-tracking-eventsroyal-mail-get-tracking-summaryroyal-mail-get-tracking-signatureroyal-mail-find-local-collect-locationsroyal-mail-get-local-collect-referenceroyal-mail-find-delivery-officeroyal-mail-get-shipping-tokenroyal-mail-create-domestic-shipmentroyal-mail-create-shipmentroyal-mail-update-shipmentroyal-mail-delete-shipmentroyal-mail-create-shipment-documentsroyal-mail-create-shipment-labelroyal-mail-create-manifestroyal-mail-update-manifest
Shipment, label, document, and manifest tools are hidden when read-only mode is enabled.
Examples
opencode run "test royal-mail connection"
opencode run "get Royal Mail tracking summary for AB123456789GB"
opencode run "find Royal Mail Local Collect locations near SW1A 1AA"For write operations, pass the Royal Mail request payload as a JSON string:
opencode run 'create a Royal Mail shipment with bodyJson {"...":"..."}'Source Notes
- API library and product discovery: https://developer.royalmail.net/api
- Getting started and credential workflow: https://developer.royalmail.net/start
- Local Collect V3 REST technical guide: https://developer.royalmail.net/system/files/2025-07/Royal%20Mail%20Local%20Collect%20V3%20%28REST%29%203.0.7_Final.pdf
Future work should replace the manual endpoint definitions with generated OpenAPI tools if Royal Mail provides the official Swagger/OpenAPI files for the subscribed plan.
