Payments
Payments
The cashier interface is a web page displayed to the customer when a new payment is initiated. Currently, the cashier interface must be displayed in a dedicated window by redirecting the user to the URL retrieved from the API.
Initiating a payment
To initiate a payment, the merchant must call the /init-payment endpoint with the following fields in the request body (as JSON):
Request Fields
| Field | Type | Description | Required |
|---|---|---|---|
amount | string | The amount to be paid. Must be a valid monetary value as described in Handling Monetary Values. | Yes |
currency | string | The currency of the payment (e.g., EUR, USD). | Yes |
nationalIdentificationNumber | string | The customer’s national identification number. | Optional |
merchantDomain | string | The merchant’s domain where the payment status will be sent. | Yes |
successPath | string | Path on the merchant’s domain to be called when the payment is successful. | Yes |
failurePath | string | Path on the merchant’s domain to be called when the payment fails. | Yes |
closePath | string | Path on the merchant’s domain to be called when the customer prematurely closes the payment. | Yes |
countryCode | string | The customer’s country code in ISO 3166-1 alpha-2 format. | Yes |
merchantReference | string | A unique reference used by the merchant to identify the payment. | Yes |
endUserToken | string | A token used to identify the customer for subsequent payments. | Optional |
requireMerchantConfirmation | boolean | A boolean indicating whether to send Merchant Confirmation Notifications for this payment | Optional |
notificationUrl | string | A URL for notifying the merchant of the payment status. See Notifications. | Optional |
quickDeposit | boolean | A boolean indicating whether to skip the account selection step, enabling quick deposit functionality. | Optional |
Successful Response
If the payment is successfully initiated, the API will respond with the following fields:
| Field | Description |
|---|---|
clientUrl | The URL to redirect the customer to for initiating the payment. |
endUserToken | A unique token to identify the customer for future payments. |
Note: In case of an error, refer to the Errors section for details on error codes and handling.
Example Request
Below is an example of initiating a payment using curl with mutual TLS (mTLS):
$ curl --cacert krofort-root-ca.pem \
--cert your-certificate.crt \
--key private.key \
-XPOST "https://merchant.a.krofort.com/init-payment" \
--header "Content-Type: application/json" \
--data-binary @- << EOF
{
"amount": "100.00",
"currency": "EUR",
"psuId": "197001016653",
"merchantDomain": "example.org",
"successPath": "/success",
"failurePath": "/failure",
"closePath": "/close",
"countryCode": "SE",
"merchantReference": "1234567890",
"endUserToken": "<end-user-token>",
"notificationUrl": "https://example.org/callback"
}
EOFExample response:
{
"clientUrl": "https://pay.a.krofort.com/?ts=...",
"endUserToken": "kaLLU0smNESVWjOPrOtE_DWOY9A4kVQlwfQaXrTQBVNEcn_w"
}