Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/postgrid-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -44,7 +44,7 @@ jobs:
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/postgrid-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/postgrid-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.3.0"
".": "2.4.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 137
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/postgrid/postgrid-a1e82d54f9c6456622ef353b6864dd9ccc47c9b5cf6b5fbe98c123f2bdf30f34.yml
openapi_spec_hash: cd682fda35a9733c4bcd508b8d8e6eab
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/postgrid/postgrid-46a2722b802f0f4b91cb69f8131ea7d6ed816cb20e0fa795889df4f6d5d49b13.yml
openapi_spec_hash: 0189e95f47ebb161ed59339e0640b82f
config_hash: f16e8e5b59ab878eee700d0f2dee5645
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2.4.0 (2026-07-17)

Full Changelog: [v2.3.0...v2.4.0](https://github.com/postgrid/postgrid-python/compare/v2.3.0...v2.4.0)

### Features

* Make Contact requirements for mailers clearer - can pass in ID or contact inline ([5015d23](https://github.com/postgrid/postgrid-python/commit/5015d230ab97935f90f21f9ab6489f0f08482d89))
* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([5e47f3c](https://github.com/postgrid/postgrid-python/commit/5e47f3c364222a47680c85496002f389f2325fad))

## 2.3.0 (2026-06-12)

Full Changelog: [v2.2.0...v2.3.0](https://github.com/postgrid/postgrid-python/compare/v2.2.0...v2.3.0)
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ client = PostGrid(

contact = client.print_mail.contacts.create(
address_line1="addressLine1",
country_code="countryCode",
first_name="firstName",
)
print(contact.id)
Expand Down Expand Up @@ -64,7 +63,6 @@ client = AsyncPostGrid(
async def main() -> None:
contact = await client.print_mail.contacts.create(
address_line1="addressLine1",
country_code="countryCode",
first_name="firstName",
)
print(contact.id)
Expand Down Expand Up @@ -104,7 +102,6 @@ async def main() -> None:
) as client:
contact = await client.print_mail.contacts.create(
address_line1="addressLine1",
country_code="countryCode",
first_name="firstName",
)
print(contact.id)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "postgrid-python"
version = "2.3.0"
version = "2.4.0"
description = "The official Python library for the PostGrid API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/postgrid/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "postgrid"
__version__ = "2.3.0" # x-release-please-version
__version__ = "2.4.0" # x-release-please-version
52 changes: 40 additions & 12 deletions src/postgrid/resources/print_mail/boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,27 @@ def create(
cheques: The cheques to be mailed in the box. Only 100 cheques can be included in a box
at a time.

from_: The 'from' (sender) of the entire box. Accepts inline ContactCreate or a
contactID.
from_:
A contact provided in one of two ways:

to: The recipient of this order. You can either supply the contact information
inline here or provide a contact ID. PostGrid will automatically deduplicate
contacts regardless of whether you provide the information inline here or call
the contact creation endpoint.
- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

to:
A contact provided in one of two ways:

- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

description: An optional string describing this resource. Will be visible in the API and the
dashboard.
Expand Down Expand Up @@ -422,13 +436,27 @@ async def create(
cheques: The cheques to be mailed in the box. Only 100 cheques can be included in a box
at a time.

from_: The 'from' (sender) of the entire box. Accepts inline ContactCreate or a
contactID.
from_:
A contact provided in one of two ways:

- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

to:
A contact provided in one of two ways:

- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

to: The recipient of this order. You can either supply the contact information
inline here or provide a contact ID. PostGrid will automatically deduplicate
contacts regardless of whether you provide the information inline here or call
the contact creation endpoint.
You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

description: An optional string describing this resource. Will be visible in the API and the
dashboard.
Expand Down
82 changes: 60 additions & 22 deletions src/postgrid/resources/print_mail/cheques.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,27 @@ def create(

bank_account: The bank account (ID) associated with the cheque.

from_: The contact information of the sender. You can pass contact information inline
here just like you can for the `to`.
from_:
A contact provided in one of two ways:

to: The recipient of this order. You can either supply the contact information
inline here or provide a contact ID. PostGrid will automatically deduplicate
contacts regardless of whether you provide the information inline here or call
the contact creation endpoint.
- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

to:
A contact provided in one of two ways:

- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

currency_code: The currency code of the cheque. This will be set to the default currency of the
bank account (`USD` for US bank accounts and `CAD` for Canadian bank accounts)
Expand Down Expand Up @@ -201,11 +215,16 @@ def create(
set to an incrementing number starting from 1 across your entire account,
ensuring that every cheque has a unique number.

redirect_to: Providing this inserts a blank page at the start of the cheque with the
recipient you provide here. This leaves the cheque that follows intact, which
means you can use this to intercept at cheque at the redirected address and then
mail it forward to the final recipient yourself. One use case for this is
signing cheques at your office before mailing them out yourself.
redirect_to:
A contact provided in one of two ways:

- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

return_envelope: The return envelope (ID) sent out with the cheque, if any. Note that you must
first order return envelopes using the Return Envelopes API.
Expand Down Expand Up @@ -654,13 +673,27 @@ async def create(

bank_account: The bank account (ID) associated with the cheque.

from_: The contact information of the sender. You can pass contact information inline
here just like you can for the `to`.
from_:
A contact provided in one of two ways:

to: The recipient of this order. You can either supply the contact information
inline here or provide a contact ID. PostGrid will automatically deduplicate
contacts regardless of whether you provide the information inline here or call
the contact creation endpoint.
- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

to:
A contact provided in one of two ways:

- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

currency_code: The currency code of the cheque. This will be set to the default currency of the
bank account (`USD` for US bank accounts and `CAD` for Canadian bank accounts)
Expand Down Expand Up @@ -709,11 +742,16 @@ async def create(
set to an incrementing number starting from 1 across your entire account,
ensuring that every cheque has a unique number.

redirect_to: Providing this inserts a blank page at the start of the cheque with the
recipient you provide here. This leaves the cheque that follows intact, which
means you can use this to intercept at cheque at the redirected address and then
mail it forward to the final recipient yourself. One use case for this is
signing cheques at your office before mailing them out yourself.
redirect_to:
A contact provided in one of two ways:

- an **inline contact body** with the same fields you would use to create a
contact (there is no need to create the contact first), or
- the **ID of an existing contact** (e.g. `contact_123`).

You never send the full stored contact object (with `id`, `object`,
`addressStatus`, `createdAt`, etc.) here — that shape is only ever returned in
responses.

return_envelope: The return envelope (ID) sent out with the cheque, if any. Note that you must
first order return envelopes using the Return Envelopes API.
Expand Down
Loading
Loading