Affiliate Signup API

The SignUp API is a set of Web API endpoints used to register new affiliates to your affiliate programme. It contains one main POST endpoint for registering affiliates and GET endpoints for retrieving required data, such as the reward plans available during registration.

This API is intended for server-to-server communication.
It should not be made publicly available through the browser. The private key provided for authentication must not be stored where it can be accessed by the end user, as this could compromise your data.

API calls should be made from the backend of your affiliate registration page or through your own affiliate registration API.

The API uses API keys provided by NetRefer during implementation.

API keys are environment-specific. Keys provided for the staging environment only work on api-gatencp.netrefer.com, while production keys only work on api-gate.netrefer.com.

Each call to the API requires the APIKey header to be included in the HTTP request:

Example - Getting a list of subscriptions

HTTP
GET /v3/subscriptions HTTP/1.1
Host: api-gatencp.netrefer.com
APIKey: CYDa278AxSCTnXHBeFoJ9z1kAJzlp9gPVq6O2ue6==
cURL
curl -X GET \
http://api-gatencp.netrefer.com/v3/subscriptions \
-H 'APIKey: CYDa278AxSCTnXHBeFoJ9z1kAJzlp9gPVq6O2ue6==' \
-H 'cache-control: no-cache'
Postman

This document assumes a basic understanding of HTTP web requests and familiarity with the Authentication tab.

An APIKey and OrganisationId are required to use the API. No installation is required. The examples in this documentation use Postman.

Environment

Example URL

Staging
http://api-gatencp.netrefer.com.netrefer.com/v3
Production
https://api-gate-shared02.netrefer.com/v3/org/

https://api-gate-shared03.netrefer.com/v3/org/

The Production API URL to use will be confirmed by NetRefer during the SignUp API implementation, as can vary among Operators.

In this documentation, we will be using a fake OrganisationId. To retrieve your OrganizationID, please see the Subscription Endpoint “subscriptionID”

If you do not know your OrganisationId, use the Subscriptions endpoint to retrieve it.

The OrganisationId does not change and can be reused once obtained.

Getting a list of Organisations

Use the following URL: http://api-gatencp.netrefer.com/v3/Subscriptions

Response

Table
Json
{
"subscriptionID":"d937648e-6fd7-45b3-a38d-dbe5fe4f88ec",
"SubscriptionName": "Subscription 1"
}

Find your Brand

The Brands endpoint returns the available brands and their BrandId. The BrandId is required when using the API.

The BrandId does not change and can be reused once obtained.

Getting a list of brands example:

Use the following URL: http://api-gatencp.netrefer.com/v3/org/d937648e-6fd7-45b3- a38d-dbe5fe4f88ec/brands

A successful call will return an Array of Brand Items
Table
Json
{
"ID":2,
"Name": "LlamaCasino"
}

Next

Refer to the Common Errors and Suggested Troubleshooting tab for error codes and information on common issues.

Refer to the API Details tab for information on the data available through the API.

 

Suggested Troubleshooting

401 Unauthorised 

Check that:

  • The APIKey is included in the request headers.

  • The header key is APIKey.

  • The APIKey matches the environment. Staging and production use different API keys.

403 Forbidden 

Check that:

  • The OrganisationID is correctly positioned after /org/ in the URL.

  • The correct OrganisationID is being used.

  • If you have access to multiple Organisations, the APIKey corresponds to the required Organisation.

400 Bad Request 

Check that:

  • The JSON is correctly formatted, including required commas.

  • A valid country and country code are being used.

  • The specified Brand ID, Payment Method ID, Reward Plan ID and other required IDs exist.

  • The request does not contain the < or > characters in text fields.

  • The required details are included in the request body.

  • All required fields are included.

404 Not Found Terms of Service API 

Check that:

  • The Terms of Service feature is enabled.

  • Terms of Service have been configured in the system.

No response when posting a new affiliate

If a new affiliate is created successfully but no response is received, common causes include:

  • Email Server settings are missing.

  • Email Server settings are incorrect, such as an incorrect port configuration.

Common Errors

This section describes common API error codes and how to resolve them.

Error codes identify validation, authorisation and configuration issues that can occur when using the API.

If an error code or issue is not listed here, refer to the API-specific documentation for more information.

Common errors are related to APIKey configuration, Organisation access, request validation and Terms of Service configuration. Check the error message and relevant API configuration to identify the cause.