Download OpenAPI specification:Download
Welcome to the Cosmopoints API documentation. The service simplifies transactions with loyalty programs by aggregating different APIs into a single, consistent interface.
Before starting to use the Cosmopoints APIs, you must authenticate yourself using the supplied Client ID and Client Secret.
clientId
required
|
string
Unique ID for your app |
clientSecret
required
|
string
Secret key for your app |
{
-
"clientId":
"string",
-
"clientSecret":
"string"
}
{
-
"accessToken":
"string"
}
Issue points with a specific partner. This endpoint will create a new transaction record in the database.
currencyId
required
|
string
The currency id of the desired partner |
value
required
|
integer
The value denominated in the configured fiat currency for your organization |
userId
required
|
string
The destination user id with the partner where points are created |
referenceNumber
required
|
string
The transaction reference number provided by the calling application |
description |
string
Short description to attach to the transaction |
bonus |
boolean
Specifies whether the points were issued as bonus points for the user or not |
{
-
"currencyId":
"string",
-
"value": 0,
-
"userId":
"string",
-
"referenceNumber":
"string",
-
"description":
"string",
-
"bonus":
true
}
Retrieve all transactions in a specific interval.
startDate
required
|
string
The starting date in epoch (seconds, 10 digits) |
endDate
required
|
string
The end date in epoch (seconds, 10 digits) |
currencyId |
string
The currency id of the desired partner |
[
-
{
-
"id":
"string",
-
"referenceNumber":
"string",
-
"sourceValue":
0,
-
"description":
"string",
-
"createdAt":
"string",
-
"pointTransactions":
[
-
{
-
"destinationNumberOfPoints":
"string",
-
"type":
"string"
}
],
-
"partnership":
{
-
"destination":
{
-
"name":
"string",
-
"currencyId":
"string"
}
}
}
]
Get a single transaction record by Transaction ID or Reference Number.
transactionId
required
|
string
Either the transaction identifier issued by Cosmopoints, or the transaction reference number provided by the calling application |
{
-
"id":
"string",
-
"referenceNumber":
"string",
-
"sourceValue": 0,
-
"description":
"string",
-
"createdAt":
"string",
-
"userId":
"string",
-
"pointTransactions":
[
-
{
-
"destinationNumberOfPoints":
"string",
-
"type":
"string"
}
],
-
"partnership":
{
-
"destination":
{
-
"name":
"string",
-
"currencyId":
"string"
}
}
}
Create a program connection for a specific user id.
currencyId
required
|
string
The currency id of the desired partner |
sourceUserId
required
|
string
The user identifier with your organization - Identifier might be opaque |
destinationUserId
required
|
string
The destination user id with the partner where points are created |
{
-
"currencyId":
"string",
-
"sourceUserId":
"string",
-
"destinationUserId":
"string"
}
Retrieve program connections for a specific user id.
sourceUserId
required
|
string
The user identifier with your organization - Identifier might be opaque |
currencyId |
string
The currency id of the desired partner |
[
-
{
-
"destinationUserId":
"string",
-
"business":
{
-
"name":
"string",
-
"currencyId":
"string"
},
-
"sourceUser":
{
-
"sourceUserId":
"string"
},
-
"createdAt":
"string"
}
]