Shipping & logistics
Lob mock API
Lob print and mail API: addresses, letters, postcards, templates, US address verification and signed webhooks.
At a glance
- Operations
- 105
- Stateful operations
- 18
- Stateful resources
- 5
- Webhook events
- 6
- Vendor API version
- 2024-01-01
- Verification
- Spec-verified
How it works
Use Lob without calling Lob.com, Inc.
- Install the mock from the library into a workspace. It runs as a virtual service.
- Point your client's base URL at the virtual service instead of the vendor.
- Authenticate the way you already do. The mock accepts the same credential shape:
Authorization: Basic dGVzdF9Nb2NrS2V5MDEyMzQ1Njc4OWFiY2RlZjo= State
Resources that remember
Writes persist per caller, so a create followed by a read returns what you created.
| Resource | Operations |
|---|---|
| Addresses | 4 |
| Letters | 4 |
| Postcards | 4 |
| Templates | 5 |
| US verifications | 2 |
Webhooks
Events your handlers can receive
- letter.created
- letter.rendered_pdf
- letter.mailed
- letter.delivered
- postcard.created
- postcard.mailed
Deliveries are signed with the hmac scheme, so your verification code runs unchanged.
Coverage
105 operations
18 of them are stateful. The largest groups:
| Group | Operations |
|---|---|
| Other operations | 86 |
| Templates | 5 |
| Addresses | 4 |
| Letters | 4 |
| Postcards | 4 |
| US verifications | 2 |
Verification
Spec-verified
Generated operations are checked against the vendor OpenAPI description, which proves shape and routing. Stateful operations and scenario suites prove behaviour. Responses are not yet compared with a live vendor sandbox.
1 operations cannot be checked against the specification.
Source and limits
License, source and limits
- Generated from the Lob.com, Inc. API description, licensed under MIT.
- Lob.com, Inc. API documentation
- Source specification
Each collection (addresses, letters, postcards, templates) holds up to 1 MiB of objects per API key; writes beyond that are dropped (x-maxoperf-vs-state: capacity), and request bodies over 1 MiB are rejected with 413 (a file is stored by reference, never fetched). Mail pieces accept an address id or an inline address; lists use cursor pagination (limit up to 100, after/before ids). The Idempotency-Key header replays the stored piece, and the same key with a different description/file length answers 409 (the idempotency_key query form is not honoured). A letter or postcard can be cancelled for 5 minutes after creation (derived from the creation time when the cancel is requested, no read needed); seeded letter ltr_2000000000000001 and postcard psc_3000000000000001 are past it, the ...02 seeds are still cancellable. Signed asset URLs are stand-ins matching the spec pattern. US verification answers the documented test values (deliverable, missing unit, incorrect unit, unnecessary unit, undeliverable block match) and every other primary_line as deliverable; zip lookup returns a fixed sample. Checks, bank accounts, self mailers, booklets, campaigns, uploads and every other operation are schema-valid stateless samples. Webhooks are delivered to the Virtual Service webhook setting with Lob-Signature (HMAC-SHA256 hex over '<timestamp>.<body>', timestamp in seconds) and Lob-Signature-Timestamp.
MaxoPerf is not affiliated with, endorsed by, or sponsored by Lob.com, Inc. Lob is a trademark of its owner.