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.
programId required | string The program id of the desired partner |
value required | integer The value denominated in the configured fiat program 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 |
{- "programId": "string",
- "value": 0,
- "userId": "string",
- "referenceNumber": "string",
- "description": "string",
- "bonus": true
}
{- "id": "string",
- "totalPoints": 0,
- "referenceNumber": "string",
- "date": "string"
}
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) |
programId | string The program id of the desired partner |
[- {
- "id": "string",
- "referenceNumber": "string",
- "sourceValue": 0,
- "description": "string",
- "createdAt": "string",
- "pointTransactions": [
- {
- "destinationNumberOfPoints": "string",
- "type": "string"
}
], - "partnership": {
- "destination": {
- "name": "string",
- "programId": "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",
- "programId": "string"
}
}
}
Create or update a program connection for a specific user id.
programId required | string The program id of the desired partner |
endUserId 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 |
{- "programId": "string",
- "endUserId": "string",
- "destinationUserId": "string"
}
{- "endUserId": "string",
- "programId": "string",
- "destinationUserId": "string",
- "createdAt": "string"
}
Retrieve program connections for a specific user id.
endUserId required | string The user identifier with your organization - Identifier might be opaque |
programId | string The program id of the desired partner |
[- {
- "destinationUserId": "string",
- "programId": "string",
- "business": {
- "name": "string",
- "programId": "string"
}, - "createdAt": "string"
}
]