API Endpoints

Overview of the Conversion API

Endpoint

POST /api/v2/conversion

Description

This API records conversion events and calculates rewards based on the reward type of the conversion point.

Request Specifications

Parameters
Type
Required/Optional
Description

x-api-key

string

Required

Project-Specific Unique API Key

Content-Type

string

Required

Request Body Format (set to application/json)

Request Body

Parameters
Type
Required/Optional
Description

trackingId

string

Required

An ID to identify the tracking.

conversionId

string

Required

An ID to identify the conversion point.

Success Example

curl -X POST "https://www.0xqube.xyz/api/v2/conversion" \\
     -H "x-api-key: <Unique API key for the project>" \\
     -H "Content-Type: application/json" \\
     -d '{
           "trackingId": "<Tracking ID>",
           "conversionId": "<Conversion ID>"
         }'

Response Specifications

On Success

Status Code
Description

200 OK

The conversion was successfully recorded.

Response Example

When the API is called for a non-active conversion point

Status Code
Description

200 OK

The specified conversion point is inactive.

Response Example

Reason

This response is returned when the conversion point is inactive. In this case, neither the conversion is recorded nor the reward calculated.

The project creator (admin) may have intentionally deactivated specific conversion points temporarily.

Solution

Contact the project creator (admin) and request them to activate the conversion point if necessary.

When the API is called for a conversion that has already been recorded

Status Code
Description

200 OK

The conversion for this conversion point has already been recorded..

Response Example

Reason

This response is returned when a conversion has already been recorded for the given trackingId and conversionId. To prevent duplicate records and rewards, the API skips further processing in such cases.

Solution

No action is required unless this was triggered by mistake. Ensure the conversion is only triggered once per user per conversion point.

On Error

All errors are returned in the following format.

Status Code
Error Code
Description
Error Handling

400

MISSING_API_KEY

The API key is not specified.

Obtain the unique API key for the project from the Qube dashboard and include it in the API header.

400

INVALID_REQUEST

The request body is invalid.

Ensure that all parameters in the request body are set with correct values.

400

CONVERSION_POINT_NOT_FOUND

The conversion point does not exist.

Please verify that the conversion ID is correct.

403

INVALID_API_KEY

The API key is invalid or access has been denied.

The API key may be incorrect. Please retrieve it again from the dashboard and update your settings. If the same error persists, the API key may have been deactivated. In this case, please contact Qube support for assistance.

404

PROJECT_NOT_FOUND

The specified project does not exist.

Please contact Qube support for assistance.

429

RATE_LIMIT_EXCEEDED

The number of requests has exceeded the rate limit.

Please wait and try again later.

500

PROJECT_FETCH_ERROR

Failed to retrieve project data.

Please contact Qube support for assistance.

500

INTERNAL_SERVER_ERROR

An internal server error has occurred.

Please wait and try again later. If the issue persists, contact Qube support for assistance.

Last updated

Was this helpful?