| POST | /cmd/locations |
|---|
const std = @import("std");
pub const Ref = struct {
id: ?[]const u8 = null,
val: ?[]const u8 = null,
};
pub const RefEx = struct {
id: ?[]const u8 = null,
val: ?[]const u8 = null,
data: ?RecordDictionary = null,
};
pub const GPSCoordinates = struct {
lat: f64 = 0,
lng: f64 = 0,
};
pub const Address = struct {
street: ?[]const u8 = null,
city: ?[]const u8 = null,
state: ?[]const u8 = null,
postalCode: ?[]const u8 = null,
country: ?Ref = null,
gps: ?GPSCoordinates = null,
data: ?RecordDictionary = null,
};
pub const DeviceUsageMode = enum(i32) {
ClerkServiced = 0,
Personal = 1,
SelfService = 2,
Unknown = -1,
};
pub const DeviceUserInterface = enum(i32) {
Tablet = 0,
Kiosk = 1,
Default = 2,
Unknown = -1,
};
pub const DeviceManagement = enum(i32) {
Partner = 1,
Platform = 2,
};
pub const DeviceProfile = struct {
usageMode: ?DeviceUsageMode = null,
userInterface: ?DeviceUserInterface = null,
wallet: ?Ref = null,
managedBy: ?DeviceManagement = null,
};
pub const Device = struct {
id: ?[]const u8 = null,
name: ?[]const u8 = null,
isActive: bool = false,
profile: ?DeviceProfile = null,
integrationsData: ?RecordDictionary = null,
};
pub const ProductReference = struct {
id: ?[]const u8 = null,
value: ?[]const u8 = null,
category: ?[]const u8 = null,
productProvider: ?Ref = null,
};
pub const ProductInstanceRef = struct {
id: ?[]const u8 = null,
name: ?[]const u8 = null,
title: ?[]const u8 = null,
product: ?ProductReference = null,
};
pub const Locale = struct {
timeZone: ?Ref = null,
currency: ?Ref = null,
language: ?Ref = null,
};
pub const OpenLocation = struct {
id: ?[]const u8 = null,
name: ?[]const u8 = null,
organization: ?RefEx = null,
region: ?Ref = null,
group: ?Ref = null,
address: ?Address = null,
devices: ?[]Device = null,
productInstances: ?[]ProductInstanceRef = null,
locale: ?Locale = null,
integrationsData: ?std.json.Value = null,
};
pub fn RecordDictionary(comptime TKey: type, comptime TVal: type) type {
_ = TKey;
_ = TVal;
return struct {};
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /cmd/locations HTTP/1.1
Host: api.bettor.webhop.biz
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: String,
name: String,
organization:
{
data:
{
String: String
},
id: String,
val: String
},
region:
{
id: String,
val: String
},
group:
{
id: String,
val: String
},
address:
{
street: String,
city: String,
state: String,
postalCode: String,
country:
{
id: String,
val: String
},
gps:
{
lat: 0,
lng: 0
},
data:
{
String: String
}
},
devices:
[
{
id: String,
name: String,
isActive: False,
profile:
{
usageMode: 0,
userInterface: 0,
wallet:
{
id: String,
val: String
},
managedBy: 0
},
integrationsData:
{
String: String
}
}
],
productInstances:
[
{
id: String,
name: String,
title: String,
product:
{
id: String,
value: String,
category: String,
productProvider:
{
id: String,
val: String
}
}
}
],
locale:
{
timeZone:
{
id: String,
val: String
},
currency:
{
id: String,
val: String
},
language:
{
id: String,
val: String
}
},
integrationsData:
{
String: String
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}