Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7934f19
Changes generated by ec38efc9399c35a48fafd8fb5d758e56c4c818e3
gocardless-ci-robot[bot] Jun 24, 2025
84647f0
Changes generated by 4317f4b4cb7530ecacd251074a83fe852c710088
gocardless-ci-robot[bot] Jul 2, 2025
8836ca4
Changes generated by b9b0a5fdeb7a38aef75d451078d79b5b38e0da12
gocardless-ci-robot[bot] Jul 3, 2025
666c58e
Changes generated by 8685c995f251f3c84cec7426a43e4f922007134a
gocardless-ci-robot[bot] Aug 27, 2025
7c3e029
Changes generated by b3637477d04031e3025772d7631bc18fb563eb27
gocardless-ci-robot[bot] Sep 2, 2025
82581c9
Changes generated by c06ba371f94b11c3a3ee8f8153ee7cf91a43a6e2
gocardless-ci-robot[bot] Sep 4, 2025
474397f
Changes generated by a2233048e0f6f48dadf1e102e4f6ef48cf3c33d1
gocardless-ci-robot[bot] Sep 5, 2025
90c9284
Changes generated by 1d65bb01d312127db353cbf6472673c20d8b46de
gocardless-ci-robot[bot] Sep 9, 2025
23cd5fe
Changes generated by f7f58f4fbe99407d3dc5f6033c506d66c3e7bff0
gocardless-ci-robot[bot] Sep 10, 2025
879d12c
Changes generated by 2222e59f53da585746ae1d147d79904b077c8eb2
gocardless-ci-robot[bot] Sep 10, 2025
9e17b14
Changes generated by 31ce9473f1b351d68f0c9f8f35107b24197a8de2
gocardless-ci-robot[bot] Sep 10, 2025
682b3e7
Changes generated by 71ecca1eae5e97d613ded03da8ca1e30f5de7fbf
gocardless-ci-robot[bot] Sep 23, 2025
f5a36ff
Changes generated by 83e6410815793d38990d313fc372fed98727ad91
gocardless-ci-robot[bot] Sep 23, 2025
b134583
Changes generated by d7d511ec480bd771f19f57f8b5102cb63566ec7e
gocardless-ci-robot[bot] Sep 25, 2025
9ceecad
Changes generated by 4597719826a2de3ec1652563eee0b43999826b79
gocardless-ci-robot[bot] Sep 25, 2025
44e990b
Changes generated by 724c9730258e3623244cf095596b6b5f3dae2919
gocardless-ci-robot[bot] Sep 30, 2025
5c97632
Changes generated by ca4c067dbfa48d7e0a83221cac8aa263a53efed6
gocardless-ci-robot[bot] Oct 1, 2025
bd2c6eb
Changes generated by 806f1bb57ed68289be43eebc9b3140f3bb94e73a
gocardless-ci-robot[bot] Oct 7, 2025
40d8620
Changes generated by 61a4bd6193adffb3a8e43d485a2134e258739c4d
gocardless-ci-robot[bot] Oct 10, 2025
f9a7547
Changes generated by 729849c5c87a70c4408d6eefe00948655b331501
gocardless-ci-robot[bot] Oct 10, 2025
21a7bc0
Changes generated by a6ec4b6d5fd37612076eee00ff41081b1f98dae7
gocardless-ci-robot[bot] Oct 16, 2025
d120da1
Changes generated by 72dfdb980010103d946d7165a363044d2b258823
gocardless-ci-robot[bot] Oct 22, 2025
2fab51a
Changes generated by 1767d0e6a8c58adc7779c920a9b5c9c82615130d
gocardless-ci-robot[bot] Oct 23, 2025
03038a9
Changes generated by 28d5e076d86cf8184a88a6c40cd714390b4e9ad5
gocardless-ci-robot[bot] Oct 30, 2025
5543da6
Changes generated by 438ddd287e45a8629d4f89be940425a9ec4cee54
gocardless-ci-robot[bot] Nov 20, 2025
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
29 changes: 20 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A Python client for interacting with the GoCardless Pro API.

|pypi-badge|

Tested against Python 3.8, 3.9, 3.10, 3.11 and 3.12.
Tested against Python 3.9, 3.10, 3.11 and 3.12.

- `"Getting Started" guide <https://developer.gocardless.com/getting-started/api/introduction/?lang=python>`_ with copy and paste Python code samples
- `API reference`_
Expand Down Expand Up @@ -187,7 +187,7 @@ Billing request templates
client.billing_request_templates.create(params={...})

# Update a Billing Request Template
client.billing_request_templates.update('BRQ123', params={...})
client.billing_request_templates.update('BRT123', params={...})

Billing request with actions
''''''''''''''''''''''''''''''''''''''''''
Expand Down Expand Up @@ -439,13 +439,13 @@ Mandate imports
client.mandate_imports.create(params={...})

# Get a mandate import
client.mandate_imports.get('IM000010790WX1', params={...})
client.mandate_imports.get('IM123', params={...})

# Submit a mandate import
client.mandate_imports.submit('IM000010790WX1', params={...})
client.mandate_imports.submit('IM123', params={...})

# Cancel a mandate import
client.mandate_imports.cancel('IM000010790WX1', params={...})
client.mandate_imports.cancel('IM123', params={...})

Mandate import entries
''''''''''''''''''''''''''''''''''''''''''
Expand Down Expand Up @@ -492,13 +492,13 @@ Outbound payments
client.outbound_payments.withdraw(params={...})

# Cancel an outbound payment
client.outbound_payments.cancel('OUT01JR7P5PKW3K7Q34CJAWC03E82', params={...})
client.outbound_payments.cancel('OUT123', params={...})

# Approve an outbound payment
client.outbound_payments.approve('OUT01JR7P5PKW3K7Q34CJAWC03E82', params={...})
client.outbound_payments.approve('OUT123', params={...})

# Get an outbound payment
client.outbound_payments.get('OUT01JR7P5PKW3K7Q34CJAWC03E82', params={...})
client.outbound_payments.get('OUT123', params={...})

# List outbound payments
client.outbound_payments.list(params={...})
Expand All @@ -507,7 +507,7 @@ Outbound payments
client.outbound_payments.all(params={...})

# Update an outbound payment
client.outbound_payments.update('OUT01JR7P5PKW3K7Q34CJAWC03E82', params={...})
client.outbound_payments.update('OUT123', params={...})

Payer authorisations
''''''''''''''''''''''''''''''''''''''''''
Expand Down Expand Up @@ -563,6 +563,17 @@ Payments
# Retry a payment
client.payments.retry('PM123', params={...})

Payment account transactions
''''''''''''''''''''''''''''''''''''''''''

.. code:: python

# List payment account transactions
client.payment_account_transactions.list('BA123', params={...})

# Iterate through all payment_account_transactions
client.payment_account_transactions.all(params={...})

Payouts
''''''''''''''''''''''''''''''''''''''''''

Expand Down
4 changes: 4 additions & 0 deletions gocardless_pro/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ def payer_themes(self):
def payments(self):
return services.PaymentsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def payment_account_transactions(self):
return services.PaymentAccountTransactionsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def payouts(self):
return services.PayoutsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)
Expand Down
5 changes: 3 additions & 2 deletions gocardless_pro/paginator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ class Paginator(object):
loading each page until the last.
"""

def __init__(self, service, params):
def __init__(self, service, params, identity_params=None):
self._service = service
self._params = params
self._identity_params = identity_params or {}

def __iter__(self):
return self._iterate()
Expand All @@ -30,5 +31,5 @@ def _fetch_page(self, after):
params = self._params.copy()
if after is not None:
params.update({'after': after})
return self._service.list(params=params)
return self._service.list(**self._identity_params, params=params)

2 changes: 2 additions & 0 deletions gocardless_pro/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@

from .payment import Payment

from .payment_account_transaction import PaymentAccountTransaction

from .payout import Payout

from .payout_item import PayoutItem
Expand Down
4 changes: 4 additions & 0 deletions gocardless_pro/resources/billing_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ def currency(self):
def description(self):
return self.attributes.get('description')

@property
def funds_settlement(self):
return self.attributes.get('funds_settlement')

@property
def links(self):
return self.attributes.get('links')
Expand Down
26 changes: 26 additions & 0 deletions gocardless_pro/resources/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def resource_type(self):
return self.attributes.get('resource_type')


@property
def source(self):
return self.Source(self.attributes.get('source'))





Expand Down Expand Up @@ -162,6 +167,10 @@ def instalment_schedule(self):
def mandate(self):
return self.attributes.get('mandate')

@property
def mandate_request(self):
return self.attributes.get('mandate_request')

@property
def mandate_request_mandate(self):
return self.attributes.get('mandate_request_mandate')
Expand Down Expand Up @@ -222,3 +231,20 @@ def subscription(self):




class Source(object):
"""Wrapper for the response's 'source' attribute."""

def __init__(self, attributes):
self.attributes = attributes

@property
def name(self):
return self.attributes.get('name')

@property
def type(self):
return self.attributes.get('type')



12 changes: 10 additions & 2 deletions gocardless_pro/resources/mandate.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,16 @@ def max_amount_per_payment(self):
return self.attributes.get('max_amount_per_payment')

@property
def periods(self):
return self.attributes.get('periods')
def max_amount_per_period(self):
return self.attributes.get('max_amount_per_period')

@property
def max_payments_per_period(self):
return self.attributes.get('max_payments_per_period')

@property
def period(self):
return self.attributes.get('period')

@property
def start_date(self):
Expand Down
7 changes: 7 additions & 0 deletions gocardless_pro/resources/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ def retry_if_possible(self):
return self.attributes.get('retry_if_possible')


@property
def scheme(self):
return self.attributes.get('scheme')


@property
def status(self):
return self.attributes.get('status')
Expand Down Expand Up @@ -165,3 +170,5 @@ def subscription(self):





108 changes: 108 additions & 0 deletions gocardless_pro/resources/payment_account_transaction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#

class PaymentAccountTransaction(object):
"""A thin wrapper around a payment_account_transaction, providing easy access to its
attributes.

Example:
payment_account_transaction = client.payment_account_transactions.get()
payment_account_transaction.id
"""

def __init__(self, attributes, api_response):
self.attributes = attributes
self.api_response = api_response

@property
def amount(self):
return self.attributes.get('amount')


@property
def balance_after_transaction(self):
return self.attributes.get('balance_after_transaction')


@property
def counterparty_name(self):
return self.attributes.get('counterparty_name')


@property
def currency(self):
return self.attributes.get('currency')


@property
def description(self):
return self.attributes.get('description')


@property
def direction(self):
return self.attributes.get('direction')


@property
def id(self):
return self.attributes.get('id')


@property
def links(self):
return self.Links(self.attributes.get('links'))


@property
def reference(self):
return self.attributes.get('reference')


@property
def value_date(self):
return self.attributes.get('value_date')


















class Links(object):
"""Wrapper for the response's 'links' attribute."""

def __init__(self, attributes):
self.attributes = attributes

@property
def outbound_payment(self):
return self.attributes.get('outbound_payment')

@property
def payment_bank_account(self):
return self.attributes.get('payment_bank_account')

@property
def payout(self):
return self.attributes.get('payout')







1 change: 1 addition & 0 deletions gocardless_pro/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from .payer_authorisations_service import PayerAuthorisationsService
from .payer_themes_service import PayerThemesService
from .payments_service import PaymentsService
from .payment_account_transactions_service import PaymentAccountTransactionsService
from .payouts_service import PayoutsService
from .payout_items_service import PayoutItemsService
from .redirect_flows_service import RedirectFlowsService
Expand Down
5 changes: 3 additions & 2 deletions gocardless_pro/services/balances_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ def list(self,params=None, headers=None):
retry_failures=True)
return self._resource_for(response)

def all(self, params=None):
def all(self,params=None):
if params is None:
params = {}
return Paginator(self, params)
return Paginator(self, params, identity_params={
})


7 changes: 6 additions & 1 deletion gocardless_pro/services/bank_account_details_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ def get(self,identity,params=None, headers=None):
"""Get encrypted bank details.

Returns bank account details in the flattened JSON Web Encryption
format described in RFC 7516
format described in RFC 7516.

You must specify a `Gc-Key-Id` header when using this endpoint. See
[Public Key
Setup](https://developer.gocardless.com/gc-embed/bank-details-access#public_key_setup)
for more details.

Args:
identity (string): Unique identifier, beginning with "BA".
Expand Down
7 changes: 4 additions & 3 deletions gocardless_pro/services/billing_request_templates_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ def list(self,params=None, headers=None):
retry_failures=True)
return self._resource_for(response)

def all(self, params=None):
def all(self,params=None):
if params is None:
params = {}
return Paginator(self, params)
return Paginator(self, params, identity_params={
})



Expand Down Expand Up @@ -101,7 +102,7 @@ def update(self,identity,params=None, headers=None):
Billing Requests created by this template.

Args:
identity (string): Unique identifier, beginning with "BRQ".
identity (string): Unique identifier, beginning with "BRT".
params (dict, optional): Request body.

Returns:
Expand Down
5 changes: 3 additions & 2 deletions gocardless_pro/services/billing_requests_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,11 @@ def list(self,params=None, headers=None):
retry_failures=True)
return self._resource_for(response)

def all(self, params=None):
def all(self,params=None):
if params is None:
params = {}
return Paginator(self, params)
return Paginator(self, params, identity_params={
})



Expand Down
Loading