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+ 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.offsetnumberOptionallimitnumberOptionalorderstringOptional-.qstringOptionalidstring | string[]Optionalpayment_session_idstring | string[]Optionalcreated_atobjectOptionalupdated_atobjectOptionaldeleted_atobjectOptional$andobject[]Optional$orobject[]Optionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberpaymentsobject[]The list of payments.
paymentsobject[]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+ 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.offsetnumberOptionallimitnumberOptionalorderstringOptional-.idstring | string[]is_enabledbooleanOptional$andobject[]Optional$orobject[]Optionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberpayment_providersobject[]The list of payment providers.
payment_providersobject[]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
idstringQuery parameters
fieldsstringOptional+ 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
paymentobjectThe payment's details.
paymentobject400, 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
idstringQuery parameters
fieldsstringOptional+ 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)
amountnumberOptionalRequest examples
Responses
200 OK
paymentobjectThe payment's details.
paymentobject400, 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
idstringQuery parameters
fieldsstringOptional+ 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)
amountnumberOptionalrefund_reason_idstringOptionalnotestringOptionalidempotency_keystringOptionalRequest examples
Responses
200 OK
paymentobjectThe payment's details.
paymentobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
payment.refunded: Emitted when a payment is refunded.