Looking for ePay classic docs? Go to docs.epay.dk
ePay documentationDocsePay documentation
Transactions

Capture Payment

OpenAPI Spec

Test this endpoint live

Open the same request directly in API Explorer.

Open in API Explorer

Server URL

POST
/public/api/v1/transactions/{transactionId}/capture

Capture a payment by finalizing a previously authorized transaction and moving the funds from the customer’s card to your account.

When a payment is first authorized, the customer’s bank sets aside the money but doesn’t transfer it yet. Capturing the payment completes the process and transfers those funds to you.

We recommend a minimum timeout of 60 seconds.

Operations are processed synchronously

All operations such as CAPTURE, VOID and REFUND are processed synchronously and the outcome is returned directly in the response, meaning webhooks are not required.

We strongly recommend using the Idempotency-Key header, to ensure safe retries in case of network failure.

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

transactionIdstring
Required

The id of the transaction to capture.

Header Parameters

Idempotency-Keystring

Ensures that a request can be safely retried without causing duplicate operations. Typically used for actions like payment creation and operations such as refund and void to prevent accidental double processing.

  • If a response is replayed due to using the same key, the response will include the header Idempotent-Replayed: true.
  • Idempotency keys are scoped by [Key, Endpoint, HTTP Verb]; the same key on a different endpoint or method will not replay the original response.
  • Responses are cached for 24 hours. After that, the cache is cleared, so idempotency is only guaranteed within 24 hours of the initial request.

Request Body

application/json

Capture request payload.

TypeScript Definitions

Use the request body type in TypeScript.

amountinteger
Required

The amount to capture in minor units (e.g., 1095 = 10.95 DKK). You cannot capture more than authorized.

Range:
1 <= value
voidRemainingboolean

If true, any remaining authorization balance will be voided after a successful capture. If the capture fails, nothing will be voided.

Default:
false

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/public/api/v1/transactions/string/capture" \  -H "Idempotency-Key: c4f5e8d2-1234-5678-90ab-cdef12345678" \  -H "Content-Type: application/json" \  -d '{    "amount": 1095  }'
{  "operationId": "019248e0-0ff4-7c1e-9438-f7648c9ff0fe",  "success": false,  "errorCode": {    "code": "DECLINED_BY_ISSUER_OR_SCHEME",    "message": "The operation was rejected by either the issuer or schemes."  }}
{  "errorCode": "SERVER_ERROR",  "message": "An unexpected system error"}
{  "errorCode": "VALIDATION_ERROR",  "message": "Input validation errors",  "errors": {    "amount": [      "[required]: Is a required non-nullable field",      "[int]: Must be an integer",      "[min:0]: Must be greater than 0",      "[max:999999999]: Must be less than 999999999"    ]  }}
{  "errorCode": "SERVER_ERROR",  "message": "An unexpected system error"}