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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.249.0"
".": "0.250.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 199
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-0ecd4933d3a1f2e6363dc40b619d296a033732ec245018effd3e5f687f60bb04.yml
openapi_spec_hash: 41f0a23615d13ed80758208130da6abd
config_hash: 0c284b69f3dccb22b24877f61d0d8a9a
configured_endpoints: 201
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-101cab80ae65141fb306c316367abab195616ae8f2ce61d87e0d66e3caa4ef2f.yml
openapi_spec_hash: 9338ab9453d1a0f426e9998e574bff67
config_hash: 97774f946585cecb19181a1817870d0b
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.250.0 (2025-06-11)

Full Changelog: [v0.249.0...v0.250.0](https://github.com/Increase/increase-python/compare/v0.249.0...v0.250.0)

### Features

* **api:** api update ([8783771](https://github.com/Increase/increase-python/commit/8783771d6f3528c2e1af0931b19752af8f603838))

## 0.249.0 (2025-06-08)

Full Changelog: [v0.248.0...v0.249.0](https://github.com/Increase/increase-python/compare/v0.248.0...v0.249.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ from increase.types import PendingTransaction

Methods:

- <code title="post /pending_transactions">client.pending_transactions.<a href="./src/increase/resources/pending_transactions.py">create</a>(\*\*<a href="src/increase/types/pending_transaction_create_params.py">params</a>) -> <a href="./src/increase/types/pending_transaction.py">PendingTransaction</a></code>
- <code title="get /pending_transactions/{pending_transaction_id}">client.pending_transactions.<a href="./src/increase/resources/pending_transactions.py">retrieve</a>(pending_transaction_id) -> <a href="./src/increase/types/pending_transaction.py">PendingTransaction</a></code>
- <code title="get /pending_transactions">client.pending_transactions.<a href="./src/increase/resources/pending_transactions.py">list</a>(\*\*<a href="src/increase/types/pending_transaction_list_params.py">params</a>) -> <a href="./src/increase/types/pending_transaction.py">SyncPage[PendingTransaction]</a></code>
- <code title="post /pending_transactions/{pending_transaction_id}/release">client.pending_transactions.<a href="./src/increase/resources/pending_transactions.py">release</a>(pending_transaction_id) -> <a href="./src/increase/types/pending_transaction.py">PendingTransaction</a></code>

# DeclinedTransactions

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 = "increase"
version = "0.249.0"
version = "0.250.0"
description = "The official Python library for the increase API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/increase/_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__ = "increase"
__version__ = "0.249.0" # x-release-please-version
__version__ = "0.250.0" # x-release-please-version
244 changes: 242 additions & 2 deletions src/increase/resources/pending_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import httpx

from ..types import pending_transaction_list_params
from ..types import pending_transaction_list_params, pending_transaction_create_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import maybe_transform
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
Expand Down Expand Up @@ -42,6 +42,66 @@ def with_streaming_response(self) -> PendingTransactionsResourceWithStreamingRes
"""
return PendingTransactionsResourceWithStreamingResponse(self)

def create(
self,
*,
account_id: str,
amount: int,
description: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> PendingTransaction:
"""Creates a pending transaction on an account.

This can be useful to hold funds
for an external payment or known future transaction outside of Increase. The
resulting Pending Transaction will have a `category` of `user_initiated_hold`
and can be released via the API to unlock the held funds.

Args:
account_id: The Account to place the hold on.

amount: The amount to hold in the minor unit of the account's currency. For dollars, for
example, this is cents. This should be a negative amount - to hold $1.00 from
the account, you would pass -100.

description: The description you choose to give the hold.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
return self._post(
"/pending_transactions",
body=maybe_transform(
{
"account_id": account_id,
"amount": amount,
"description": description,
},
pending_transaction_create_params.PendingTransactionCreateParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=PendingTransaction,
)

def retrieve(
self,
pending_transaction_id: str,
Expand Down Expand Up @@ -141,6 +201,54 @@ def list(
model=PendingTransaction,
)

def release(
self,
pending_transaction_id: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> PendingTransaction:
"""Release a Pending Transaction you had previously created.

The Pending
Transaction must have a `category` of `user_initiated_hold` and a `status` of
`pending`. This will unlock the held funds and mark the Pending Transaction as
complete.

Args:
pending_transaction_id: The identifier of the Pending Transaction to release.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not pending_transaction_id:
raise ValueError(
f"Expected a non-empty value for `pending_transaction_id` but received {pending_transaction_id!r}"
)
return self._post(
f"/pending_transactions/{pending_transaction_id}/release",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=PendingTransaction,
)


class AsyncPendingTransactionsResource(AsyncAPIResource):
@cached_property
Expand All @@ -162,6 +270,66 @@ def with_streaming_response(self) -> AsyncPendingTransactionsResourceWithStreami
"""
return AsyncPendingTransactionsResourceWithStreamingResponse(self)

async def create(
self,
*,
account_id: str,
amount: int,
description: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> PendingTransaction:
"""Creates a pending transaction on an account.

This can be useful to hold funds
for an external payment or known future transaction outside of Increase. The
resulting Pending Transaction will have a `category` of `user_initiated_hold`
and can be released via the API to unlock the held funds.

Args:
account_id: The Account to place the hold on.

amount: The amount to hold in the minor unit of the account's currency. For dollars, for
example, this is cents. This should be a negative amount - to hold $1.00 from
the account, you would pass -100.

description: The description you choose to give the hold.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
return await self._post(
"/pending_transactions",
body=await async_maybe_transform(
{
"account_id": account_id,
"amount": amount,
"description": description,
},
pending_transaction_create_params.PendingTransactionCreateParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=PendingTransaction,
)

async def retrieve(
self,
pending_transaction_id: str,
Expand Down Expand Up @@ -261,50 +429,122 @@ def list(
model=PendingTransaction,
)

async def release(
self,
pending_transaction_id: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> PendingTransaction:
"""Release a Pending Transaction you had previously created.

The Pending
Transaction must have a `category` of `user_initiated_hold` and a `status` of
`pending`. This will unlock the held funds and mark the Pending Transaction as
complete.

Args:
pending_transaction_id: The identifier of the Pending Transaction to release.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not pending_transaction_id:
raise ValueError(
f"Expected a non-empty value for `pending_transaction_id` but received {pending_transaction_id!r}"
)
return await self._post(
f"/pending_transactions/{pending_transaction_id}/release",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=PendingTransaction,
)


class PendingTransactionsResourceWithRawResponse:
def __init__(self, pending_transactions: PendingTransactionsResource) -> None:
self._pending_transactions = pending_transactions

self.create = to_raw_response_wrapper(
pending_transactions.create,
)
self.retrieve = to_raw_response_wrapper(
pending_transactions.retrieve,
)
self.list = to_raw_response_wrapper(
pending_transactions.list,
)
self.release = to_raw_response_wrapper(
pending_transactions.release,
)


class AsyncPendingTransactionsResourceWithRawResponse:
def __init__(self, pending_transactions: AsyncPendingTransactionsResource) -> None:
self._pending_transactions = pending_transactions

self.create = async_to_raw_response_wrapper(
pending_transactions.create,
)
self.retrieve = async_to_raw_response_wrapper(
pending_transactions.retrieve,
)
self.list = async_to_raw_response_wrapper(
pending_transactions.list,
)
self.release = async_to_raw_response_wrapper(
pending_transactions.release,
)


class PendingTransactionsResourceWithStreamingResponse:
def __init__(self, pending_transactions: PendingTransactionsResource) -> None:
self._pending_transactions = pending_transactions

self.create = to_streamed_response_wrapper(
pending_transactions.create,
)
self.retrieve = to_streamed_response_wrapper(
pending_transactions.retrieve,
)
self.list = to_streamed_response_wrapper(
pending_transactions.list,
)
self.release = to_streamed_response_wrapper(
pending_transactions.release,
)


class AsyncPendingTransactionsResourceWithStreamingResponse:
def __init__(self, pending_transactions: AsyncPendingTransactionsResource) -> None:
self._pending_transactions = pending_transactions

self.create = async_to_streamed_response_wrapper(
pending_transactions.create,
)
self.retrieve = async_to_streamed_response_wrapper(
pending_transactions.retrieve,
)
self.list = async_to_streamed_response_wrapper(
pending_transactions.list,
)
self.release = async_to_streamed_response_wrapper(
pending_transactions.release,
)
1 change: 1 addition & 0 deletions src/increase/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
from .digital_card_profile_clone_params import DigitalCardProfileCloneParams as DigitalCardProfileCloneParams
from .inbound_check_deposit_list_params import InboundCheckDepositListParams as InboundCheckDepositListParams
from .inbound_wire_transfer_list_params import InboundWireTransferListParams as InboundWireTransferListParams
from .pending_transaction_create_params import PendingTransactionCreateParams as PendingTransactionCreateParams
from .physical_card_profile_list_params import PhysicalCardProfileListParams as PhysicalCardProfileListParams
from .supplemental_document_list_params import SupplementalDocumentListParams as SupplementalDocumentListParams
from .wire_drawdown_request_list_params import WireDrawdownRequestListParams as WireDrawdownRequestListParams
Expand Down
Loading