Skip to content

Instantly share code, notes, and snippets.

@icholy
Created August 16, 2021 20:24
Show Gist options
  • Save icholy/34b70ec3836046f27c09dad694abcb23 to your computer and use it in GitHub Desktop.
Save icholy/34b70ec3836046f27c09dad694abcb23 to your computer and use it in GitHub Desktop.
{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"swagger": "2.0",
"info": {
"description": "CDL microservices",
"title": "Compass Digital Services",
"contact": {},
"version": "0.0.3"
},
"host": "api.compassdigital.org",
"basePath": "/staging",
"paths": {
"/brand": {
"get": {
"responses": {
"200": {
"description": "",
"schema": {
"type": "object",
"properties": {
"brands": {
"type": "array",
"items": {
"$ref": "#/definitions/Brand"
}
}
}
}
}
}
}
},
"/brand/{id}": {
"get": {
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/Brand"
}
}
}
}
},
"/location": {
"get": {
"tags": [
"location"
],
"summary": "Get all location",
"operationId": "get_locations",
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Locations"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"post": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Create a new location",
"operationId": "create_location",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Location"
}
}
],
"responses": {
"200": {
"description": "Create location response",
"schema": {
"$ref": "#/definitions/Location"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Record not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/brand": {
"post": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Create a new Brand",
"operationId": "create_brand",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Brand"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Brand"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/brand/{id}": {
"get": {
"security": [
{
"bearerAuth": []
},
{}
],
"tags": [
"location"
],
"summary": "Get location brand",
"operationId": "get_brand",
"parameters": [
{
"type": "boolean",
"description": "If true, includes brand public/private configs into response. Auth should be provided.",
"name": "include_config",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "show additional hidden properties/entities",
"name": "extended",
"in": "query"
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Brand"
},
"x-cache-control": "max-age=60,stale-while-revalidate=3600"
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Could not find that brand",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Update location brand",
"operationId": "update_brand",
"parameters": [
{
"type": "string",
"description": "brand id",
"name": "id",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Brand"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Brand"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"delete": {
"security": [
{
"bearerAuth": []
}
],
"description": "If there is a body, then it will remove that data.",
"tags": [
"location"
],
"summary": "Delete data from a Brand",
"operationId": "delete_brand",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Brand"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Brand"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Update location brand",
"operationId": "patch_brand",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Brand"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Brand"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"description": "Brand ID",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/brand/{id}/deliverydestinations": {
"get": {
"tags": [
"location"
],
"summary": "Get delivery destinations for a brand",
"operationId": "get_brand_destinations",
"responses": {
"200": {
"description": "Get brand delivery destinations response",
"schema": {
"$ref": "#/definitions/DeliveryDestinationIDs"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/BadRequest"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "Brand ID",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/brand/{id}/document": {
"post": {
"tags": [
"location",
"document"
],
"summary": "Attach document to a brand",
"operationId": "post_location_brand_document",
"parameters": [
{
"name": "post_body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"document": {
"description": "base64 string",
"type": "string"
},
"document_name": {
"type": "string",
"example": "file_name"
},
"document_type": {
"type": "string",
"example": "signed_contract"
}
}
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/BrandDocumentsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"delete": {
"tags": [
"location",
"document"
],
"summary": "Deleted brand document",
"operationId": "delete_location_brand_document",
"responses": {
"200": {
"description": "Status 200",
"schema": {
"type": "object",
"properties": {
"deleted_document": {
"$ref": "#/definitions/BrandDocument"
}
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"tags": [
"location",
"document"
],
"summary": "Edit location document",
"operationId": "patch_location_brand_document",
"responses": {
"200": {
"description": "Status 200",
"schema": {
"type": "object",
"properties": {
"document": {
"$ref": "#/definitions/BrandDocument"
}
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "Brand ID",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/brand/{id}/documents": {
"get": {
"tags": [
"location",
"document"
],
"summary": "Get location brand attached documents",
"operationId": "get_location_brand_documents",
"responses": {
"200": {
"description": "Get brand attached documents",
"schema": {
"$ref": "#/definitions/BrandDocumentsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "Brand ID",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/brand/{id}/timeslots": {
"get": {
"tags": [
"location"
],
"summary": "Get location brand timeslots",
"operationId": "get_brand_timeslots",
"parameters": [
{
"type": "number",
"description": "Get the pickup timeslots after this date within the business hours of the location",
"name": "date",
"in": "query"
},
{
"type": "number",
"description": "Limit the number of timeslots returned",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "Get brand timeslots response",
"schema": {
"$ref": "#/definitions/TimeSlots"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/BadRequest"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "Brand ID",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/brand/{id}/timeslots/delivery": {
"get": {
"tags": [
"location"
],
"summary": "Get location brand delivery timeslots",
"operationId": "get_brand_delivery_timeslots",
"parameters": [
{
"type": "number",
"description": "Get the delivery timeslots after this date within the business hours of the location",
"name": "date",
"in": "query"
},
{
"type": "number",
"description": "Limit the number of timeslots returned",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "Get brand delivery timeslots response",
"schema": {
"$ref": "#/definitions/TimeSlots"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/BadRequest"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "Brand ID",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/brand/{id}/timeslots/delivery/menu/{menu}": {
"get": {
"tags": [
"location"
],
"summary": "Get location brand delivery timeslots for menu",
"operationId": "get_brand_menu_delivery_timeslosts",
"parameters": [
{
"type": "number",
"description": "Get the delivery timeslots after this date within the business hours of the location",
"name": "date",
"in": "query"
},
{
"type": "number",
"description": "Limit the number of timeslots returned",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "Get brand delivery menu timeslots response",
"schema": {
"$ref": "#/definitions/TimeSlots"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/BadRequest"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "Brand ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"format": "compassdigital.id",
"description": "Menu ID",
"name": "menu",
"in": "path",
"required": true
}
]
},
"/location/brand/{id}/timeslots/menu/{menu}": {
"get": {
"tags": [
"location"
],
"summary": "Get location brand timeslots for menu",
"operationId": "get_brand_menu_timeslots",
"parameters": [
{
"type": "number",
"description": "Get the pickup timeslots after this date within the business hours of the location",
"name": "date",
"in": "query"
},
{
"type": "number",
"description": "Limit the number of timeslots returned",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "Get brand menu timeslots response",
"schema": {
"$ref": "#/definitions/TimeSlots"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/BadRequest"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "Brand ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"format": "compassdigital.id",
"description": "Menu ID",
"name": "menu",
"in": "path",
"required": true
}
]
},
"/location/brands": {
"get": {
"tags": [
"location"
],
"summary": "Get all location brands",
"operationId": "get_location_brands",
"responses": {
"200": {
"description": "Get all location brands",
"schema": {
"type": "object",
"properties": {
"brands": {
"$ref": "#/definitions/Brands"
}
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/company": {
"post": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Create a new company",
"operationId": "create_company",
"parameters": [
{
"name": "name",
"in": "body",
"required": true,
"schema": {
"type": "object",
"required": [
"name",
"sector"
],
"properties": {
"is": {
"type": "object",
"properties": {
"global_images_enabled": {
"type": "boolean"
}
}
},
"label": {
"type": "object"
},
"name": {
"description": "Sector name",
"type": "string"
},
"sector": {
"description": "sector",
"type": "string",
"format": "compassdigital.id"
}
}
}
}
],
"responses": {
"200": {
"description": "Create company response",
"schema": {
"$ref": "#/definitions/Company"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/company/{id}": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Get a company within sector ",
"operationId": "get_company",
"parameters": [
{
"type": "boolean",
"default": true,
"name": "expanded",
"in": "query"
}
],
"responses": {
"200": {
"description": "Get company response",
"schema": {
"$ref": "#/definitions/Company"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Update a company",
"operationId": "patch_company",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CompanyUpdateBody"
}
}
],
"responses": {
"200": {
"description": "Update company response",
"schema": {
"$ref": "#/definitions/Company"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"description": "Company ID",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/group": {
"post": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Create a new group",
"operationId": "create_group",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Group"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Group"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/group/{id}": {
"get": {
"security": [
{
"bearerAuth": []
},
{}
],
"tags": [
"location"
],
"summary": "Get an individual Group based on id or latitude/longitude",
"operationId": "get_group",
"parameters": [
{
"type": "number",
"name": "latitude",
"in": "query"
},
{
"type": "number",
"name": "longitude",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "When fetching a group, brands will come with private and public configs",
"name": "include_brands_config",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "show additional hidden properties/entities",
"name": "extended",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "return only groups with brands that have web_order_enabled switched on",
"name": "web",
"in": "query"
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Group"
},
"x-cache-control": "max-age=60,stale-while-revalidate=3600"
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Override a complete Group",
"operationId": "update_group",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Group"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Group"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"delete": {
"security": [
{
"bearerAuth": []
}
],
"description": "We are not deleting a group. The locations can be deleted from group which are provided in body",
"tags": [
"location"
],
"summary": "Delete locations from a Group",
"operationId": "delete_group",
"parameters": [
{
"description": "List of locations to remove",
"name": "locations",
"in": "body",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Location"
}
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Group"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Update a Group",
"operationId": "patch_group",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Group"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Group"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"description": "group id",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/group/{id}/deliverydestination": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"delivery destination"
],
"summary": "Get all delivery destinations for group",
"operationId": "get_location_group_deliverydestination",
"responses": {
"200": {
"description": "Get all delivery destinations for a group",
"schema": {
"type": "object",
"properties": {
"delivery_destinations": {
"$ref": "#/definitions/DeliveryDestinations"
}
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"500": {
"description": "Server Error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"post": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"delivery destination"
],
"summary": "Create a new location group delivery destination",
"operationId": "post_location_group_deliverydestination",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PostOrPatchDeliveryDestination"
}
}
],
"responses": {
"200": {
"description": "Create delivery destination response",
"schema": {
"$ref": "#/definitions/DeliveryDestination"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"500": {
"description": "Server Error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "Group ID",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/group/{id}/deliverydestination/{delivery_destination}": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"delivery destination"
],
"summary": "Get a delivery destination",
"operationId": "get_location_group_deliverydestinationMixin1",
"responses": {
"200": {
"description": "Get delivery destination response",
"schema": {
"$ref": "#/definitions/DeliveryDestination"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"500": {
"description": "Server Error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"delete": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"delivery destination"
],
"summary": "Delete a delivery destination",
"operationId": "delete_location_group_deliverydestination",
"responses": {
"200": {
"description": "Delete delivery destination response",
"schema": {
"type": "object",
"properties": {
"deleted_delivery_destination": {
"$ref": "#/definitions/DeliveryDestination"
}
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"500": {
"description": "Server Error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"delivery destination"
],
"summary": "Patch a delivery destination",
"operationId": "patch_location_group_deliverydestination",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PostOrPatchDeliveryDestination"
}
}
],
"responses": {
"200": {
"description": "Patch delivery destination response",
"schema": {
"$ref": "#/definitions/DeliveryDestination"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"500": {
"description": "Server Error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "Group ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"format": "compassdigital.id",
"description": "Delivery Destination ID",
"name": "delivery_destination",
"in": "path",
"required": true
}
]
},
"/location/group/{id}/user/{user_id}": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Get a location group info specific to user read permissions",
"operationId": "get_user_group",
"parameters": [
{
"type": "number",
"name": "latitude",
"in": "query"
},
{
"type": "number",
"name": "longitude",
"in": "query"
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Group"
},
"x-cache-control": "max-age=60,stale-while-revalidate=3600"
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "group",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"format": "compassdigital.id",
"description": "user",
"name": "user_id",
"in": "path",
"required": true
}
]
},
"/location/marketplace/timeslots": {
"post": {
"tags": [
"location",
"marketplace",
"timeslots"
],
"summary": "Get Market Place timeslots",
"operationId": "post_location_marketplace_timeslots",
"parameters": [
{
"type": "number",
"description": "Get the pickup timeslots after this date within the business hours of the location",
"name": "date",
"in": "query"
},
{
"type": "number",
"description": "Limit the number of timeslots returned",
"name": "limit",
"in": "query"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/MarketPlace"
}
}
],
"responses": {
"200": {
"description": "Get brand menu timeslots response",
"schema": {
"$ref": "#/definitions/TimeSlots"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/BadRequest"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/marketplace/timeslots/delivery": {
"post": {
"tags": [
"location",
"delivery",
"marketplace"
],
"summary": "Get Marketplace delivery timeslots",
"operationId": "post_location_marketplace_timeslots_delivery",
"parameters": [
{
"type": "number",
"description": "Get the delivery timeslots after this date within the business hours of the location",
"name": "date",
"in": "query"
},
{
"type": "number",
"description": "Limit the number of timeslots returned",
"name": "limit",
"in": "query"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/MarketPlace"
}
}
],
"responses": {
"200": {
"description": "Get brand delivery menu timeslots response",
"schema": {
"$ref": "#/definitions/TimeSlots"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/BadRequest"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/multigroup": {
"get": {
"tags": [
"location"
],
"summary": "Get all the top level multigroups",
"operationId": "get_multigroups",
"responses": {
"200": {
"description": "Get multigroups response",
"schema": {
"$ref": "#/definitions/Multigroups"
},
"x-cache-control": "max-age=60,stale-while-revalidate=3600"
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"post": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Create a new multigroup",
"operationId": "create_multigroup",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/MultiGroup"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/MultiGroup"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/multigroup/{id}": {
"get": {
"tags": [
"location"
],
"summary": "Get a multigroup",
"operationId": "get_multigroup",
"parameters": [
{
"type": "string",
"description": "coordinate to sort from",
"name": "latitude",
"in": "query"
},
{
"type": "string",
"description": "coordinate to sort from",
"name": "longitude",
"in": "query"
},
{
"type": "string",
"default": true,
"description": "Merge multigroups from different providers. Set false to get only from queried provider",
"name": "merge",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "return multigroup location/brands in response",
"name": "expanded",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "return additional attributes in response",
"name": "extended",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "return additional hours and deliveryHours properties in response",
"name": "hours",
"in": "query"
}
],
"responses": {
"200": {
"description": "Get multigroup response",
"schema": {
"$ref": "#/definitions/MultiGroup"
},
"x-cache-control": "max-age=60,stale-while-revalidate=3600"
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Override a complete multigroup",
"operationId": "update_multigroup",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/MultiGroup"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/MultiGroup"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"delete": {
"security": [
{
"bearerAuth": []
}
],
"description": "We are not deleting a multigroup. The groups can be deleted from multigroup which are provided in body",
"tags": [
"location"
],
"summary": "Delete groups from a multigroup",
"operationId": "delete_multigroup",
"parameters": [
{
"description": "List of groups to remove",
"name": "groups",
"in": "body",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Group"
}
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/MultiGroup"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Update a multigroup",
"operationId": "patch_multigroup",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/MultiGroup"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/MultiGroup"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"description": "multigroup id",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/multigroup/{id}/user/{user_id}": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Get all the groups in a multigroup specific to user permissions",
"operationId": "get_user_multigroup",
"parameters": [
{
"type": "boolean",
"name": "expanded",
"in": "query"
}
],
"responses": {
"200": {
"description": "Get user multigroup response",
"schema": {
"$ref": "#/definitions/Groups"
},
"x-cache-control": "max-age=60,stale-while-revalidate=3600"
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"format": "compassdigital.id",
"description": "multigroup",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"format": "compassdigital.id",
"description": "user",
"name": "user_id",
"in": "path",
"required": true
}
]
},
"/location/pos/{id}": {
"get": {
"tags": [
"location"
],
"summary": "Get information about a POS",
"operationId": "get_pos",
"responses": {
"200": {
"description": "Get POS info response",
"schema": {
"$ref": "#/definitions/POS"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Set information about a POS",
"operationId": "update_pos",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/POS"
}
}
],
"responses": {
"200": {
"description": "Set POS info response",
"schema": {
"$ref": "#/definitions/POS"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"description": "POS ID",
"name": "id",
"in": "path",
"required": true
}
]
},
"/location/search": {
"get": {
"tags": [
"location"
],
"summary": "Gets Location within a radius of the provided point",
"operationId": "find_location",
"parameters": [
{
"type": "number",
"x-deprecated": true,
"description": "The latitude to be used",
"name": "lat",
"in": "query"
},
{
"type": "number",
"x-deprecated": true,
"description": "The longitude to be used",
"name": "long",
"in": "query"
},
{
"type": "number",
"description": "Operation id to be used",
"name": "operation_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Locations"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/sector": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Get list of all the sectors",
"operationId": "get_sectors",
"responses": {
"200": {
"description": "Get location sectors response",
"schema": {
"$ref": "#/definitions/Sectors"
},
"x-cache-control": "max-age=60,stale-while-revalidate=3600"
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"post": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Create a new sector",
"operationId": "create_sector",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CreateSector"
}
}
],
"responses": {
"200": {
"description": "Create sector response",
"schema": {
"$ref": "#/definitions/Sector"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/location/sector/{id}": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Get a sector",
"operationId": "get_sector",
"responses": {
"200": {
"description": "Get sector response",
"schema": {
"$ref": "#/definitions/Sector"
},
"x-cache-control": "max-age=60,stale-while-revalidate=3600"
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Update a sector",
"operationId": "patch_sector",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CreateSector"
}
}
],
"responses": {
"200": {
"description": "Update sector response",
"schema": {
"$ref": "#/definitions/Sector"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"description": "sector",
"name": "id",
"in": "path",
"required": true
},
{
"type": "boolean",
"description": "Omits nested children of a sector if false",
"name": "expanded",
"in": "query"
}
]
},
"/location/{id}": {
"get": {
"security": [
{
"bearerAuth": []
},
{}
],
"tags": [
"location"
],
"summary": "Get an individual Location",
"operationId": "get_location",
"parameters": [
{
"type": "boolean",
"default": false,
"description": "When fetching location, brands will come with private and public configs",
"name": "include_brands_config",
"in": "query"
},
{
"type": "array",
"items": {},
"description": "active cafes",
"name": "active_cafes",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "show additional hidden properties/entities",
"name": "extended",
"in": "query"
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Location"
},
"x-cache-control": "max-age=60,stale-while-revalidate=3600"
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Override a complete Location",
"operationId": "update_location",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Location"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Location"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"delete": {
"security": [
{
"bearerAuth": []
}
],
"description": "We are not deleting location. The brands can be deleted from location which are provided in body",
"tags": [
"location"
],
"summary": "Delete brands from a Location",
"operationId": "delete_location",
"parameters": [
{
"description": "List of brands to remove",
"name": "brands",
"in": "body",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Brand"
}
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Location"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"security": [
{
"bearerAuth": []
}
],
"tags": [
"location"
],
"summary": "Update a Location",
"operationId": "patch_location",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Location"
}
}
],
"responses": {
"200": {
"description": "Status 200",
"schema": {
"$ref": "#/definitions/Location"
}
},
"400": {
"description": "Unknown error",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"404": {
"description": "Not found",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"parameters": [
{
"type": "string",
"description": "location id",
"name": "id",
"in": "path",
"required": true
}
]
},
"/loyalty/{id}/balance/{user_id}": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"summary": "Get loyalty point balance for logged in user",
"operationId": "Mixin2",
"parameters": [
{
"description": "Loyalty Provider id",
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "CompassDigital User id",
"name": "user_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/Points"
}
},
"400": {
"description": "Invalid request parameters",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/loyalty/{id}/buyreward/{user_id}": {
"post": {
"security": [
{
"bearerAuth": []
}
],
"summary": "Redeem rewards to coupons",
"operationId": "Mixin2",
"parameters": [
{
"description": "Loyalty Provider id",
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "CompassDigital User id",
"name": "user_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "reward_id",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "buy reward Channel",
"name": "channel",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/RewardInfo"
}
},
"400": {
"description": "Invalid request parameters",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/loyalty/{id}/coupon/{user_id}/{coupon_id}": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"summary": "get coupon's information",
"operationId": "Mixin2",
"parameters": [
{
"description": "Loyalty Provider id",
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "CompassDigital User id",
"name": "user_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Coupon code to get coupon information",
"name": "coupon_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "compassdigital.id"
}
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "object",
"properties": {
"coupon": {
"$ref": "#/definitions/Coupon"
},
"is_valid": {
"description": "This will be true if the coupon status is either 'redeemed' or 'reissued'",
"type": "boolean"
}
}
}
},
"400": {
"description": "Invalid request parameters",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"patch": {
"security": [
{
"bearerAuth": []
}
],
"summary": "Update coupon's status",
"operationId": "Mixin2",
"parameters": [
{
"description": "Loyalty Provider id",
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "CompassDigital User id",
"name": "user_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Coupon code to update",
"name": "coupon_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "compassdigital.id"
}
},
{
"description": "Coupon status to set",
"name": "status",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/Success"
}
},
"400": {
"description": "Invalid request parameters",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/loyalty/{id}/coupons/{user_id}": {
"get": {
"security": [
{
"bearerAuth": []
}
],
"summary": "Get coupons available for the logged in user",
"operationId": "Mixin2",
"parameters": [
{
"description": "Loyalty Provider id",
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "CompassDigital User id",
"name": "user_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"schema": {
"type": "object",
"properties": {
"coupons": {
"type": "array",
"items": {
"$ref": "#/definitions/Coupon"
}
}
}
}
},
"400": {
"description": "Invalid request parameters",
"schema": {
"$ref": "#/definitions/Error"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"503": {
"description": "No provider returned a valid response",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/loyalty/{id}/enroll/{user_id}": {
"post": {
"security": [
{
"bearerAuth": []
}
],
"summary": "Enroll logged in user in Loyalty program",
"operationId": "Mixin2",
"parameters": [
{
"description": "Loyalty Provider id",
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "CompassDigital User id",
"name": "user_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{