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 A unique 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"
}
}
}