Skip to content
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ All API methods return a response dictionary with either `data` or `error`:
instance_id="your_instance_id_here"
)

response = await blindpay.receivers.get("receiver-id")
response = await blindpay.customers.get("customer-id")

if response['error']:
print(f"Error: {response['error']['message']}")
return

receiver = response['data']
print(f"Receiver: {receiver}")
customer = response['data']
print(f"Customer: {customer}")
```

## Types
Expand Down
7 changes: 5 additions & 2 deletions src/blindpay/resources/customers/customers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List, Optional, Union
from urllib.parse import urlencode

from typing_extensions import Literal, TypedDict
from typing_extensions import Literal, NotRequired, TypedDict

from ..._internal.api_client import InternalApiClient, InternalApiClientSync
from ...types import (
Expand Down Expand Up @@ -302,7 +302,10 @@ class TransactionLimit(TypedDict):
class Owner(TypedDict):
id: str
instance_id: str
customer_id: str
# Not yet added by the response middleware for nested owners; both keys are
# optional until the API sends customer_id here directly (post-#1799).
receiver_id: NotRequired[str]
customer_id: NotRequired[str]
role: OwnerRole
first_name: str
last_name: str
Expand Down
1 change: 1 addition & 0 deletions src/blindpay/resources/payins/payins.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Payin(TypedDict):
class ListPayinsInput(PaginationParams):
status: Optional[TransactionStatus]
receiver_id: Optional[str]
customer_id: Optional[str]


class ListPayinsResponse(TypedDict):
Expand Down
1 change: 1 addition & 0 deletions src/blindpay/resources/payouts/payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Payout(TypedDict):

class ListPayoutsInput(PaginationParams, total=False):
receiver_id: str
customer_id: str


class ListPayoutsResponse(TypedDict):
Expand Down
10 changes: 10 additions & 0 deletions src/blindpay/resources/webhooks/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@
from ...types import BlindpayApiResponse

WebhookEvents = Literal[
# deprecated: use "customer.new" instead. See
# https://www.blindpay.com/changelog/2026-06-04-customers-rename
"receiver.new",
# deprecated: use "customer.update" instead. See
# https://www.blindpay.com/changelog/2026-06-04-customers-rename
"receiver.update",
# deprecated: use "customer.delete" instead. See
# https://www.blindpay.com/changelog/2026-06-04-customers-rename
"receiver.delete",
"customer.new",
"customer.update",
"customer.delete",
"bankAccount.new",
"payout.new",
"payout.update",
Expand Down
4 changes: 3 additions & 1 deletion src/blindpay/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,5 +408,7 @@ class TrackingPartnerFee(TypedDict):

ManualExecutionStatus = Literal["failed"]


# Deprecated: use WebhookEvents from blindpay.resources.webhooks, which lists every
# event. Kept exported so this stays an additive release; scheduled for removal in the
# next major.
WebhookEvent = Literal["receiver.delete"]
4 changes: 4 additions & 0 deletions tests/resources/test_blockchain_wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ async def test_list_blockchain_wallets(self):

assert response["error"] is None
assert response["data"] == mocked_wallets
assert response["data"] is not None
assert response["data"][0]["customer_id"] == "re_000000000000"
mock_request.assert_called_once_with(
"GET", "/instances/in_000000000000/customers/re_000000000000/blockchain-wallets"
)
Expand Down Expand Up @@ -326,6 +328,8 @@ def test_list_blockchain_wallets(self):

assert response["error"] is None
assert response["data"] == mocked_wallets
assert response["data"] is not None
assert response["data"][0]["customer_id"] == "re_000000000000"
mock_request.assert_called_once_with(
"GET", "/instances/in_000000000000/customers/re_000000000000/blockchain-wallets"
)
Expand Down
2 changes: 2 additions & 0 deletions tests/resources/test_offramp_wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ async def test_list_offramp_wallets(self):

assert response["error"] is None
assert response["data"] == mocked_offramp_wallets
assert response["data"] is not None
assert response["data"][0]["customer_id"] == "re_000000000000"
mock_request.assert_called_once_with(
"GET",
"/instances/in_000000000000/customers/re_000000000000/bank-accounts/ba_000000000000/offramp-wallets",
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading