Venue Manager shop API - Core
REST-interface for the Venue Manager shop platform.
This document describes the core endpoints.
Links to the other modules’ endpoints can be found at http://docs.api.venuemanager.net/.
Many endpoints requires a JSON Web Token for authorization. Please see the section Create token for information about how to get a token.
Demo endpoints ¶
A collection of simple endpoints demonstrating datatypes and errors.
integer ¶
integerGET/test/integer
Returns a simple integer.
Example URI
200Headers
Content-Type: application/jsonBody
42integerArray ¶
integerArrayGET/test/integerArray
Returns an array of integers.
Example URI
200Headers
Content-Type: application/jsonBody
[
1,
1,
2,
3,
5,
8,
13,
21,
34,
55,
89
]string ¶
stringGET/test/string
Returns a simple string.
Example URI
200Headers
Content-Type: application/jsonBody
"This result is a simple string value."object ¶
objectGET/test/object
Returns an object.
Example URI
200Headers
Content-Type: application/jsonBody
{
"id": "42",
"label": "exampleObject",
"days": [
"mon",
"tue",
"wed",
"thu",
"fri",
"sat",
"sun"
]
}noContent ¶
noContentGET/test/noContent
This endpoint has an empty response body.
Example URI
204forbidden ¶
forbiddenGET/test/forbidden
This endpoint always fails.
Errors are reported with 4xx or 5xx HTTP status codes and a body with information about the error.
Example URI
403Headers
Content-Type: application/jsonBody
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Configuration endpoints ¶
Address configuration ¶
Get address configurationGET/config/address?languageCode={languageCode}&addressType={addressType}
Get the address configuration for a customer.
Example URI
- languageCode
string(required) Example: daThe language the fields should be translated as. If missing, or unknown to the shop, the default language will be used
- addressType
string(optional) Example: season_cardLabel of the address type to get fields for. Default is “billing”.
Headers
Content-Type: application/json200Headers
Content-Type: application/jsonBody
[
{
"field": "firstname",
"type": "string",
"name": "Fornavn",
"url": "http://shop.venuemanager.net/side/privacy",
"required": true,
"optionalOnCreation": true,
"values": [
{
"value": "M",
"name": "Mand"
}
]
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Geofence configuration ¶
Get GeofencesGET/config/geofence?languageCode={languageCode}
Get configuration for all available Geofences for this shop.
Example URI
- languageCode
string(required) Example: daThe language the fields should be translated as. If missing, or unknown to the shop, the default language will be used
Headers
Content-Type: application/json200Headers
Content-Type: application/jsonBody
[
{
"id": 1,
"latitude": 56.131973,
"longitude": 10.193669,
"radius": 120,
"name": "Ceres Arena",
"topics": {
"inside": "/topic/agf/geofence_inside/1",
"outside": "/topic/agf/geofence_outside/1"
},
"messages": {
"in": {
"title": "Velkommen til VM Arena",
"body": "Velokmmen til VM Arena"
},
"out": {
"title": "Velkommen til VM Arena",
"body": "Velokmmen til VM Arena"
}
}
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Customer endpoints ¶
Customer ¶
Create customerPOST/customer
Creates a customer, and returns its ID and a token.
Example URI
Headers
Content-Type: application/jsonBody
{
"password": "Hello, world!",
"address": [
{
"field": "street",
"value": "Dannebrogsgade 58A"
}
],
"clientName": "VenueApp",
"clientOs": "iPhone"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"password": {
"type": "string"
},
"address": {
"type": "array"
},
"clientName": {
"type": "string",
"description": "Used by the server to identify the App in use"
},
"clientOs": {
"type": "string",
"description": "iOS - 12.0 (string, required) - Stored serverside to make it easier for the customer to distinguish his tokens in lists."
}
},
"required": [
"password",
"address",
"clientName"
]
}200Headers
Content-Type: application/jsonBody
{
"id": 17721,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w",
"customerId": 17721
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "ID of the token"
},
"token": {
"type": "string"
},
"customerId": {
"type": "number",
"description": "ID of the customer"
}
},
"required": [
"id",
"token",
"customerId"
]
}400Headers
Content-Type: application/jsonBody
{
"error": "Argument 'password' missing or empty.",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Get customerGET/customer/{customerId}?clientName={clientName}&clientOs={clientOs}
Returns username and address for the customer.
Example URI
- customerId
number(required) Example: 17721- clientName
string(required) Example: VenueAppUsed by the server to identify the App in use
- clientOs
string(required) Example: iPhoneiOS - 12.0 (string, required) - Stored serverside to make it easier for the customer to distinguish his tokens in lists.
Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w200Headers
Content-Type: application/jsonBody
{
"id": 17721,
"username": "sta@combine.dk",
"address": [
{
"field": "street",
"value": "Dannebrogsgade 58A"
}
],
"data": [
{
"label": "seasonRank",
"value": "Hello, world!"
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"username": {
"type": "string"
},
"address": {
"type": "array"
},
"data": {
"type": "array",
"description": "Object with various extra data for the customer"
}
},
"required": [
"id",
"username",
"address",
"data"
]
}Edit customerPOST/customer/{customerId}
Updates the customers address fields.
Example URI
- customerId
number(required) Example: 17721
Headers
Content-Type: application/jsonBody
{
"address": [
{
"field": "street",
"value": "Dannebrogsgade 58A"
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"address": {
"type": "array"
}
},
"required": [
"address"
]
}204Headers
Content-Type: application/json400Headers
Content-Type: application/jsonBody
{
"error": "Addressfield could not be updated.",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}401Headers
Content-Type: application/jsonBody
{
"error": "No customer logged in.",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Password ¶
Change passwordPOST/customer/updatePass
Change the password of the customer.
Example URI
Headers
Content-Type: application/jsonBody
{
"oldPassword": "Hello, world!",
"newPassword": "Hello, world!"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"oldPassword": {
"type": "string"
},
"newPassword": {
"type": "string"
}
},
"required": [
"oldPassword",
"newPassword"
]
}204Headers
Content-Type: application/json400Headers
Content-Type: application/jsonBody
{
"error": "Den gamle adgangskode er forkert",
"errorCode": 1001
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Reset passwordPOST/customer/resetpass
Sends a link to the customer e-mail for resetting their password.
Example URI
Headers
Content-Type: application/jsonBody
{
"username": "Hello, world!"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"username": {
"type": "string"
}
},
"required": [
"username"
]
}200Headers
Content-Type: application/jsonBody
{
"message": "Du vil snarest modtage et link per mail til at nulstille din adgangskode."
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}404Headers
Content-Type: application/jsonBody
{
"error": "Ukendt brugernavn.",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Customer Tokens ¶
The customer tokens are JSON Web Tokens. By utilizing customer tokens you can avoid storing the customer’s password in your application and still authorize as that customer against the API.
Create tokenPOST/customer/token
Creates a JSON Web Token (JWT) that can be used in subsequent calls to the API.
Example URI
Headers
Content-Type: application/jsonBody
{
"username": "alice@example.com",
"password": "Bob is cute",
"clientName": "VenueApp",
"clientOs": "iPhone"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
},
"clientName": {
"type": "string",
"description": "Used by the server to identify the App in use"
},
"clientOs": {
"type": "string",
"description": "iOS - 12.0 (string, required) - Stored serverside to make it easier for the customer to distinguish his tokens in lists."
}
},
"required": [
"username",
"password",
"clientName"
]
}200Headers
Content-Type: application/jsonBody
{
"id": 17721,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w",
"customerId": 17721
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "ID of the token"
},
"token": {
"type": "string"
},
"customerId": {
"type": "number",
"description": "ID of the customer"
}
},
"required": [
"id",
"token",
"customerId"
]
}400Headers
Content-Type: application/jsonBody
{
"error": "Argument 'username' missing or empty.",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}401Headers
Content-Type: application/jsonBody
{
"error": "Cannot login with supplied username and password.",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Validate tokenGET/customer/token
This endpoint can be used to check if a token is valid.
Example URI
Headers
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w204No content is returned when the token is valid.
401Headers
Content-Type: application/jsonBody
{
"error": "Invalid token",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Data token ¶
Create data tokenPOST/customer/dataToken
Creates a JSON Web Token (JWT) with extended payload. This token can also be used for subsequent calls to the API, but requires a simple bearer token to be created.
The payload contains the following extra fields:
-
name- The full name, if part of the billing address type -
given_name- The first name, if part of the billing address type -
family_name- The surname, if part of the billing address type -
email- Email -
phone_number- Mobile or phone number, if part of the billing address type -
season_rank- Highest card type rank
Example URI
Headers
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5wBody
{
"token": "Hello, world!"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"token": {
"type": "string"
}
},
"required": [
"token"
]
}200Headers
Content-Type: application/jsonBody
{
"id": 17721,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w",
"customerId": 17721
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "ID of the token"
},
"token": {
"type": "string"
},
"customerId": {
"type": "number",
"description": "ID of the customer"
}
},
"required": [
"id",
"token",
"customerId"
]
}401Headers
Content-Type: application/jsonBody
{
"error": "Invalid token",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Customer Push Tokens ¶
Set push tokenPOST/customer/pushToken
Set the token to be used for pushing notifications to the customer. Will overwrite any existing push tokens for that customer.
Example URI
Headers
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5wBody
{
"token": "Hello, world!"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"token": {
"type": "string"
}
},
"required": [
"token"
]
}204Guest Tokens ¶
Create guest tokenPOST/customer/guestToken
Creates a JSON Web Token (JWT) for a guest customer.
Example URI
Headers
Content-Type: application/jsonBody
{
"clientName": "VenueApp",
"clientOs": "iPhone"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"clientName": {
"type": "string",
"description": "Used by the server to identify the App in use"
},
"clientOs": {
"type": "string",
"description": "iOS - 12.0 (string, required)"
}
},
"required": [
"clientName"
]
}200Headers
Content-Type: application/jsonBody
{
"id": 17721,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w",
"customerId": 17721
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "ID of the token"
},
"token": {
"type": "string"
},
"customerId": {
"type": "number",
"description": "ID of the customer"
}
},
"required": [
"id",
"token",
"customerId"
]
}One-time tokens for customer login at shop frontend ¶
The one-time tokens can be used to allow a customer login in the shop frontend without entering username and password.
The default lifetime of a token is 60s.
URL’s for login is in the form:
<url>/?login_by_token=<token_value>
Create one-time tokenPOST/customer/onetimetoken
This endpoint generates and returns a token for login at the shop.
Note that is not the same token as for authorization in the API.
Example URI
Headers
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5wBody
{
"clientName": "VenueApp",
"clientOs": "iPhone"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"clientName": {
"type": "string",
"description": "Used by the server to identify the App in use"
},
"clientOs": {
"type": "string",
"description": "iOS - 12.0 (string, required) - Stored serverside to make it easier for the customer to distinguish his tokens in lists."
}
},
"required": [
"clientName"
]
}200Headers
Content-Type: application/jsonBody
{
"token": "2d0002947ce783aaea1a29d4c04bec5b066ac56f"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "Token for login at the shop"
}
}
}401Headers
Content-Type: application/jsonBody
{
"error": "Invalid token",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Customer anonymization ¶
Check if customer can be anonymizedGET/customer/anonymize{?clientName,clientOs}
Checks if the customer can be anonymized. If so the returned object will have canBeAnonymized set to true. If not, canBeAnonymized will be set to false, and reasons will contain an array of all reasons why anonymization is not allowed.
Example URI
- clientName
string(required) Example: VenueAppUsed by the server to identify the App in use
- clientOs
string(required) Example: iPhoneiOS - 12.0 (string, required)
Headers
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.z-9FNz-3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILH-5w200Headers
Content-Type: application/jsonBody
{
"canBeAnonymized": true,
"reasons": [
"Hello, world!"
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"canBeAnonymized": {
"type": "boolean"
},
"reasons": {
"type": "array"
}
}
}Anonymize customerPOST/customer/anonymize
Anonymize the customer, and everything related to it.
Example URI
Headers
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.z-9FNz-3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILH-5wBody
{
"clientName": "VenueApp",
"clientOs": "iPhone"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"clientName": {
"type": "string",
"description": "Used by the server to identify the App in use"
},
"clientOs": {
"type": "string",
"description": "iOS - 12.0 (string, required)"
}
},
"required": [
"clientName"
]
}204Headers
Content-Type: application/json400Headers
Content-Type: application/jsonBody
{
"error": "The customer cannot be anonymized for the following reasons: xxx",
"errorCode": 1000
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Customer payment cards ¶
Some payment service providers (eg QuickPay) allow the customer to register a payment card as a “saved card”. The saved card can then be used to authorize payments without requiring the customer to enter his card details again. This is useful for 1-click payments, subscriptions and payment in installments.
List payment cardsGET/customer/paymentcards?clientName={clientName}&clientOs={clientOs}
Returns the customer’s saved payment cards.
Example URI
- clientName
string(required) Example: VenueAppUsed by the server to identify the App in use
- clientOs
string(required) Example: iPhoneiOS - 12.0 (string, required) - Stored serverside to make it easier for the customer to distinguish his tokens in lists.
Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w200Headers
Content-Type: application/jsonBody
[
{
"id": 10,
"brand": "VISA",
"number": "100000...3333",
"expire_year": 2017,
"expire_month": 12
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Add new payment cardPOST/customer/paymentcards
Initiates the process of adding a new card for the given customer.
The server will return a URL to the Payment Service Provider’s website where the customer can enter his payment card details.
When the registration is completed the customer’s browser is redirected to one of the URLs supplied in the request. Upon success the parameter cardId=<integer> is added to successUrl.
Example URI
Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5wBody
{
"successUrl": "http://example.com/success",
"failedUrl": "http://example.com/argh",
"clientName": "VenueApp",
"clientOs": "iPhone"
}Schema
{
"type": "object",
"properties": {
"successUrl": {
"type": "string",
"description": "URL for redirect after successful registration of a new card.\n\n`cardId=<integer>` is added to URL."
},
"failedUrl": {
"type": "string",
"description": "URL for redirect when the registration fails."
},
"clientName": {
"type": "string",
"description": "Used by the server to identify the App in use"
},
"clientOs": {
"type": "string",
"description": "iOS - 12.0 (string, required) - Stored serverside to make it easier for the customer to distinguish his tokens in lists."
}
},
"required": [
"successUrl",
"failedUrl",
"clientName"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}201Headers
Location: https://payment.quickpay.net/cards/61f10da63a70e44d1e1614b052f7754fec8d5bf52ef44e0dcbc86c7db9f1aa19Customer Group endpoints ¶
Customer groups ¶
Get allGET/customergroup
Get all customer groups.
Example URI
200Headers
Content-Type: application/jsonBody
[
{
"id": 17721,
"name": "Sponsor",
"type": "normal"
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Order endpoints ¶
Orders ¶
Create orderPOST/order
Creates a new order for the customer.
Example URI
Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5wBody
{
"orderLines": [
{
"sellableId": 23,
"productId": 51,
"quantity": 5,
"date": "2019-02-19",
"properties": {
"name": "Fornavn Efternavn",
"email": "kunde@example.org",
"dateOfBirth": "2019-02-19",
"street": "Dannebrogsgade 58A",
"zipCode": "9000",
"city": "Aalborg",
"countryCode": "DK",
"imageId": 5823,
"oldCardId": 5823
}
}
],
"clientName": "VenueApp",
"clientOs": "iPhone"
}Schema
{
"type": "object",
"properties": {
"orderLines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"sellableId": {
"type": "number",
"description": "One of (sellableId|productId) is required."
},
"productId": {
"type": "number",
"description": "One of (sellableId|productId) is required."
},
"quantity": {
"type": "number"
},
"date": {
"type": "string",
"description": "The date to buy the product for. Only relevant for products with inventory per date"
},
"properties": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string"
},
"dateOfBirth": {
"type": "string"
},
"street": {
"type": "string"
},
"zipCode": {
"type": "string"
},
"city": {
"type": "string"
},
"countryCode": {
"type": "string"
},
"imageId": {
"type": "number"
},
"oldCardId": {
"type": "number",
"description": "Required when renewing a seasoncard"
}
}
}
},
"required": [
"quantity"
]
}
},
"clientName": {
"type": "string",
"description": "Used by the server to identify the App in use"
},
"clientOs": {
"type": "string",
"description": "iOS - 12.0 (string, required) - Stored serverside to make it easier for the customer to distinguish his tokens in lists."
}
},
"required": [
"orderLines",
"clientName"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}201Order created succesfully.
Headers
Location: https://customer.admin.venuemanager.net/api/core/order/{orderId}Body
{
"id": 65478,
"number": "AB1C2D3E"
}Schema
{
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "ID of the created order"
},
"number": {
"type": "string",
"description": "Number of the created order"
}
},
"required": [
"id",
"number"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}400Headers
Content-Type: application/jsonBody
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Order transactions ¶
All payment information for an order is stored in order transactions.
Most orders have only a single order transactions, but it is possible to have several.
Pay order with saved cardPOST/order/ordertransaction/savedcard/{cardId}
Pays an order with a saved card.
The order and the card must belong to the same customer.
Example URI
- cardId
number(required) Example: 123
Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w200Returns the order transaction ID
Headers
Content-Type: application/jsonBody
{
"id": 43
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
}
},
"required": [
"id"
]
}400Failed to pay the order
Headers
Content-Type: application/jsonBody
{
"error": "Rejected by acquirer",
"errorCode": 0
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Pay order with a payment methodPOST/order/ordertransaction
Initiates the process of paying for an order with a payment card or other method supported by the Payment Service Provider.
The server will return a URL to the Payment Service Provider’s website where the customer can perform the payment.
When the payment is completed the customer’s browser is redirected to one of the URLs supplied in the request.
Example URI
Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5wBody
{
"successUrl": "http://example.com/success",
"failedUrl": "http://example.com/argh",
"paymentMethod": "creditcard",
"clientName": "VenueApp",
"clientOs": "iPhone"
}Schema
{
"type": "object",
"properties": {
"successUrl": {
"type": "string",
"description": "URL to redirect to after succesful payment at the payment provider.\nIf this URL is the shop wait-page, it should include `order_number=<number>` from the response of `POST /order`."
},
"failedUrl": {
"type": "string",
"description": "URL for redirect when the registration fails."
},
"paymentMethod": {
"type": "string",
"description": "A Payment Service Provider specific string used to limit the possible payment methods.\n\nLinks to the PSPs' documentation:\n\n- [QuickPay](https://learn.quickpay.net/tech-talk/appendixes/payment-methods/)"
},
"clientName": {
"type": "string",
"description": "Used by the server to identify the App in use"
},
"clientOs": {
"type": "string",
"description": "iOS - 12.0 (string, required) - Stored serverside to make it easier for the customer to distinguish his tokens in lists."
}
},
"required": [
"successUrl",
"failedUrl",
"clientName"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}201This is the expected response. An amount remained to be payed and a new payment has been created. The newly created order transaction is returned.
Headers
Content-Type: application/json
Location: https://payment.quickpay.net/payments/96ff1de5be9a53eff51ea8bcfe12e553db697c7c67619efda4ca8d567d945535Body
{
"id": 43
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
}
},
"required": [
"id"
]
}200This response is used when the order is fully paid - ie an order of free items or already paid. All order transactions from the order are returned
Headers
Content-Type: application/jsonBody
[
{
"id": 43
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}product endpoints ¶
Categories ¶
CategoriesGET/catalog/categories?languageCode={languageCode}
Returns a list of categories.
Example URI
- languageCode
string(optional) Default: 'da'The language code for response, default is shop default language.
200Headers
Content-Type: application/jsonBody
[
{
"id": 8,
"name": "Årskort",
"label": "aarskort",
"appData": {
"header": "Årskort",
"description": "Årskort til hele året",
"image": "https://image.experimentarium.dk/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/api/%C3%85rskort%20Senior.png"
}
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Products ¶
ProductsGET/catalog/products/?languageCode={languageCode}&productType={productType}
Example URI
- languageCode
string(optional)The language code for response, default is shop default language.
- productType
string(optional)If supplied, find only products of this type
200Headers
Content-Type: application/jsonBody
[
{
"id": 3,
"name": "Årskort 2019",
"label": "aarskort2019",
"productType": "seasoncard",
"priceInclVat": 685,
"vat": 137,
"currencyCode": "DKK",
"hasInventoryPerDate": false,
"appData": {
"header": "Årskort",
"description": "Årskort til hele året",
"image": "https://image.experimentarium.dk/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/api/%C3%85rskort%20Senior.png"
},
"properties": {
"seasonCardIsBuyable": "1",
"seasonCardIsRenewable": "0"
}
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Product ¶
ProductGET/catalog/product/?languageCode={languageCode}
Example URI
- languageCode
string(optional)The language code for response, default is shop default language.
200Headers
Content-Type: application/jsonBody
{
"id": 3,
"name": "Årskort 2019",
"label": "aarskort2019",
"productType": "seasoncard",
"priceInclVat": 685,
"vat": 137,
"currencyCode": "DKK",
"hasInventoryPerDate": false,
"appData": {
"header": "Årskort",
"description": "Årskort til hele året",
"image": "https://image.experimentarium.dk/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/api/%C3%85rskort%20Senior.png"
},
"properties": {
"seasonCardIsBuyable": "1",
"seasonCardIsRenewable": "0"
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"productType": {
"type": "string"
},
"priceInclVat": {
"type": "number"
},
"vat": {
"type": "number"
},
"currencyCode": {
"type": "string"
},
"hasInventoryPerDate": {
"type": "boolean",
"description": "If true, then a date must be selected when ordering this product"
},
"appData": {
"type": "object",
"properties": {
"header": {
"type": "string"
},
"description": {
"type": "string"
},
"image": {
"type": [
"string",
"null"
]
}
},
"required": [
"header",
"description",
"image"
]
},
"properties": {
"type": "object",
"properties": {
"seasonCardIsBuyable": {
"type": "string",
"description": "Is the seasoncard buyable"
},
"seasonCardIsRenewable": {
"type": "string",
"description": "Is the product for renewing seasoncards"
}
}
}
},
"required": [
"id",
"name",
"label",
"productType",
"priceInclVat",
"vat",
"currencyCode",
"hasInventoryPerDate"
]
}Invoice endpoints ¶
Invoices ¶
Get invoicesGET/invoice?afterNumber={afterNumber}&limit={limit}&format={format}
Get a list of invoices, from after_number (excl.) and limit ahead.
Requires HTTP authentication (for an API-user in the shop).
Example URI
- afterNumber
number(optional) Example: 65478- limit
number(optional) Example: 10- format
string(optional) Example: xmlEither json (default) or xml
Headers
Authorization: Basic ZnNfamNkOjEyM3Rlc3Q=200Returns an array of invoices in JSON format.
Headers
Content-Type: application/jsonBody
[
{
"id": 12345,
"number": 12345,
"orderId": 12345,
"type": "invoice",
"date": "2019",
"totalAmount": 4200.5,
"totalDiscount": 0,
"totalVat": 840.1,
"currencyCode": "DKK",
"customer": {
"id": 1234,
"number": "12341234",
"name": "xyz",
"street": "xyz",
"company": "xyz",
"zipCode": "xyz",
"city": "xyz",
"country": "xyz",
"email": "xyz",
"mobile": "xyz",
"phone": "xyz"
},
"deliveryAddress": {
"name": "xyz",
"street": "xyz",
"company": "xyz",
"zipCode": "xyz",
"city": "xyz",
"country": "xyz"
},
"lines": [
{
"id": 1234,
"type": "admission",
"quantity": 2,
"amount": 100,
"discount": 50,
"vatPercentage": 25,
"totalAmount": 150,
"sku": "XYZ",
"numbers": [
12340000,
12340001
],
"eventId": 123,
"eventName": "Gryffindor - Slytherin",
"seasonId": 3,
"seasonName": "2019/2020"
}
]
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}200Returns an array of invoices in XML format.
Headers
Content-Type: application/xmlBody
[
{
"id": 12345,
"number": 12345,
"orderId": 12345,
"type": "invoice",
"date": "2019",
"totalAmount": 4200.5,
"totalDiscount": 0,
"totalVat": 840.1,
"currencyCode": "DKK",
"customer": {
"id": 1234,
"number": "12341234",
"name": "xyz",
"street": "xyz",
"company": "xyz",
"zipCode": "xyz",
"city": "xyz",
"country": "xyz",
"email": "xyz",
"mobile": "xyz",
"phone": "xyz"
},
"deliveryAddress": {
"name": "xyz",
"street": "xyz",
"company": "xyz",
"zipCode": "xyz",
"city": "xyz",
"country": "xyz"
},
"lines": [
{
"id": 1234,
"type": "admission",
"quantity": 2,
"amount": 100,
"discount": 50,
"vatPercentage": 25,
"totalAmount": 150,
"sku": "XYZ",
"numbers": [
12340000,
12340001
],
"eventId": 123,
"eventName": "Gryffindor - Slytherin",
"seasonId": 3,
"seasonName": "2019/2020"
}
]
}
]Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "VM ID"
},
"number": {
"type": "number",
"description": "Unique identifier (used for the after_number in requests)"
},
"orderId": {
"type": "number",
"description": "VM ID"
},
"type": {
"type": "string",
"description": "Either 'invoice' or 'credit_note'"
},
"date": {
"type": "string",
"description": "01-17 (string, required)"
},
"totalAmount": {
"type": "number",
"description": "Includes both vat and discount"
},
"totalDiscount": {
"type": "number",
"description": "Includes vat"
},
"totalVat": {
"type": "number"
},
"currencyCode": {
"type": "string"
},
"customer": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "VM ID"
},
"number": {
"type": "string",
"description": "Address field (NAV customer number)"
},
"name": {
"type": "string",
"description": "Address field"
},
"street": {
"type": "string",
"description": "Address field"
},
"company": {
"type": "string",
"description": "Address field"
},
"zipCode": {
"type": "string",
"description": "Address field"
},
"city": {
"type": "string",
"description": "Address field"
},
"country": {
"type": "string",
"description": "Address field"
},
"email": {
"type": "string",
"description": "Address field"
},
"mobile": {
"type": "string",
"description": "Address field"
},
"phone": {
"type": "string",
"description": "Address field"
}
},
"required": [
"id"
]
},
"deliveryAddress": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Address field"
},
"street": {
"type": "string",
"description": "Address field"
},
"company": {
"type": "string",
"description": "Address field"
},
"zipCode": {
"type": "string",
"description": "Address field"
},
"city": {
"type": "string",
"description": "Address field"
},
"country": {
"type": "string",
"description": "Address field"
}
}
},
"lines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "VM ID"
},
"type": {
"type": "string"
},
"quantity": {
"type": "number"
},
"amount": {
"type": "number",
"description": "Price per pcs, includes vat"
},
"discount": {
"type": "number",
"description": "Discount for the whole line, includes vat"
},
"vatPercentage": {
"type": "number"
},
"totalAmount": {
"type": "number",
"description": "Total price for the whole line (quantity * amount - discount)"
},
"sku": {
"type": "string",
"description": "NAV SKU"
},
"numbers": {
"type": "array",
"items": {
"type": "number"
},
"description": "Ticket or Season card \"IDs\""
},
"eventId": {
"type": "number",
"description": "ID of the event for the ticket"
},
"eventName": {
"type": "string",
"description": "Name of the event for the ticket"
},
"seasonId": {
"type": "number",
"description": "ID of the season for the ticket event og season ticket"
},
"seasonName": {
"type": "string",
"description": "Name of the season for the ticket event or season ticket"
}
},
"required": [
"id",
"type",
"quantity",
"amount",
"discount",
"vatPercentage",
"totalAmount"
]
}
}
},
"required": [
"id",
"number",
"orderId",
"type",
"totalAmount",
"totalDiscount",
"totalVat",
"currencyCode",
"customer",
"lines"
]
},
"description": "<invoices>\n <invoice>\n <id>12345</id>\n <number>12345</number>\n <orderId>12345</orderId>\n <type>invoice</type>\n <date>2019-01-17</date>\n <totalAmount>4200.5</totalAmount>\n <totalDiscount>0.0</totalDiscount>\n <totalVat>840.1</totalVat>\n <currencyCode>DKK</currencyCode>\n <customer>\n <id>1234</id>\n <number>12341234</number>\n <name>xyz</name>\n <street>xyz</street>\n <company>xyz</company>\n <zipCode>xyz</zipCode>\n <city>xyz</city>\n <country>xyz</country>\n <email>xyz</email>\n <mobile>xyz</mobile>\n <phone>xyz</phone>\n </customer>\n <deliveryAddress>\n <name>xyz</name>\n <street>xyz</street>\n <company>xyz</company>\n <zipCode>xyz</zipCode>\n <city>xyz</city>\n <country>xyz</country>\n </deliveryAddress>\n <lines>\n <line>\n <id>1234</id>\n <type>admission</type>\n <quantity>2</quantity>\n <amount>100.0</amount>\n <discount>50.0</discount>\n <vatPercentage>25.0</vatPercentage>\n <totalAmount>150.0</totalAmount>\n <sku>XYZ</sku>\n <numbers>\n <number>123450000</number>\n <number>123450001</number>\n </numbers>\n </line>\n <line>\n <id>1234</id>\n <type>seasonCard</type>\n <quantity>1</quantity>\n <amount>800.0</amount>\n <discount>0.0</discount>\n <vatPercentage>25.0</vatPercentage>\n <totalAmount>800.0</totalAmount>\n <sku>XYZ</sku>\n <numbers>\n <number>12346</number>\n </numbers>\n </line>\n <line>\n <id>1234</id>\n <type>product</type>\n <quantity>2</quantity>\n <amount>20.0</amount>\n <discount>0.0</discount>\n <vatPercentage>25.0</vatPercentage>\n <totalAmount>40.0</totalAmount>\n <sku>XYZ</sku>\n </line>\n </lines>\n </invoice>\n</invoices>",
"$schema": "http://json-schema.org/draft-04/schema#"
}400format is not valid. Must be json or xml.
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}401Unauthorized.
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}404afterNumber is not a known invoice.
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}Invoice payment status ¶
Mark invoice as paidPUT/invoice/markAsPaidByExternalId/{externalId}
Marks the invoice as paid.
Requires HTTP authentication (for an API-user in the shop).
Example URI
- externalId
string(required) Example: DG817The external ID returned when the invoice was exported.
Headers
Authorization: Basic ZnNfamNkOjEyM3Rlc3Q=204401Unauthorized.
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}404The supplied externalId is not known.
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}406The supplied externalId does not uniquely identify an invoice.
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}Loyalty endpoints ¶
Loyalty barcodes
Register usage ¶
Register usagePOST/loyalty/barcode/registerUsage
Register usage of a loyalty barcode.
Example URI
Headers
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5wBody
{
"clientName": "VenueApp",
"clientOs": "iPhone - iOS - 12.0",
"code": "XYZ1234"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"clientName": {
"type": "string",
"description": "Used by the server to identify the App in use"
},
"clientOs": {
"type": "string"
},
"code": {
"type": "string",
"description": "The code to register"
}
},
"required": [
"clientName",
"clientOs",
"code"
]
}200Headers
Content-Type: application/jsonBody
{
"points": 12
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"points": {
"type": "number",
"description": "Number of points given for usage."
}
},
"required": [
"points"
]
}400Headers
Content-Type: application/jsonBody
{
"error": "Argument \"code\" missing or empty.",
"errorCode": 1984
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}403Can be one of the following errors: 1001: Loyalty barcode no longer valid 1002: Loyalty barcode already used
Headers
Content-Type: application/jsonBody
{
"error": "Loyalty barcode no longer valid",
"errorCode": "1001"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "string",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}404Headers
Content-Type: application/jsonBody
{
"error": "Unknown loyalty barcode: XYZ1234",
"errorCode": "1000"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "string",
"description": "A code, often 0."
}
},
"required": [
"error"
]
}Voucher endpoints ¶
Voucher codes
Get voucher code ¶
Get voucher codeGET/voucher/code?code=
Get info about a voucher code, by its code value
Example URI
Headers
Content-Type: application/json or application/xml
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w200Body
{
"id": 123,
"voucherId": 120,
"code": "XYZ1234",
"isValid": true,
"message": "Rabatkoden er allerede brugt",
"creationPrice": {
"amount": 100,
"discount": 0,
"vatPercentage": 25,
"currencyCode": "DKK"
}
}Schema
{
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "VM ID for the code (used for redeeming)"
},
"voucherId": {
"type": "number",
"description": "VM ID for the voucher"
},
"code": {
"type": "string"
},
"isValid": {
"type": "boolean"
},
"message": {
"type": "string",
"description": "Error message if the voucher code isn't valid"
},
"creationPrice": {
"type": "object",
"properties": {
"amount": {
"type": "number",
"description": "Price, including VAT"
},
"discount": {
"type": "number",
"description": "Discount given on the line, including VAT"
},
"vatPercentage": {
"type": "number"
},
"currencyCode": {
"type": "string"
}
},
"required": [
"amount",
"discount",
"vatPercentage",
"currencyCode"
],
"description": "Price if the code were created by buying a product"
}
},
"required": [
"id",
"voucherId",
"code",
"isValid"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}400Missing voucher code value
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}404Unknown voucher code
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}Redeem voucher code ¶
Redeem voucher codePOST/voucher/code/redeem
Redeem a voucher without an order (set it as used).
Example URI
Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkZXZlbG9wbWVudF9hZ2YiLCJpYXQiOjE0ODkwNzIyNjAsImp0aSI6Nn0.zX9FNzX3twoxqy_E06Q1ryQO_VHHxK5710Fe9ILHX5w204400Missing voucher code ID
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}403Voucher code already redeemed
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}404Unknown voucher code
Body
{
"error": "Winston writes in his forbidden diary.",
"errorCode": 1984
}Schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Textual description of the error."
},
"errorCode": {
"type": "number",
"description": "A code, often 0."
}
},
"required": [
"error"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}