Skip to content

v1.1.0

Choose a tag to compare

@barnett barnett released this 26 May 00:31
· 1 commit to master since this release
4395db4

With this update, we're expanding Python SDK coverage for newly documented Trolley API functionality. This release offers additive functionality without impacting existing integrations.

New Methods/API Coverage

1. Balance helpers

Added helpers for documented balance endpoints.

client.balances.all()
client.balances.paymentrails()
client.balances.paypal()

2. Top-level payment lookup

Retrieve a payment directly by payment ID.

payment = client.payment.find_by_id("P-123456789")

3. Trust / verification endpoints

Added support for Trust verification operations.

client.verification.search(verificationType="watchlist", page=1, pageSize=10)
client.verification.expire({"type": "individual", "verificationIds": ["IV-123"]})
client.verification.trigger("watchlist", {"recipientIds": ["R-123"]})

4. Invoice payment batch support

invoice_payment.create now accepts an optional batch_id and additional request options while preserving the existing list input.

invoice_payment = client.invoice_payment.create(
    ["I-123", "I-456"],
    batch_id="B-123456789",
    memo="Invoice payout"
)

5. Batch action helpers

Added helpers for documented batch quote, processing, and summary endpoints.

batch = client.batch.generate_quote("B-123456789")
batch = client.batch.process_batch("B-123456789")
summary = client.batch.summary("B-123456789")

client.batch.start_processing is also available as an alias for client.batch.process_batch.

5. Response Field Coverage

Added documented response fields across SDK models, including:

  • Batch: payments
  • InvoicePayment: status, memo, externalId, tags, coverFees
  • Payment: sourceCurrencyName, targetCurrencyName, visibleToRecipient
  • Recipient: tags, compliance, address
  • OfflinePayment: activityCount
  • RecipientAccount: cardDetails, mailing, phoneNumber

Compatibility notes

1. Legacy static helpers

The legacy static helpers on model classes continue to delegate to the current gateway methods.

from trolley.types.batch import Batch
from trolley.types.payment import Payment
from trolley.types.recipient import Recipient

Batch.summary("B-123456789")
Payment.find("P-123456789", "B-123456789")
Recipient.find("R-123456789", "payments")

2. Error message handling

SDK exceptions now accept both API JSON error bodies and plain string messages. Plain string messages are exposed through the same error-array accessor shape.

from trolley.exceptions.invalidFieldException import InvalidFieldException

try:
    client.batch.create(None)
except InvalidFieldException as error:
    print(error.get_error_array()[0]["message"])