Manage a payment
Let's look at some of the features available for managing a payment object. The endpoint list below demonstrates how various APIs can be used to manage payments.
- Create a payment →
POST
→ /payments - Retrieve a payment →
GET
→ /payments/{Id} - List all payments →
GET
→ /payments - Filter all payments →
POST
→ /payments/filter - Update a payment→
POST
→ /payments/{id}
Apply filters
You can apply a filter using the endpoint /payments/filter and some optional request parameters.
We'll show you how you can filter the payment list to get all the paid payments.
Request
{
"status": [
"paid"
],
"limit": 20
}
Request parameters
For more information on other optional parameters you can apply, please refer to the below-mentioned table.
Parameter | Type | Description |
---|---|---|
ids | array_string | In this parameter, you specify an array of ids of the payments through which you want to filter the list of payments. |
status | array_string | In this parameter, you specify an array of statuses for which the list should be filtered. |
amount | object | Specify the amount as a value in one of the following mutually exclusive sub-parameters to get a filtered list based on that amount. Gt → All payments with an amount greater than this will be returned. lt → All payments with an amount less than this will be returned. Gte → All payments with an amount greater than and equal to this will be returned. lte → All payments with an amount less than and equal to this will be returned. |
currency | array_string | In this parameter, you specify an array of currencies for which payments should be filtered. A three-lettered ISO-compliant currency name must be used. |
target_amount | object | Specify the target amount as a value in one of the following manually exclusive sub-parameters to get a filtered list based on that target amount. Gt → All payments with a target amount greater than this will be returned. lt → All payments with a target amount less than this will be returned. Gte → All payments with a target amount greater than and equal to this will be returned. lte → All payments with a target amount less than and equal to this will be returned. |
target_currency | array_string | In this parameter, you specify an array of target currencies for which payments should be filtered. |
target_amount_paid | object | Specify the target amount paid as a value in one of the following manually exclusive sub-parameters to get a filtered list based on the target amount paid. Gt → All payments with a target_amount_paid greater than this will be returned. lt → All payments with a target_amount_paid less than this will be returned. Gte → All payments with a target_amount_paid greater than and equal to this will be returned. lte → All payments with a target_amount_paid less than and equal to this will be returned. |
limit | int | A limit specifies the number of objects to be returned. The default and maximum page size have 10 objects per page, and it is consistent across endpoints. |
starting_after | string | This is one of the pagination parameters. Enter the ID of any object here to retrieve the next page of the list starting after the ID you specified. Starting after and ending before are mutually exclusive and can only be used once. |
ending_before | string | This is one of the pagination parameters. Enter the ID of any object here to retrieve the previous page of the list ending before the ID you specified. Starting after and ending before are mutually exclusive and can only be used once. |
created | object | Specify a timestamp as a value in one of the following mutually exclusive sub-parameters to get a filtered list based on the time they were created. Gt → All payments created after the specified timestamp will be returned. lt → All payments created before the specified timestamp will be returned. Gte → All payments created after and on the specified timestamp will be returned. lte → All payments created before and on the specified timestamp will be returned. |
Request headers
As of now, there are two versions (2022-04-15 and 2022-10-15). Version 2022-10-15 supports both on-chain and lightning payment methods. Whereas the 2022-04-15 version only supports lightning payments. In this string header speed-version
, you can specify any version you want with all of the above APIs.
Track payments
You can check the payment outcome on your web application, which provides detailed insights. Alternatively, you can configure notification webhooks to receive payment updates. Learn more about Webhook subscriptions.
Updated 4 months ago