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

Physical Sale

Test this endpoint live

Open the same request directly in API Explorer.

Open in API Explorer

Server URL

POST
/public/api/v1/sale

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Header Parameters

Idempotency-Keystring

Request Body

application/json

Physical sale request payload.

TypeScript Definitions

Use the request body type in TypeScript.

nullnever

Physical sale data used to create the terminal transaction.

pointOfSaleIdstring
Required

The ID of the Softpay point of sale to associate the physical sale with.

Format:
uuid
Example:
"01924737-9c18-71c0-ab1a-88698eaceabf"
typestring
Nullable

The transaction type to process. Use PAYMENT for purchases and PAYOUT for refunds. Defaults to PAYMENT if not given.

Note that PAYOUT requires the feature to be enabled by SoftPay.

Default:
"PAYMENT"
Possible values:
"PAYMENT""PAYOUT"
Example:
"PAYMENT"
amountinteger
Required

The amount must be defined in minor units. E.g. 2,50 DKK must be set as 250.

Example:
1000
currencystring
Required

The currency code of the payment. For Danish Kroner defined as DKK. ISO 4217 alpha-3 (e.g., DKK)

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

The URL to receive the webhook with the final transaction result.

Format:
uri
Length:
length <= 1024
Example:
"https://example.com/notification"
referencestring
Nullable

This is the transaction reference, similar to an order ID.
The reference SHOULD be unique for each payment, as some acquirers enforce per-payment uniqueness.
Using a duplicate reference may result in failed payments or make reconciliation difficult.
Only ASCII alphanumeric characters and dashes are allowed.

Match:
^[A-Za-z0-9-]{1,36}$
Length:
1 <= length <= 36
Example:
"store-sale-1"

A list of pass through attributes that is sent back to the merchant on webhooks. Max size is 1kb.

Example:
{ "orderId": "order-123", "cashRegisterId": "register-7" }
customerIdstring
Nullable

An optional merchant defined customer id used to uniquely identify a user in the merchant system.

Example:
"User159"

Customer info associated with the sale. It is recommended to send all the info that is available.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/public/api/v1/sale" \  -H "Idempotency-Key: c4f5e8d2-1234-5678-90ab-cdef12345678" \  -H "Content-Type: application/json" \  -d '{    "transaction": {      "pointOfSaleId": "01924737-9c18-71c0-ab1a-88698eaceabf",      "amount": 1000,      "currency": "DKK",      "notificationUrl": "https://example.com/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"}