Venue Mappings

VenueNext SDK 2.0.x External Venue Mappings

The following displays how to retrieve external venue mappings to OrderNext isntances via the external reference IDs that have been set for you as an integrator.

Once mappings are retrieved, a VenueMap can be searched for based off the external reference IDs that have been established for you.

This functionality is primarily used for integrators that want to be able to switch to different organizations/venues within the same application deployment and generally isn’t needed for individual Organization applications.

VenueMappings

The VenueMapping data class contains a venues variable that will hold a list of VenueMap:

@Serializable
data class VenueMapping (
  @SerialName("venues")
  var venues: List<VenueMap>? = emptyList<VenueMap>()
)

@Serializable
data class VenueMap (
  @SerialName("id")
  var id: String? = null,

  @SerialName("external_ref_id")
  var externalRefId: String? = null,

  @SerialName("ordernext_url")
  var instance: String? = null
)

To retrieve the mappings and initialize once the appropriate map is found:

VenueNextWeb.retrieveExternalVenueMapping(this, listOf("K8vZ9171ou0", "K8vZ917f990")) { venueMapping ->
  // Find the VenueMap that you want
  val first = venueMapping.venues?.find {
    it.externalRefId == "K8vZ9171ou0"
  }

  if (first != null) {
    Log.i("VNDemoApp", first.externalRefId)
    Log.i("VNDemoApp", first.instance)
    // Call relevant VN SDK initialization here
    VenueNextWeb.initialize(first.instance!!)
  }
}

Updated: