Skip to main content
With the Multi-Vending flow, your machine can dispense multiple products (up to 20, as of 4.0.25.9 and above, up to 40) in a single transaction and provide differentiation for each product in the SDK. Customers first select all of their desired products, then present their payment card. Upon authorization, the vending machine dispenses the selected products, and the session is settled and completed with an appropriate message.

Payment Flow

The diagram below illustrates the complete sequence of events for a Multi-Vending transaction.
Here’s a breakdown of the diagram:
  1. The Nayax Device sends a 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 vending request to the Nayax Device:
    vmc_vend_vend_request(vend_session_t *session)
    
  4. The Nayax Device sends a message to the consumer: “Please Present Card.”
  5. The consumer presents their payment card.
  6. The Nayax Device sends an authorization request to the Nayax Server.
  7. The Nayax Server forwards the authorization request to the Billing Provider.
  8. The Billing Provider sends an authorization response (approved) to the Nayax Server.
  9. The Nayax Server sends the authorization response (approved) back to the Nayax Device.
  10. 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)
    
  11. The SDK triggers “Vend Approved” events:
    vmc_vend_event_handler_cb(vm_vend_event_on_vend_approved)
    
  12. The peripheral dispenses the product/s to the consumer.
  13. 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:
    vmc_vend_vend_session_complete_lowlevel()
    
  14. Message to the consumer: “Please Take Product.”
  15. The Nayax Device sends a settlement request to the Nayax Server.
  16. The Nayax Server forwards the settlement request to the Billing Provider.
  17. The Billing Provider sends a settlement response (OK) to the Nayax Server.
  18. The Nayax Server returns the settlement response (OK) to the Nayax Device.
  19. The vending session ends.
  20. Message to Card Holder: “Thank you & Goodbye.”

See Also