Payments API Routes

A payment is created when a payment amount is authorized. The payment can then be captured or refunded.

A payment is created from the payment session that was authorized, and it belongs to the payment session's collection.

These API routes allow admin users to manage payments.

GET /admin/payments#

List Payments

Retrieve a list of payments. The payments can be filtered by fields such as id. The payments can also be sorted or paginated.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
offsetnumberOptional
The number of items to skip when retrieving a list.
limitnumberOptional
Limit the number of items returned in the list.
orderstringOptional
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
qstringOptional
Search term to filter the payment's searchable properties.
idstring | string[]Optional
Filter by a payment ID.
payment_session_idstring | string[]Optional
Filter by a payment session ID to retrieve its associated payments.
created_atobjectOptional
Filter by the payment's creation date. Accepts the filter operators.
updated_atobjectOptional
Filter by the payment's update date. Accepts the filter operators.
deleted_atobjectOptional
Filter by the payment's deletion date. Accepts the filter operators.
$andobject[]Optional
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
$orobject[]Optional
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
with_deletedbooleanOptional
Whether to include deleted records in the result.

Request examples

Responses

200 OK

limitnumber
The maximum number of returned items.
offsetnumber
The number of items skipped before the returned items.
countnumber
The total number of payments.
paymentsobject[]
The list of payments.

400, 401, 404, 409, 422, 500: an error response is returned.


GET /admin/payments/payment-providers#

List Payment Providers

Retrieve a list of payment providers. The payment providers can be filtered by fields such as id. The payment providers can also be sorted or paginated.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
offsetnumberOptional
The number of items to skip when retrieving a list.
limitnumberOptional
Limit the number of items returned in the list.
orderstringOptional
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
idstring | string[]
Filter by a payment provider's ID.
is_enabledbooleanOptional
Filter by whether the payment provider is enabled.
$andobject[]Optional
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
$orobject[]Optional
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
with_deletedbooleanOptional
Whether to include deleted records in the result.

Request examples

Responses

200 OK

limitnumber
The maximum number of items returned.
offsetnumber
The number of items skipped before the returned items.
countnumber
The total number of items.
payment_providersobject[]
The list of payment providers.

400, 401, 404, 409, 422, 500: an error response is returned.


GET /admin/payments/{id}#

Get a Payment

Retrieve a payment by its ID. You can expand the payment's relations or select the fields that should be returned.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The payment's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request examples

Responses

200 OK

paymentobject
The payment's details.

400, 401, 404, 409, 422, 500: an error response is returned.


POST /admin/payments/{id}/capture#

Capture Payment

Capture an amount of a payment. This uses the capturePayment method of the payment provider associated with the payment's collection.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The payment's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request body (application/json)

amountnumberOptional
The amount to capture.

Request examples

Responses

200 OK

paymentobject
The payment's details.

400, 401, 404, 409, 422, 500: an error response is returned.

Emitted events

  • payment.captured: Emitted when a payment is captured.

POST /admin/payments/{id}/refund#

Refund Payment

Refund an amount of a payment. This uses the refundPayment method of the payment provider associated with the payment's collection.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The payment's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request body (application/json)

amountnumberOptional
The amount to refund.
refund_reason_idstringOptional
The ID of a refund reason.
notestringOptional
A note to attach to the refund.
idempotency_keystringOptional
The payment's idempotency key.

Request examples

Responses

200 OK

paymentobject
The payment's details.

400, 401, 404, 409, 422, 500: an error response is returned.

Emitted events

  • payment.refunded: Emitted when a payment is refunded.
Found a problem with this page?Report Issue
Edited Nov 14·Edit this page