> 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 Referrals

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

Retrieve the referrals submitted under one or more affiliate numbers during a statement month. A referral is a potential customer that an affiliate partner passed to Redpin. A referral does not mean the customer has registered.

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


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

## 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 referrals retrieved successfully.

- `referrals` (list of MonthlyReferral, required) — Array of referral objects containing details of all referrals submitted 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

### MonthlyReferral

A referral submitted under one of the requested affiliate numbers.

- `uid` (string, required) — Unique identifier of the referral, as supplied by the affiliate. Returns `null` if no identifier was supplied.
- `type` (string, required) — Type of customer referred. Possible values are `Personal` or `Business`.
- `datereferred` (date, required) — Date the referral was submitted, in `YYYY-MM-DD` format.
- `estimatedtransactionalvalue` (string, required) — Estimated transaction value band selected for the customer (e.g., `Under 2,000`, `2,000-5,000`).
- `trackingid` (string, required) — Campaign tracking identifier associated with the referral. Returns `null` if no tracking identifier was supplied.

## Examples

**Request**

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

**Response**

```json
{
  "referrals": [
    {
      "uid": "3ftAsGKFbv",
      "type": "Personal",
      "datereferred": "2022-07-12",
      "estimatedtransactionalvalue": "2,000-5,000",
      "trackingid": "TRK10234"
    },
    {
      "uid": "7hQwRt2LmX",
      "type": "Personal",
      "datereferred": "2022-07-20",
      "estimatedtransactionalvalue": "Under 2,000",
      "trackingid": "TRK10234"
    }
  ]
}
```

**SDK Code**

```python Monthly Referrals
import requests

url = "https://sandbox.currenciesdirect.com/v1/affiliates/referrals/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 Referrals
const url = 'https://sandbox.currenciesdirect.com/v1/affiliates/referrals/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 Referrals
package main

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

func main() {

	url := "https://sandbox.currenciesdirect.com/v1/affiliates/referrals/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 Referrals
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v1/affiliates/referrals/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 Referrals
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.currenciesdirect.com/v1/affiliates/referrals/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 Referrals
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Monthly Referrals
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v1/affiliates/referrals/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 Referrals
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/referrals/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()
```