Cosmo Points (1.0.0)

Download OpenAPI specification:Download

Welcome to the Cosmo Points API documentation. The service simplifies interactions by aggregating different APIs into a single, consistent interface. It supports point-to-point and point-to-gift card redemption and conversion, offering an efficient way to manage and exchange points across multiple platforms

Relay

Authentication

Before starting using the Relay APIs, you need to authenticate yourself.

  • This API uses Bearer token for authentication.
  • Every token is valid for 10 minutes.
  • Token MUST be provided in Authorization header, in string Bearer plus a token format, which can be obtained by the login service.
Request Body schema: application/json
required
clientId
string
clientSecret
string

Responses

Request samples

Content type
application/json
{
  • "clientId": "string",
  • "clientSecret": "string"
}

Response samples

Content type
application/json
{
  • "token": "string"
}

Issue Points

Issue points with a specified partner

Authorizations:
jwtAuth
Request Body schema: application/json
required
partner
string
sourcePoints
integer

Responses

Request samples

Content type
application/json
{
  • "partner": "string",
  • "sourcePoints": 0
}

Issue Gift Cards

Issue a gift card with a specified partner

Authorizations:
jwtAuth
Request Body schema: application/json
required
partner
string
sourcePoints
integer
giftCardId
string

Responses

Request samples

Content type
application/json
{
  • "partner": "string",
  • "sourcePoints": 0,
  • "giftCardId": "string"
}

Common

General data

Fetches common data like fiat currencies, etc...

Authorizations:
jwtAuth

Responses

Response samples

Content type
application/json
{
  • "fiatCurrencies": [
    ]
}

Feedback

Post feedback

Records a feedback submitted from the widget

Authorizations:
jwtAuth
Request Body schema: application/json
required
rating
integer [ 1 .. 5 ]
message
string

Responses

Request samples

Content type
application/json
{
  • "rating": 1,
  • "message": "string"
}

Response samples

Content type
application/json
{
  • "message": "Your feedback was recorded"
}

Upload

Transaction

Get transaction history

Fetches the user's transactions history

Authorizations:
jwtAuth

Responses

Response samples

Content type
application/json
{ }

Point

Get all points

Fetches all the available points

Authorizations:
jwtAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get business point

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

ID of the business

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update business point

Authorizations:
jwtAuth
Request Body schema: application/json
required
id
string <uuid>

Unique identifier for the crypto asset

name
string

Name of the crypto asset

ticker
string

Ticker symbol of the crypto asset

logo
string <uri>

URL to the logo of the crypto asset

earnEnabled
boolean

Indicates whether earning is enabled for the crypto asset

burnEnabled
boolean

Indicates whether burning is enabled for the crypto asset

buyRate
number <double>

Buy rate of the crypto asset

sellRate
number <double>

Sell rate of the crypto asset

businessId
string <uuid>

ID of the associated business

earnExchangeRate
number <double>

Exchange rate for earning the crypto asset

burnExchangeRate
number <double>

Exchange rate for burning the crypto asset

object

Information about the currency

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "ticker": "string",
  • "earnEnabled": true,
  • "burnEnabled": true,
  • "buyRate": 0.1,
  • "sellRate": 0.1,
  • "businessId": "50092e54-cd12-4059-9828-e8c4ee9a3cf5",
  • "earnExchangeRate": 0.1,
  • "burnExchangeRate": 0.1,
  • "currency": {
    }
}

Response samples

Content type
application/json
{ }

Publish/Unpublish point

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

ID of the business

pointId
required
string <uuid>

ID of the point

Request Body schema: application/json
publish
boolean

Responses

Request samples

Content type
application/json
{
  • "publish": true
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "ticker": "string",
  • "earnEnabled": true,
  • "burnEnabled": true,
  • "buyRate": 0.1,
  • "sellRate": 0.1,
  • "businessId": "50092e54-cd12-4059-9828-e8c4ee9a3cf5",
  • "earnExchangeRate": 0.1,
  • "burnExchangeRate": 0.1,
  • "currency": {
    }
}

Get all business point exchange rates

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

ID of the business

pointId
required
string <uuid>

ID of the point

Responses

Response samples

Content type
application/json
{
  • "id": "64395060-2387-475f-8e54-786062a288e9",
  • "buyRate": 0.05,
  • "sellRate": 0.1,
  • "pointId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "createdAt": "2024-03-04T23:47:05.332Z"
}

Create business point exchange rate

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

ID of the business

pointId
required
string <uuid>

ID of the point

Request Body schema: application/json
required
buyRate
number
sellRate
number

Responses

Request samples

Content type
application/json
{
  • "buyRate": 0,
  • "sellRate": 0
}

Response samples

Content type
application/json
{
  • "id": "64395060-2387-475f-8e54-786062a288e9",
  • "buyRate": 0.05,
  • "sellRate": 0.1,
  • "pointId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "createdAt": "2024-03-04T23:47:05.332Z"
}

Gift Card

Get all gift cards

Fetches all the available gift cards

Authorizations:
jwtAuth

Responses

Response samples

Content type
application/json
[]

Request publish gift card

Authorizations:
jwtAuth
path Parameters
giftCardId
required
string <uuid>

ID of the gift card

Responses

Response samples

Content type
application/json
{
  • "id": "8263c981-dff7-456e-bc69-e7bdae07fdc4",
  • "status": "PENDING",
  • "giftCardId": "43819b6b-aa1b-4b4c-90c8-4eaddb62c02c",
  • "createdAt": "2024-03-05T15:11:42.348Z"
}

Get business gift cards

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

ID of the business

Responses

Response samples

Content type
application/json
[]

Create business gift card

Authorizations:
jwtAuth
Request Body schema: application/json
required
id
string <uuid>

Unique identifier for the gift card

name
string

Name of the gift card

logo
string

URL to the logo of the gift card

description
string

Description of the gift card

backgroundColor
string <color>

Background color of the gift card

adjustmentValue
number <double>

Adjustment value of the gift card

adjustmentType
string
Enum: "DISCOUNT" "MARKUP"

Type of adjustment for the gift card

minValue
number <double>

Minimum value of the gift card

maxValue
number <double>

Maximum value of the gift card

webhook
string <uri>

Webhook URL for the gift card

businessId
string <uuid>

ID of the associated business

publishedAt
string <date-time>

Date and time when the gift card was published

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{ }

Get business gift card

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

ID of the business

giftCardId
required
string <uuid>

ID of the gift card

Responses

Response samples

Content type
application/json
{
  • "id": "fda235aa-8da6-4e4f-9cd3-6c72517909f4",
  • "name": "Test 2",
  • "description": "Test 2 giftcard",
  • "backgroundColor": "#c52d2d",
  • "adjustmentValue": 10,
  • "adjustmentType": "DISCOUNT",
  • "minValue": 5,
  • "maxValue": 10,
  • "webhook": "http://google.com",
  • "businessId": "367a5fb7-2cc9-4227-8976-ac2a2b84a8c5",
  • "publishedAt": "2024-02-26T09:34:45.689Z",
  • "GiftCardPublishRequest": {
    }
}

Update business gift card

Authorizations:
jwtAuth
Request Body schema: application/json
required
name
string
description
string
logo
string <uri>
backgroundColor
string
adjustmentValue
number
adjustmentType
string
minValue
number
maxValue
number
webhook
string <uri>

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "backgroundColor": "string",
  • "adjustmentValue": 0,
  • "adjustmentType": "string",
  • "minValue": 0,
  • "maxValue": 0,
  • "webhook": "http://example.com"
}

Response samples

Content type
application/json
{}

Publish business gift card

Authorizations:
jwtAuth

Responses

Response samples

Content type
application/json
{ }

Partner identifier

Get all partner identifiers

Authorizations:
jwtAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add partner identifier

Authorizations:
jwtAuth
Request Body schema: application/json
userId
required
string <uuid>
businessId
required
string <uuid>
partnerUserId
required
string
partnerUserName
string

Responses

Request samples

Content type
application/json
{
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "businessId": "50092e54-cd12-4059-9828-e8c4ee9a3cf5",
  • "partnerUserId": "string",
  • "partnerUserName": "string"
}

Response samples

Content type
application/json
{
  • "id": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "businessId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "userId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "nickname": "JohnDoe",
  • "sessionUserName": "john.doe@example.com",
  • "sessionUserId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "createdAt": "2024-03-04T23:47:05.332Z"
}

Inspect partner identifier

Authorizations:
jwtAuth

Responses

Response samples

Content type
application/json
{
  • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "description": "string",
  • "name": "string",
  • "businessId": "50092e54-cd12-4059-9828-e8c4ee9a3cf5",
  • "fiatCurrencyId": "6cf6c58d-c34b-4fa7-8253-27dc968f3cf4",
  • "cosmoBuyRate": 0.1,
  • "cosmoSellRate": 0.1,
  • "partnershipControlType": "WHITELIST",
  • "partnerIdentifier": {
    }
}

Update nickname of partner identifier

Authorizations:
jwtAuth
path Parameters
partnerIdentifierId
required
string <uuid>

ID of the partner identifier

Request Body schema: application/json
nickname
string

Responses

Request samples

Content type
application/json
{
  • "nickname": "string"
}

Response samples

Content type
application/json
{
  • "id": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "businessId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "userId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "nickname": "JohnDoe",
  • "sessionUserName": "john.doe@example.com",
  • "sessionUserId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "createdAt": "2024-03-04T23:47:05.332Z"
}

Notification Preference

Get notification preference

Authorizations:
jwtAuth

Responses

Response samples

Content type
application/json
{
  • "id": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "userId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "onExchange": true,
  • "onTransfer": false
}

Update notification preference

Authorizations:
jwtAuth
Request Body schema: application/json
userId
required
string <uuid>
businessId
required
string <uuid>
partnerUserId
required
string
partnerUserName
string

Responses

Request samples

Content type
application/json
{
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "businessId": "50092e54-cd12-4059-9828-e8c4ee9a3cf5",
  • "partnerUserId": "string",
  • "partnerUserName": "string"
}

Response samples

Content type
application/json
{
  • "id": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "userId": "e67a826e-b895-4284-90d3-1434772de8cf",
  • "onExchange": true,
  • "onTransfer": false
}

Business

Get all businesses

Authorizations:
jwtAuth
query Parameters
businessOwned
boolean

Get My Businesses

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create Business

Authorizations:
jwtAuth
Request Body schema: application/json
required
businessId
string <uuid>
name
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "50092e54-cd12-4059-9828-e8c4ee9a3cf5",
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "description": "string",
  • "name": "string",
  • "businessId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "fiatCurrencyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "cosmoBuyRate": 0.0102,
  • "cosmoSellRate": 0.0095,
  • "partnershipControlType": "WHITELIST"
}

Get business

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "description": "string",
  • "name": "string",
  • "businessId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "fiatCurrencyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "cosmoBuyRate": 0.0102,
  • "cosmoSellRate": 0.0095,
  • "partnershipControlType": "WHITELIST"
}

Update Business

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>
Request Body schema: application/json
required
name
string
description
string
fiatCurrencyId
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "fiatCurrencyId": "6cf6c58d-c34b-4fa7-8253-27dc968f3cf4"
}

Response samples

Content type
application/json
{
  • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "description": "string",
  • "name": "string",
  • "businessId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "fiatCurrencyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "cosmoBuyRate": 0.0102,
  • "cosmoSellRate": 0.0095,
  • "partnershipControlType": "WHITELIST"
}

Get business branding

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

ID of the business

Responses

Response samples

Content type
application/json
{
  • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "businessId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  • "themeColor": "string"
}

Update business branding

Authorizations:
jwtAuth
Request Body schema: application/json
required
themeColor
Array of strings

Responses

Request samples

Content type
application/json
{
  • "themeColor": [
    ]
}

Response samples

Content type
application/json
{ }

Blacklist

Get blacklisted businesses

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

ID of the business

Responses

Response samples

Content type
application/json
{
  • "businessId": "50092e54-cd12-4059-9828-e8c4ee9a3cf5",
  • "listedId": "fea707ef-a9e3-44ed-bf67-d36e03bb800d",
  • "listed": {
    }
}

Update blacklist

Authorizations:
jwtAuth
Request Body schema: application/json
required
listedIds
Array of strings <uuid> [ items <uuid > ]
partnershipControlType
string

Responses

Request samples

Content type
application/json
{
  • "listedIds": [
    ],
  • "partnershipControlType": "string"
}

Response samples

Content type
application/json
{
  • "count": 1
}

Whitelist

Get whitelisted businesses

Authorizations:
jwtAuth
path Parameters
businessId
required
string <uuid>

ID of the business

Responses

Response samples

Content type
application/json
{
  • "count": 1
}

Update whitelist

Authorizations:
jwtAuth
Request Body schema: application/json
required
listedIds
Array of strings <uuid> [ items <uuid > ]
partnershipControlType
string

Responses

Request samples

Content type
application/json
{
  • "listedIds": [
    ],
  • "partnershipControlType": "string"
}

Response samples

Content type
application/json
{ }