> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.redpincompany.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.redpincompany.com/_mcp/server.

# Get Monthly Registrations

POST https://sandbox.currenciesdirect.com/v1/affiliates/registrations/month
Content-Type: application/json

Retrieve the customers who arrived from an affiliate website and registered with Redpin during a statement month. Each registration includes the customer's `clientid`, which also appears in the [Get Monthly Trades](/api-reference/affiliate-reporting/get-monthly-trades) response.

**Authentication:** [Bearer token required](/api-guide/getting-started/authentication#oauth-20-authentication)


Reference: https://docs.redpincompany.com/api-reference/affiliate-reporting/get-monthly-registrations

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 Bearer token authentication. This API uses OAuth 2.0 Client Credentials flow. Please refer to the [Authentication](/api-guide/getting-started/authentication#oauth-20-authentication) section for detailed information on how to obtain and use your OAuth credentials.

## Servers

- `https://sandbox.currenciesdirect.com` (Sandbox, default)
- `https://api.redpincompany.com` (Production)

## Request

### Body (application/json)

This endpoint expects a StatementMonthRequest.

- `affiliate_number` (list of string, required) — List of affiliate numbers to include in the report. Redpin issues an affiliate number to each affiliate partner. Records for all listed affiliate numbers are returned together in a single response.
- `statement_year` (string, required) — Year of the statement period in four-digit format (e.g., 2022). Sent as a string.
- `statement_month` (string, required) — Month of the statement period as a number from 1 to 12 (e.g., 7 for July). Sent as a string.

## Response

### 200

OK. Everything worked as expected. Monthly registrations retrieved successfully.

- `registrations` (list of MonthlyRegistration, required) — Array of registration objects containing details of all customers who registered during the statement month.

## Errors

### 400 Bad Request Error

Bad Request. Malformed request. You will receive this error if the request body does not validate with the schema. The error code will help you determine the cause of the issue.

- `code` (string, required) — Machine-readable error code.
- `description` (string, required) — Human-readable error description.

### 401 Unauthorized Error

Unauthorized. You have not included a valid Access token, it has expired, or you entered incorrect credentials.

- `code` (string, required) — Machine-readable error code.
- `description` (string, required) — Human-readable error description.

### 500 Internal Server Error

Internal Server Error. Something has gone wrong on the website's server, but the server could not be more specific on what the exact problem is.

- `code` (string, required) — Machine-readable error code.
- `description` (string, required) — Human-readable error description.

## Types

### MonthlyRegistration

A customer who arrived from an affiliate website and registered with Redpin.

- `uid` (string, required) — Unique identifier of the referral, as supplied by the affiliate. Returns `null` if no identifier was supplied.
- `clientid` (string, required) — Redpin client identifier of the registered customer. Use this value to link the customer to their trades in the [Get Monthly Trades](/api-reference/affiliate-reporting/get-monthly-trades) response.
- `type` (string, required) — Type of customer registered. Possible values are `Personal` or `Business`.
- `dateregistered` (date, required) — Date the customer registered, in `YYYY-MM-DD` format.
- `estimatedtransactionalvalue` (string, required) — Estimated transaction value band selected by the customer (e.g., `Under 2,000`, `2,000-5,000`).
- `trackingid` (string, required) — Campaign tracking identifier associated with the registration. Returns `null` if no tracking identifier was supplied.

## Examples

**Request**

```json
{
  "affiliate_number": [
    "A060001"
  ],
  "statement_year": "2022",
  "statement_month": "7"
}
```

**Response**

```json
{
  "registrations": [
    {
      "uid": "7hQwRt2LmX",
      "clientid": "0201001006802081",
      "type": "Personal",
      "dateregistered": "2022-07-12",
      "estimatedtransactionalvalue": "2,000-5,000",
      "trackingid": "TRK10234"
    }
  ]
}
```

**SDK Code**

```python Monthly Registrations
import requests

url = "https://sandbox.currenciesdirect.com/v1/affiliates/registrations/month"

payload = {
    "affiliate_number": ["A060001"],
    "statement_year": "2022",
    "statement_month": "7"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Monthly Registrations
const url = 'https://sandbox.currenciesdirect.com/v1/affiliates/registrations/month';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"affiliate_number":["A060001"],"statement_year":"2022","statement_month":"7"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Monthly Registrations
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.currenciesdirect.com/v1/affiliates/registrations/month"

	payload := strings.NewReader("{\n  \"affiliate_number\": [\n    \"A060001\"\n  ],\n  \"statement_year\": \"2022\",\n  \"statement_month\": \"7\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Monthly Registrations
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v1/affiliates/registrations/month")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"affiliate_number\": [\n    \"A060001\"\n  ],\n  \"statement_year\": \"2022\",\n  \"statement_month\": \"7\"\n}"

response = http.request(request)
puts response.read_body
```

```java Monthly Registrations
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.currenciesdirect.com/v1/affiliates/registrations/month")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"affiliate_number\": [\n    \"A060001\"\n  ],\n  \"statement_year\": \"2022\",\n  \"statement_month\": \"7\"\n}")
  .asString();
```

```php Monthly Registrations
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.currenciesdirect.com/v1/affiliates/registrations/month', [
  'body' => '{
  "affiliate_number": [
    "A060001"
  ],
  "statement_year": "2022",
  "statement_month": "7"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Monthly Registrations
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v1/affiliates/registrations/month");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"affiliate_number\": [\n    \"A060001\"\n  ],\n  \"statement_year\": \"2022\",\n  \"statement_month\": \"7\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Monthly Registrations
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "affiliate_number": ["A060001"],
  "statement_year": "2022",
  "statement_month": "7"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v1/affiliates/registrations/month")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```