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

Capture Payment

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

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

transactionIdstring
Required

The id of the transaction to capture.

Header Parameters

Idempotency-Keystring

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"}

Physical Sale

Starts an in-person sale on a physical payment terminal connected to a Softpay point of sale. Physical transactions are processed using operation type SALE, which functions as an instant capture making sales function as both an AUTHORIZATION and CAPTURE in a single atomic operation. These transactions therefor cannot be voided. This endpoint creates the transaction immediately. The transaction returned in the response confirms that the sale request was accepted and created, but not that the cardholder has completed the payment yet. If terminal.id is provided, ePay targets that specific terminal. If terminal is omitted, ePay automatically routes the sale to the fallback terminal for the given point of sale. The pointOfSaleId must refer to a physical Softpay point of sale that belongs to your account. ### Refunds Physical transactions does not support card-not-present online refunds. Meaing the refund operation is not supported for physical transactions. To refund a previous purchase a PAYOUT transaction must be initiated instead by setting "type": "PAYOUT", which will initiate a transaction on the terminal sending funds to the card placed on the terminal. ### Notification You’ll receive the outcome of the payment on the notificationUrl you provide within the request, making it the primary way to track the result of this payment. Webhooks can be used separately if you need broader, system-wide updates. Early rejections, such as the SoftPay terminal being wrongly configured or blocked by another transaction will return a transaction response with state FAILED. If the transaction fails due to early rejections, the final state is returned in the response and no notification is sent to the notificationUrl.

Refund Payment

Refund a payment by returning money to the customer after it has already been captured. You can refund the full amount or only part of it (partial refund), depending on how much you want to return. The endpoint typically only returns a single refund operation. But if multiple partial captures have been requested, the endpoint might return multiple refund operations as each capture is refunded in isolation. All operations are returned in the same response. If you do not use partial captures, then you will only ever receive a single refund operation. 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.