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 VenueMappings
struct contains a venues
variable that will hold a list of VenueMap
:
public struct VenueMappings: Codable {
public var venues: [VenueMap]?
...
}
public struct VenueMap: Codable {
public var id: String?
public var externalRefId: String?
public var instance: String?
...
}
To retrieve the mappings and initialize once the appropriate map is found:
VenueNextWeb.shared.retrieveExternalVenueMapping(["K8vZ9171ou0", "K8vZ917f990"]) { venueMapping in
// Find the VenueMap that you want
if let first = venueMapping?.venues?.first(where: { venue in
venue.externalRefId == "K8vZ9171ou0"
}) {
print(first.instance)
print(first.externalRefId)
// Call relevant VN SDK initialization here
VenueNextWeb.shared.initialize(first.instance!)
}
}