Skip to main content
The /initialize endpoint is the first step in processing an e-commerce transaction within the Nayax system. Its primary function is to initiate a payment request from the Nayax SDK, essentially setting the stage for a customer to complete their purchase.
TokenizationThe /initialize endpoint is also part of the process for tokenizing a card. If a Card-on-File (COF) initialization is triggered, the eCom API will respond with a Nayax card token to the Nayax SDK. See Nayax Tokens for more details.

Sale Request

Here is an example of a JSON request for the POST /initialize endpoint, demonstrating a simple sale transaction.
{
  "BasicInfo": {
    "SessionExpiration": "2025-08-15T10:00:00Z",
    "RedirectURL": "https://www.examplemerchant.com/return",
    "Amount": 1500,
    "DecimalPlace": 2,
    "Currency": "USD",
    "Country": "US",
    "RequestType": 0,
    "EntryMode": "ECOM",
    "MachineId": "0434334921100366"
  },
  "MachineInfo": {
    "CardholderCountry": "US"
  },
  "CardHolderInfo": {
    "PaymentPageLan": "en",
    "CardholderEmail": "customer@example.com"
  },
  "eReceipt data": {
    "AdditionalReceiptData": "[{\"key\":\"orderNumber\",\"value\":\"12345\"}]"
  }
}
For more details on each parameter, see the /initialize endpoint API reference page.

Transaction Type

The RequestType parameter specifies the type of transaction to be performed. Different values apply to different endpoints. Use codes 01 when calling /initialize. Use codes 28 when calling /close-transaction.

/initialize request types

The table below displays the RequestType codes accepted by the /initialize endpoint.
CodeTransaction TypeDescription
0SaleAuthorizes and captures funds in a single step. Used for immediate, complete purchases.
1Auth (Authorization)Reserves funds on the card without capturing them. Used to place a hold before a final amount is known.

/close-transaction request types

The table below displays the RequestType codes accepted by the /close-transaction endpoint. These are second-step operations that act on an existing authorized transaction.
CodeTransaction TypeDescription
2SettlementCaptures previously authorized funds, finalizing the transaction.
3VoidCancels a transaction before it has been settled.
4RefundReturns funds to the customer after a sale has been completed.
5Partial RefundReturns a portion of the original transaction amount to the customer.
6Incremental AuthIncreases the amount on an existing pre-authorization. Must reference the original transactionId and transactionTimeUtc. The amount field must contain the new total, not the delta.
7Cancel AuthCancels a pre-authorized transaction, releasing the held funds.
8Partial CaptureCaptures a portion of the pre-authorized amount rather than the full amount.
Codes 28 are not valid on /initialize. Sending them to /initialize will not perform the intended operation. Always use POST /close-transaction for second-step operations. See the request samples for full examples.

Nayax Tokens

Webhook Notifications