Download OpenAPI specification:
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.
| client_id required | string Unique ID of your app |
| client_secret required | string Secret key of your app |
| grant_type required | string Value: "client_credentials" |
| access_token | string Access token for subsequent API calls. |
| expires_in | number Token expiry in seconds. |
| token_type | string Type of the token. |
{- "access_token": "string",
- "expires_in": 600,
- "token_type": "Bearer"
}Retrieve information about your business profile with Cosmopoints.
| name | string Name of your business. |
| programId | string Unique identifier of your business program. |
| programName | string The business program name. |
| legalEntity | string Legal entity name of the business. |
| logo | string URL of the business logo/photo. |
| logoDarkMode | string URL of the business logo/photo for dark mode. |
| industry | string Industry name. |
| country | string Country of the business. |
| address | string Address of the business. |
| city | string City of the business. |
| zipCode | string Postal code / zip code. |
| localCurrency | string Program currency short code. |
| technicalContact | string Technical contact person or team. |
| technicalContactEmail | string <email> Email for technical contact. |
| billingContact | string Billing contact person or team. |
| billingContactEmail | string <email> Email for billing contact. |
| countryCode | string Country calling code. |
| phone | string Contact phone number. |
{- "name": "string",
- "programId": "string",
- "programName": "string",
- "legalEntity": "string",
- "logo": "string",
- "logoDarkMode": "string",
- "industry": "string",
- "country": "string",
- "address": "string",
- "city": "string",
- "zipCode": "string",
- "localCurrency": "string",
- "technicalContact": "string",
- "technicalContactEmail": "user@example.com",
- "billingContact": "string",
- "billingContactEmail": "user@example.com",
- "countryCode": "string",
- "phone": "string"
}Retrieve a list of all your enabled partner programs along with the price per point in USD and in the program currency.
| id | string Unique identifier of the program. | ||||||||
| name | string Name of the program. | ||||||||
| businessName | string Name of the business associated with the program. | ||||||||
| logo | string URL of the program logo. | ||||||||
| logoDarkMode | string URL of the program logo for dark mode. | ||||||||
| industry | string Industry of the program. | ||||||||
| termsAndConditionsUrl | string URL to the terms and conditions of the program. | ||||||||
| brandDescription | string Description of the brand associated with the program. | ||||||||
| programCurrency | string Custom currency code of the program. | ||||||||
| pricePerPointInUsd | string <double> Price per point in USD. | ||||||||
| pricePerPointInLocalCurrency | string <double> Price per point in your organization's currency. | ||||||||
| minAmountOfPoints | number Deprecated Deprecated: use partnerMinAllowedPoints. Minimum amount of points that can be issued. | ||||||||
| maxAmountOfPoints | number Deprecated Deprecated: use partnerMaxAllowedPoints. Maximum amount of points that can be issued. | ||||||||
| minValue | number Deprecated Deprecated: use minAllowedPoints. Minimum value to issue points. | ||||||||
| maxValue | number Deprecated Deprecated: use maxAllowedPoints. Maximum value to issue points. | ||||||||
| partnerMinAllowedPoints | number Minimum amount of destination points that can be issued, set by the partner. | ||||||||
| partnerMaxAllowedPoints | number Maximum amount of destination points that can be issued, set by the partner. | ||||||||
| minAllowedPoints | number Minimum amount of destination points that can be issued, set by you. | ||||||||
| maxAllowedPoints | number Maximum amount of destination points that can be issued, set by you. | ||||||||
| localCurrency | string Currency code of your organization. | ||||||||
| partnerCode | string The partner code. | ||||||||
object | |||||||||
| |||||||||
[- {
- "id": "string",
- "name": "string",
- "businessName": "string",
- "logo": "string",
- "logoDarkMode": "string",
- "industry": "string",
- "termsAndConditionsUrl": "string",
- "brandDescription": "string",
- "programCurrency": "string",
- "pricePerPointInUsd": "string",
- "pricePerPointInLocalCurrency": "string",
- "minAmountOfPoints": 0,
- "maxAmountOfPoints": 0,
- "minValue": 0,
- "maxValue": 0,
- "partnerMinAllowedPoints": 0,
- "partnerMaxAllowedPoints": 0,
- "minAllowedPoints": 0,
- "maxAllowedPoints": 0,
- "localCurrency": "string",
- "partnerCode": "string",
- "requiredFields": {
- "destinationUserId": "string",
- "destinationUserEmail": "string",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string"
}
}
]Retrieve the fields for a specific program.
| programId required | string The program id of the desired partner. |
| destinationUserId | string The ID of the destination user. |
| destinationUserEmail | string The email of the destination user. |
{- "destinationUserId": "string",
- "destinationUserEmail": "string"
}Validate if a user is a valid member of a specific program.
| destinationUserId | string This field may be optional or mandatory depending on the partner program. Please use the Get Program Fields endpoint to check if it is required |
| destinationUserEmail | string This field may be optional or mandatory depending on the partner program. Please use the Get Program Fields endpoint to check if it is required |
object | |||
| |||
{- "destinationUserId": "string",
- "destinationUserEmail": "string"
}{- "data": {
- "isValid": true
}
}Retrieve details like brand name and logo for each program based on the program IDs you provide.
| programId[] required | Array of strings Example: programId[]=EXAMPLE_PROGRAM The Program Ids |
{- "EXAMPLE_PROGRAM": {
- "businessName": "string",
- "programId": "string",
- "programName": "string",
- "logo": "string",
- "logoDarkMode": "string",
- "programCurrency": "string",
- "brandDescription": "string",
- "termsConditionsUrl": "string"
}
}Retrieve all campaigns by programId or status.
| programId | string The program id of the desired partner |
| status | string Enum: "UPCOMING" "RUNNING" "STOPPED" "EXPIRED" The status of the campaign |
| page | number The number of the page to retrieve |
| pageSize | number The number of items per page (default 25, max 5000) |
| total | number Total number of transactions. | ||||||||||||||||||||||||
Array of objects | |||||||||||||||||||||||||
Array
| |||||||||||||||||||||||||
{- "total": 0,
- "data": [
- {
- "id": "string",
- "name": "string",
- "yourCostSharePercentage": 0,
- "extraPointsPercentage": 0,
- "fundedBonusPercentage": 0,
- "partnerFundedBonusPercentage": 0,
- "startDate": "string",
- "endDate": "string",
- "status": "string",
- "partnerCode": "string",
- "type": "CO-FUNDED",
- "programId": "string"
}
]
}Deprecated. Preview the points with a specific partner. This endpoint will compute the value of points to be created with this partner.
| programId required | string The program id of the desired partner |
| value required | float Provide the value in the chosen currency (USD or local currency). |
| currency required | string Use |
| totalPoints | number Total number of points to be issued. |
{- "programId": "string",
- "value": 1.1,
- "currency": "string"
}{- "totalPoints": 0
}Issue points with a specific partner. This endpoint will create a new transaction record in the database.
The request is de-duplicated on referenceNumber, which must be
unique per calling application. Retrying with the same
referenceNumber and the same transfer details returns the original
transaction with a 200 instead of creating a second one; reusing it
for different transfer details is rejected with a 409.
| programId required | string The program id of the desired partner | ||||||||
required | object The destination user object. Mandatory and optional fields may vary per partner program. Please use the | ||||||||
| |||||||||
| referenceNumber required | string The transaction reference number provided by the calling
application. Required, and must be unique across all
of your transactions — it is the de-duplication key for this
endpoint. Re-sending the same | ||||||||
| basePoints | integer The number of base points to issue. Preferred over
| ||||||||
| bonusPoints | integer Additional bonus points to issue on top of | ||||||||
| value | float Deprecated Deprecated — use
| ||||||||
| currency | string Deprecated Deprecated — use
| ||||||||
| description | string Short description to attach to the transaction | ||||||||
| partnerCode | string The partner code (required for aggregator) | ||||||||
| id | string Unique identifier of the original transaction. |
| totalPoints | number Total number of points issued by the original transaction. |
| referenceNumber | string Reference number of the transaction. |
| date | string Date and time the original transaction was created. |
{- "programId": "string",
- "basePoints": 100,
- "bonusPoints": 20,
- "value": 1.1,
- "currency": "string",
- "destinationAccount": {
- "destinationUserId": "string",
- "destinationUserEmail": "user@example.com",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string"
}, - "referenceNumber": "string",
- "description": "string",
- "partnerCode": "string"
}{- "id": "string",
- "totalPoints": 0,
- "referenceNumber": "string",
- "date": "string"
}Retrieve all transactions in a specific interval.
| startDate required | string Any valid date representation |
| endDate required | string Any valid date representation |
| programId | string The program id of the desired partner |
| page | number The number of the page to retrieve |
| pageSize | number The number of items per page (default 25, max 5000) |
| total | number Total number of transactions. | ||||||||||||||
Array of objects | |||||||||||||||
Array
| |||||||||||||||
{- "total": 0,
- "data": [
- {
- "id": "string",
- "referenceNumber": "string",
- "sourceValue": 0,
- "description": "string",
- "createdAt": "string",
- "pointTransactions": [
- {
- "destinationNumberOfPoints": "string",
- "type": "string"
}
], - "partnership": {
- "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 Unique identifier of the transaction. | ||||||||
| referenceNumber | string Reference number of the transaction. | ||||||||
| sourceValue | number Source value of the transaction. | ||||||||
| description | string Description of the transaction. | ||||||||
| createdAt | string Date and time of the transaction creation. | ||||||||
| destinationUserId | string User ID associated with the transaction. | ||||||||
Array of objects | |||||||||
Array
| |||||||||
object | |||||||||
| |||||||||
{- "id": "string",
- "referenceNumber": "string",
- "sourceValue": 0,
- "description": "string",
- "createdAt": "string",
- "destinationUserId": "string",
- "pointTransactions": [
- {
- "destinationNumberOfPoints": "string",
- "type": "string"
}
], - "partnership": {
- "destination": {
- "name": "string",
- "programId": "string"
}
}
}Retrieve program connections for a specific user id.
| sourceUserId required | string The user identifier with your organization - Identifier might be opaque |
| programId | string The program id of the desired partner |
| partnerCode | string The partner code (for aggregator) |
| id | string Unique identifier of the program connection. |
| destinationUserId | string User ID with the partner program. Can be null if not required. |
| destinationUserEmail | string User email with the partner program. Can be null if not required. |
| destinationUserFirstName | string First name of the destination user. |
| destinationUserLastName | string Last name of the destination user. |
| programId | string Unique identifier of the program. |
| updatedAt | string Date and time of the last update. |
| createdAt | string Date and time of creation. |
[ ]Create or update a program connection for a specific user id.
| programId required | string The program id of the desired partner. | ||||||||
| sourceUserId required | string The user identifier with your organization. | ||||||||
required | object The destination user object. Mandatory and optional fields may vary per partner program. Please use the | ||||||||
| |||||||||
| sourceUserEmail | string The user email with your organization. | ||||||||
| partnerCode | string The partner code (required for aggregator). | ||||||||
{- "programId": "string",
- "destinationAccount": {
- "destinationUserId": "string",
- "destinationUserEmail": "user@example.com",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string"
}, - "sourceUserId": "string",
- "sourceUserEmail": "string",
- "partnerCode": "string"
}{- "id": "string",
- "sourceUserId": "string",
- "sourceUserEmail": "string",
- "programId": "string",
- "partnerCode": "string",
- "destinationUserId": "string",
- "destinationUserEmail": "string",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string",
- "updatedAt": "string",
- "createdAt": "string"
}Retrieve program connections history.
| startDate | string Any valid date representation |
| endDate | string Any valid date representation |
| page | number The number of the page to retrieve |
| pageSize | number The number of items per page (default 25, max 5000) |
| partnerCode | string The partner code (for aggregator) |
| total | number Total number of records. | ||||||||||||||||||
Array of objects or Array of objects | |||||||||||||||||||
One of Array
| |||||||||||||||||||
{- "total": 0,
- "data": [
- {
- "id": "string",
- "event": "string",
- "programId": "string",
- "sourceProgramUser": {
- "sourceUserEmail": "string",
- "sourceUserId": "string"
}, - "destinationUserEmail": "string",
- "destinationUserId": "string",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string",
- "timestamp": "string"
}
]
}Retrieve a list of all your enabled partner programs along with the price per point in USD and in the program currency.
| id | string Unique identifier of the program. | ||||||||
| name | string Name of the program. | ||||||||
| businessName | string Name of the business associated with the program. | ||||||||
| logo | string URL of the program logo. | ||||||||
| logoDarkMode | string URL of the program logo for dark mode. | ||||||||
| industry | string Industry of the program. | ||||||||
| partnerCode | string The partner code. | ||||||||
| termsAndConditionsUrl | string URL to the terms and conditions of the program. | ||||||||
| brandDescription | string Description of the brand associated with the program. | ||||||||
| programCurrency | string Custom currency code of the program. | ||||||||
| pricePerPointInUsd | string <double> Price per point in USD. | ||||||||
| pricePerPointInLocalCurrency | string <double> Price per point in your organization's currency. | ||||||||
| localCurrency | string Currency code of your organization. | ||||||||
object | |||||||||
| |||||||||
[- {
- "id": "string",
- "name": "string",
- "businessName": "string",
- "logo": "string",
- "logoDarkMode": "string",
- "industry": "string",
- "partnerCode": "string",
- "termsAndConditionsUrl": "string",
- "brandDescription": "string",
- "programCurrency": "string",
- "pricePerPointInUsd": "string",
- "pricePerPointInLocalCurrency": "string",
- "localCurrency": "string",
- "requiredFields": {
- "destinationUserId": "string",
- "destinationUserEmail": "string",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string"
}
}
]Validate if a user is a valid member of a specific program.
| destinationUserId | string This field may be optional or mandatory depending on the partner program. Please use the Get Program Fields endpoint to check if it is required |
| destinationUserEmail | string This field may be optional or mandatory depending on the partner program. Please use the Get Program Fields endpoint to check if it is required |
object | |||
| |||
{- "destinationUserId": "string",
- "destinationUserEmail": "string"
}{- "data": {
- "isValid": true
}
}Credit points to a specific user. The point distribution will be provided using the program connections endpoint.
The request is de-duplicated on referenceNumber, which must be
unique per calling application. Retrying with the same
referenceNumber and the same transfer details returns the original
transaction with a 200 instead of creating a second one; reusing it
for different transfer details is rejected with a 409.
/multibrand/credit and /multibrand/debit share a single
referenceNumber namespace, so a reference number already used on
one endpoint cannot be reused on the other.
| userId required | string The user id of your organization |
| value required | float The value in the chosen currency (USD or local currency). |
| currency required | string Use |
| executionDate required | string The execution date of the transaction |
| referenceNumber required | string The transaction reference number provided by the calling
application. Required, and must be unique across all
of your transactions — it is the de-duplication key for this
endpoint, and it shares one namespace with
|
| sourceUserId | string Your organization's user id. |
| sourceProgramId | string Your organization's program id. |
| valueInSourceLocalCurrency | string Accumulated amount in your organization's local currency. |
| valueInUsd | string Accumulated amount in usd. |
| localCurrency | string Your organization's local currency. |
| status | string Enum: "PENDING" "MATURED" "EXECUTED" Current status of the original transaction. |
| createdAt | string Date and time the original transaction was created. |
| executionDate | string Date of the transaction execution. |
{- "userId": "string",
- "value": 1.1,
- "currency": "string",
- "executionDate": "string",
- "referenceNumber": "string"
}{- "sourceUserId": "string",
- "sourceProgramId": "string",
- "valueInSourceLocalCurrency": "string",
- "valueInUsd": "string",
- "localCurrency": "string",
- "status": "PENDING",
- "createdAt": "string",
- "executionDate": "string"
}Retrieve all executed transactions in a specific interval.
| startDate | string Any valid date representation |
| endDate | string Any valid date representation |
| programId | string The program id of the desired partner |
| page | number The number of the page to retrieve |
| pageSize | number The number of items per page (default 25, max 5000) |
| total | number Total number of executed transactions. | ||||||||||
Array of objects | |||||||||||
Array
| |||||||||||
{- "total": 0,
- "data": [
- {
- "id": "string",
- "valueInSourceLocalCurrency": 0,
- "createdAt": "string",
- "pointTransactions": [
- {
- "numberOfPoints": "string",
- "type": "string"
}
], - "partnership": {
- "destinationProgramId": "string"
}
}
]
}Debit points from a specific user. The point distribution will be provided using the program connections endpoint.
The request is de-duplicated on referenceNumber, which must be
unique per calling application. Retrying with the same
referenceNumber and the same transfer details returns the original
transaction with a 200 instead of creating a second one; reusing it
for different transfer details is rejected with a 409.
/multibrand/debit and /multibrand/credit share a single
referenceNumber namespace, so a reference number already used on
one endpoint cannot be reused on the other.
| userId required | string The user id of your organization |
| value required | float The value in the chosen currency (USD or local currency). |
| currency required | string Use |
| referenceNumber required | string The transaction reference number provided by the calling
application. Required, and must be unique across all
of your transactions — it is the de-duplication key for this
endpoint, and it shares one namespace with
|
| sourceUserId | string Your organization's user id. |
| sourceProgramId | string Your organization's program id. |
| valueInSourceLocalCurrency | string Accumulated amount in your organization's local currency. |
| valueInUsd | string Accumulated amount in usd. |
| localCurrency | string Your organization's local currency. |
| status | string Enum: "PENDING" "MATURED" "EXECUTED" Current status of the original transaction. |
| createdAt | string Date and time the original transaction was created. |
| executionDate | string Date of the transaction execution. |
{- "userId": "string",
- "value": 1.1,
- "currency": "string",
- "referenceNumber": "string"
}{- "sourceUserId": "string",
- "sourceProgramId": "string",
- "valueInSourceLocalCurrency": "string",
- "valueInUsd": "string",
- "localCurrency": "string",
- "status": "PENDING",
- "createdAt": "string",
- "executionDate": "string"
}Retrieve estimated balance in currencies.
| userId required | string Your organization's user id |
| status required | string Enum: "PENDING" "MATURED" |
| estimatedValueInUsd | string |
| estimatedValueInSourceLocalCurrency | string |
{- "estimatedValueInUsd": "string",
- "estimatedValueInSourceLocalCurrency": "string"
}Retrieve estimated balance in points.
| userId required | string Your organization's user id |
| programId | string Your partner's program id |
| estimatedPoints | number |
[- {
- "programId": "string",
- "estimatedPoints": 0
}
]Retrieve annual statistics of point distribution.
| sourceUserId required | string Your organization's user id |
| programId required | string |
| year required | string |
| month | number number of the month (1-12) |
| totalPoints | number total points accumulated in the month |
[- {
- "month": 0,
- "totalPoints": 0
}
]Retrieve program connections for a specific user id.
| sourceUserId required | string The user identifier with your organization - Identifier might be opaque |
| id | string Unique identifier of the program connection. |
| destinationUserId | string The user identifier with the partner. |
| destinationUserEmail | string The user identifier with the partner. |
| destinationUserFirstName | string First name of the destination user. |
| destinationUserLastName | string Last name of the destination user. |
| percentage | number Distribution percentage |
| destinationProgramId | string Your partner's program id. |
| updatedAt | string Date and time of the last update. |
| createdAt | string Date and time of creation. |
[- {
- "id": "string",
- "destinationUserId": "string",
- "destinationUserEmail": "string",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string",
- "percentage": 0,
- "destinationProgramId": "string",
- "updatedAt": "string",
- "createdAt": "string"
}
]Update program connections for a specific user id. This is a batch operation.
| sourceUserId required | string The user identifier with your organization. | ||||||
required | Array of objects List of connections with percentage allocations. | ||||||
Array
| |||||||
| id | string Unique identifier of the program connection. |
| destinationUserId | string The user identifier with the partner. |
| destinationUserEmail | string The user identifier with the partner. |
| destinationUserFirstName | string First name of the destination user. |
| destinationUserLastName | string Last name of the destination user. |
| percentage | number Distribution percentage |
| destinationProgramId | string Your partner's program id. |
| updatedAt | string Date and time of the last update. |
| createdAt | string Date and time of creation. |
{- "sourceUserId": "string",
- "connections": [
- {
- "percentage": 0,
- "destinationProgramId": "string",
- "destinationAccount": {
- "destinationUserId": "string",
- "destinationUserEmail": "user@example.com",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string"
}
}
]
}[- {
- "id": "string",
- "destinationUserId": "string",
- "destinationUserEmail": "string",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string",
- "percentage": 0,
- "destinationProgramId": "string",
- "updatedAt": "string",
- "createdAt": "string"
}
]Retrieve program connections history.
| startDate | string Any valid date representation |
| endDate | string Any valid date representation |
| page | number The number of the page to retrieve |
| pageSize | number The number of items per page (default 25, max 5000) |
| total | number Total number of records. | ||||||||||||||||||
Array of objects | |||||||||||||||||||
Array
| |||||||||||||||||||
{- "total": 0,
- "data": [
- {
- "id": "string",
- "event": "string",
- "destinationProgramId": "string",
- "timestamp": "string",
- "sourceProgramUser": {
- "sourceUserId": "string"
}, - "destinationUserId": "string",
- "destinationUserEmail": "string",
- "destinationUserFirstName": "string",
- "destinationUserLastName": "string"
}
]
}