Skip to main content

Clio Payments API

Third-party applications in Clio have the ability to leverage Clio Payments by generating links to our hosted payment pages and sharing them to their clients.

Access to Clio Payments API will require the authenticating user to accept the clio_payments scope during the OAuth authorization process.

Payments can only be collected for accounts that have enabled Clio Payments, can only be used for bank accounts that are connected to Clio Payments (see the clio_payments_enabled Bank Account field), and can only be made in the currency that the account is set up to use. The accepted currencies per account's country are:

  • United States: USD
  • Canada: CAD
  • United Kingdom: GBP

A payment link can be used to pay an existing invoice or trust request. Alternatively, a payment link can be used to collect an amount from a client which can either be later applied to an invoice or simply collected as a revenue payment.

To create a payment link, make a POST request to the /api/v4/clio_payments/links endpoint. The required fields depend on the type of payment link being created.

The following limitations exist for the creation of payment links in the API:

  • The maximum duration that a payment link can be active for is 90 days.
  • The maximum number of payment links that can active on the account at any given time is 50 times the number of users in the account.
  • The maximum number of payment links that can be created in a 24-hour period is 50 times the number of users in the account.

A payment link is single-use. Once a payment link has been used, it will immediately expire.

Paying off existing invoice(s) or a trust request

When creating a payment link for paying off existing invoice(s) or trust requests, the following fields are required:

ParameterTypeDescription
currencystringThe currency the payment will be processed in. The supported currency depends on the account's location (ie. "USD" for a US account). The currency must be a valid ISO 4217 currency code.
destination_accountobjectThe bank account that the payment will be deposited into.
durationnumberThe amount of time, in seconds, that the payment link will be active for. The maximum allowed value is 7776000 (90 days in seconds).
subjectobjectAn object representing an associated record in Manage. This property determines the behaviour around the payment once it's received. The object must contain two properties:
- id: the ID of the record associated with the payment link.
- type: a string representing the type of record. This value should be set to "Bill" for payment links for an invoice or trust request to be paid, or "Contact" for payment links for a contact with outstanding invoices whose balance will be paid.

Additionally, the following fields are optional:

ParameterTypeDescription
amountnumberThe amount to be paid. If not provided, the client will be able to specify an amount - up to the full amount of the invoice(s) or trust request.
email_addressstringPrefills the relevant field for the client when filling out their details in the payment link.
redirect_urlstringThe URL to redirect the client to after the payment has been made.

A sample request body to create a payment link for paying off an existing invoice is:

{
"data": {
"amount": 100.00,
"currency": "USD",
"destination_account": {
"id": 123456
},
"duration": 86400,
"email_address": "test@example.com",
"redirect_url": "https://example.com",
"subject": {
"id": 123456,
"type": "Bill"
}
}
}

Collecting a direct payment

Payments can be collected directly into a bank account as either revenue or as an unallocated balance that can be applied to future invoices. To collect a direct payment, the following fields are required:

ParameterTypeDescription
currencystringThe currency the payment will be processed in. The supported currency depends on the account's location (ie. "USD" for a US account). The currency must be a valid ISO 4217 currency code.
descriptionstringA short description of the purpose of the payment. Max 255 characters.
durationnumberThe amount of time, in seconds, that the payment link will be active for. The maximum allowed value is 7776000 (90 days in seconds).
subjectobjectAn object representing an associated record in Manage. This property determines the behaviour around the payment once it's received. The object must contain two properties:
- id: the ID of the record associated with the payment link.
- type: a string representing the type of record. This value should be set to "BankAccount" for payment links for a direct payment.

Additionally, the following fields are optional:

ParameterTypeDescription
amountnumberThe amount to be paid. If not provided, the client will be able to specify an amount.
destination_contactobjectThe contact that the payment will be associated with. If not defined, and the payment is collecting an unallocated balance, then the payment can be associated with a contact manually within Manage after it has been made.
email_addressstringPrefills the relevant field for the client when filling out their details in the payment link.
is_allocated_as_revenuebooleanIf true, the payment will be allocated as revenue. If false, the payment will be collected as an unallocated balance. Defaults to false.
redirect_urlstringThe URL to redirect the client to after the payment has been made. The URL must match one of the base URLS for payment links specified in your application settings in the developer portal.

A sample request body to create a payment link for collecting a direct payment is:

{
"data": {
"amount": 100.00,
"currency": "USD",
"description": "Reason XYZ",
"destination_contact": {
"id": 123456
},
"duration": 86400,
"email_address": "test@example.com",
"is_allocated_as_revenue": "true",
"redirect_url": "https://example.com",
"subject": {
"id": 123456,
"type": "BankAccount"
}
}
}

To retrieve a list of payment links, make a GET request to the /api/v4/clio_payment_links endpoint. The response will contain an array of payment links.

Payment links can be filtered by the following parameters:

ParameterTypeDescription
activebooleanIf true, only active payment links will be returned. If false, only inactive payment links will be returned. If not provided, all payment links will be returned.

A sample request to retrieve all active payment links is:

GET /api/v4/clio_payment_links?active=true

When retrieving payment links, the following fields are available:

FieldTypeDescription
activebooleanWhether the payment link is active.
amountnumberThe defined amount of the payment link, if set.
bank_accountobjectThe payment link's subject if the payment link is a direct payment.
billobjectThe payment link's subject if the payment link is to pay off an invoice or trust request.
clio_payments_paymentobjectThe payment that was made through the payment link.
contactobjectThe payment link's subject if the payment link is to pay off the outstanding balance of a contact.
created_atstringThe ISO 8601 date and time the payment link was created.
currencystringThe currency the payment link will collect.
descriptionstringThe defined description of the payment link, if set.
destination_accountobjectThe bank account that the payment will be deposited into.
destination_contactobjectThe contact that a direct payment will be associated with.
email_addressstringThe email address to prefill the field on the the payment link, if set.
etagstringThe ETag of the payment link.
expires_atstringThe ISO 8601 date and time the payment link will expire.
idnumberThe unique identifier of the payment link.
is_allocated_as_revenuebooleanWhether the payment link is allocated as revenue.
redirect_urlstringThe URL to redirect the client to after the payment has been made.
urlstringThe URL of the payment link.

Retrieving Details of Payments Made

To retrieve the details of payments made, make a GET request to the /api/v4/clio_payments/payments endpoint. The endpoint will return only the details of the payments made via payment links that your application has created.

Filtering Payments

Payments can be filtered by the following parameters:

ParameterTypeDescription
bill_idnumberThe ID of a bill that the payment is associated with.
contact_idnumberThe ID of a contact that the payment is associated with.
idsarrayAn array of payment IDs to retrieve.
statestringThe state of the payment (authorized, completed, failed, etc).

Available Payment Fields

When retrieving payments, the following fields are available:

FieldTypeDescription
allocationsarrayAny allocations associated with the payment. Refer to the allocations documentation for serializable fields.
amountnumberThe amount of the payment.
bank_transactionobjectThe bank transaction associated with the received payment. Refer to the bank transactions documentation for serializable fields. Note: A payment without an associated a contact or matter will not have a bank transaction until an association is created.
billsarrayAny bills that the payment amount is or will be allocated to. Refer to the bills documentation for serializable fields.
clio_payments_linkobjectThe payment link that the payment was made through.
confirmation_numberstringThe confirmation number of the payment.
contactobjectThe contact that the payment is associated with.
created_atstringThe ISO 8601 date and time the payment was created.
currencystringThe currency the payment was processed in.
deposit_as_revenuebooleanWhether the payment was deposited as revenue.
descriptionstringThe description of the payment.
destination_accountobjectThe bank account that the payment was deposited into. Refer to the bank accounts documentation for serializable fields.
email_addressstringThe email address of the client.
idnumberThe unique identifier of the payment.
mattersarrayAny matters the payment amount is or will be allocated to. Refer to the matters documentation for serializable fields.
statestringThe state of the payment (authorized, completed, failed, etc).
updated_atstringThe ISO 8601 date and time the payment was last updated.
userobjectThe user that created the payment link that resulted in the payment. Refer to the users documentation for serializable fields.

Using Webhooks

To receive notifications of changes to payments, you can use the Webhooks API. The clio_payments_payment event will be triggered when a payment is created or updated. Deleted events are not supported for payments as payments can not be deleted.