Skip to main content
This guide explains the Multi-Vending with Pre-Authorization flow. This method allows a customer to purchase multiple products in one session after a single initial payment approval. This streamlines the transaction by consolidating authorization into one initial step.

Payment Flow

The diagram below illustrates the complete sequence of events for a Multi-Vending with Pre-Authorization transaction.
Below is a breakdown of the diagram:
  1. The consumer presents the card to the Nayax Device.
  2. The Nayax Device sends an authorization request to the Nayax Server.
  3. The Nayax Server forwards the authorization request to the Billing Provider.
  4. The Billing Provider sends an authorization response (approved) to the Nayax Server.
  5. Nayax Server sends the authorization response (approved) back to the Nayax Device.
  6. The peripheral’s SDK begins the session and triggers the “session begin” event:
vmc_vend_event_handler_cb(vm_vend_event_on_session_begin)
  1. Message to the consumer: “Please Select a Product.”
  2. The consumer selects the desired product/s from the vending machine. Said products are being added to a list called “session”:
    session_products[0].code = 1;
    session_products[0] .qty = 1;
    session_products[0].price = 10;
    session_products[0].unit = 1;
    
    session_products[1].code = 2;
    session_products[1].qty = 1;
    session_products[1].price = 20;
    session_products[1].unit = 1;
    if (config.multi_vend_support)
    {
    	session->products = session_products;
      session->total_products = 2;
    }
    
  3. The peripheral’s SDK sends a “Multi Vend Request” to the Nayax Device:
    vmc_vend_vend_request(vend_session_t *session)
    
  4. The peripheral’s SDK handles transaction data received from the Nayax Device via Transfer Data (said data includes information about the Nayax transaction ID and the consumer’s card details):
vmc_vend_event_handler_cb(vm_vend_event_on_transaction_info)
  1. The peripheral’s SDK triggers the “vend approved” event:
vmc_vend_event_handler_cb(vm_vend_event_on_vend_approved)
  1. The peripheral dispenses the product/ provides the service to the consumer
  2. The SDK reports “vend success”:
vmc_vend_vend_status(&session, __true)

Note: in case of partial dispensing (meaning not all of the selected items were actually vended) you can create a new list with only the items which were actually vended prior to responding with “true”:
And completes the vending session:
C
vmc_vend_vend_session_complete_lowlevel()
C#
no such function in C# or Java due to the nature of the languages
Java
no such function in C# or Java due to the nature of the languages
  1. Message to the consumer: “Please Take Product.”
  2. Nayax Device sends a settlement request to the Nayax Server.
  3. Nayax Server forwards the settlement request to the Billing Provider.
  4. The billing Provider sends a settlement response (OK) to the Nayax Server.
  5. Nayax Server sends the settlement response (OK) back to the Nayax Device.
  6. The vending session ends.
  7. Message to Card Holder: “Thank you & Goodbye.”

See Also