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

MIT Authorization

Test this endpoint live

Open the same request directly in API Explorer.

Open in API Explorer

Server URL

POST
/public/api/v1/mit

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Header Parameters

Idempotency-Keystring

Request Body

application/json

MIT authorization request payload.

TypeScript Definitions

Use the request body type in TypeScript.

subscriptionIdstring
Required

The ID of the subscription to charge

Format:
uuid
Example:
"01929a94-5fce-7ccc-a7e4-7e9249133b39"
amountinteger
Required

Amount in minor units (e.g., 1095 = 10.95 DKK)

Example:
100
currencystring
Nullable

The currency of the transaction. If set to null, then the same currency as the subscription was created for will be used.

Match:
^[A-Z]{3}$
Example:
"DKK"
referencestring

The merchant reference for the payment. This is typically used for the order id.

Example:
"subscription-charge-1"
instantCapturestring

If the payment should be captured instantly or not.

  • OFF indicates that the payment should not be captured instantly.
  • VOID indicates that the payment should be captured instantly and if somehow the instant capture fails the payment is voided.
  • NO_VOID indicates that the payment should be captured instantly and if the capture fails the authorization is kept (no void is made)
Possible values:
"OFF""VOID""NO_VOID"
Example:
"OFF"
textOnStatementstring

The text to show on the cardholder bank statement. Many providers do not support long texts. Epay will cut the text to match the acquirer limitations.

Length:
1 <= length <= 39
Example:
"WineBox subscription"
notificationUrlstring
Required

The URL to receive the webhook with the transaction result

Format:
uri
Example:
"https://example.com/epay/notification"

A list of pass-through parameters that will be sent back on the notification URL

[key: string]unknown

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/public/api/v1/mit" \  -H "Idempotency-Key: c4f5e8d2-1234-5678-90ab-cdef12345678" \  -H "Content-Type: application/json" \  -d '{    "subscriptionId": "01929a94-5fce-7ccc-a7e4-7e9249133b39",    "amount": 100,    "notificationUrl": "https://example.com/epay/notification"  }'
{  "transaction": {    "id": "LDG7M4WW44G",    "subscriptionId": "0197c07b-3f6d-7be2-b848-702b08958128",    "billingAgreementChargeId": "019a727b-987f-7768-a59e-71af920ef81f",    "state": "PENDING",    "errorCode": "string",    "externalStatusCodes": {      "terminal": "string",      "acquirer": "string",      "network": "string",      "sca": "string"    },    "createdAt": "2019-08-24T14:15:22Z",    "sessionId": "string",    "paymentMethodId": "b6df8625-cd25-4123-b345-638aa7b5d011",    "paymentMethodType": "CARD",    "paymentMethodSubType": "Visa",    "paymentMethodExpiry": "2019-08-24",    "paymentMethodDisplayText": "string",    "paymentMethodHolderName": "string",    "scaMode": "SKIP",    "customerId": "string",    "amount": 0,    "fee": 0,    "currency": "string",    "instantCapture": "OFF",    "notificationUrl": "http://example.com",    "pointOfSaleId": "be6bff4f-7fac-43c0-9f6b-cf2cd45ed7d1",    "reference": "string",    "textOnStatement": "string",    "exemptions": [      "LVT",      "TRA"    ],    "attributes": {      "property1": null,      "property2": null    },    "clientIp": "52.212.176.122",    "clientCountry": "DK",    "type": "PAYMENT"  }}
{  "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"}

Get Payment Session

Retrieve the current state and details of a specific payment session. This endpoint can be used to look up a session by its ID and inspect its lifecycle, including whether it is still pending, in progress, completed, or expired. Avoid polling This endpoint is subject to rate limits and must not be used for continuous polling. Instead, you should rely on the notificationUrl provided during session initialization to receive the outcome of the payment. This is the primary and recommended integration pattern. Use this endpoint as a fallback mechanism - for example, if you did not receive a webhook or need to manually verify the final state of a session.

MIT Batch Authorization

Rate limits Please review our rate limits before you begin your implementation. Create multiple MIT (Merchant-Initiated Transaction) authorizations in a single request. Each entry mirrors the single MIT endpoint and is processed asynchronously, supporting partial success across the batch. Each transaction is processed individually, if the transaction passes initial validation then a transaction is created for background processing and a transaction is returned. If the initial validation fails, instead an error is returned. You will receive one callback for each individual transaction. You’ll receive the outcome of each payment on the notificationUrl you provide within the request, making it the primary way to track the result of these payments. Webhooks can be used separately if you need broader, system-wide updates. Use a MIT authorization when the customer has agreed to let the merchant charge them automatically. For example, monthly subscription payments must be handled using MIT. MIT is not suitable when the customer starts the payment themselves, like clicking a “Pay Now” button. For more information about the differences between CIT (Customer-Initiated Transaction) and MIT, see our Core Concepts page. All MIT transactions are processed asynchronously and cannot run in real time. Most are completed within a few seconds, but ePay does not guarantee processing times. Some payment methods, such as Vipps MobilePay, may take several days to complete, depending on the method’s processing rules. When you match the returned transaction results back to your original batch request, the transaction order is preserved from request to response. This means you can always correlate each result to the original request item by using the array index. You can also provide a reference on each transaction in your request. When present, the same reference value is included in the returned result for that transaction, which gives you an explicit way to link results back to your own records. If you choose to rely on reference for correlation, make sure you send transaction.reference for every transaction in the batch. Otherwise, use the array index as the correlation key. If you want to offer your customers the ability to store their cards for faster checkout in the future, you must use CIT transactions. In such cases, you are required to provide a customerId when creating the payment. This ID links the stored card to the customer and enables quick-checkout functionality in future sessions. We recommend a minimum timeout of 10 seconds.