Skip to content

Search Allocations

transactions.search_allocations(TransactionSearchAllocationsParams**kwargs) -> TransactionSearchAllocationsResponse
POST/transactions/allocations/search

Searches transaction allocations.

ParametersExpand Collapse
filter: Filter

Filter for searching transaction allocations.

invoice_id: FilterInvoiceID

Invoice ID filter.

any: SequenceNotStr[str]

Match allocations where invoice_id is any of these values, using OR logic.

ReturnsExpand Collapse
class TransactionSearchAllocationsResponse:
data: List[Data]

List of allocation search results.

id: str

FRAGMENT generated unique ID.

amount: str

Allocated amount, as a non-negative string in the smallest currency unit, such as cents for USD.

invoice_id: str

Invoice the allocation is applied against.

posted: datetime

Timestamp when the parent transaction was posted. Uses ISO 8601 format.

formatdate-time
transaction: DataTransaction

Transaction the allocation is applied to.

id: str

FRAGMENT generated unique ID.

external_id: str

User-provided unique ID.

type: Literal["invoice_payin", "invoice_payout"]

Type of allocation.

Accepts one of the following:
"invoice_payin"
"invoice_payout"
user: DataUser

User associated with the allocation.

id: str

FRAGMENT generated unique ID.

external_id: str

User-provided unique ID.

Search Allocations

from fragment import Fragment

client = Fragment()
response = client.transactions.search_allocations(
    filter={
        "invoice_id": {
            "any": ["inv_abc123"]
        }
    },
)
print(response.data)
{
  "data": [
    {
      "id": "alloc_abc123",
      "amount": "1000",
      "invoice_id": "inv_abc123",
      "posted": "2024-01-13T00:00:00Z",
      "transaction": {
        "id": "txn_dHhuX2ZyYWdfMDAx",
        "external_id": "bank_txn_123"
      },
      "type": "invoice_payin",
      "user": {
        "id": "user_abc123",
        "external_id": "user_ext_001"
      }
    }
  ]
}
Returns Examples
{
  "data": [
    {
      "id": "alloc_abc123",
      "amount": "1000",
      "invoice_id": "inv_abc123",
      "posted": "2024-01-13T00:00:00Z",
      "transaction": {
        "id": "txn_dHhuX2ZyYWdfMDAx",
        "external_id": "bank_txn_123"
      },
      "type": "invoice_payin",
      "user": {
        "id": "user_abc123",
        "external_id": "user_ext_001"
      }
    }
  ]
}