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

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

Retrieve the commission earned on each trade completed by an affiliate's customers during a statement month. Each commission record includes the `dealnumber` of the trade that earned it.

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


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

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

- `commissions` (list of MonthlyCommission, required) — Array of commission objects containing the commission earned on each trade 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

### MonthlyCommission

Commission earned on a single trade.

- `commissionamount` (string, required) — Commission earned on the trade, in `commissionamountcurrency`. Returned as a string representation of a decimal with 2 decimal places.
- `tier` (string, required) — Commission tier applied to the trade.
- `commissionpaidamount` (string, required) — Commission paid to the affiliate, in `comissionpaymentcurrency`. Returned as a string representation of a decimal with 2 decimal places.
- `comissionpaymentcurrency` (string, required) — Currency the commission was paid in, in [ISO 4217 Currency Codes](https://en.wikipedia.org/wiki/ISO_4217) three-letter format (e.g., GBP, USD, EUR).
- `exchangerate` (string, required) — Exchange rate used to convert `commissionamount` to `commissionpaidamount`. Returned as a string representation of a decimal with 6 decimal places.
- `commissionamountcurrency` (string, required) — Currency of `commissionamount`, in [ISO 4217 Currency Codes](https://en.wikipedia.org/wiki/ISO_4217) three-letter format (e.g., GBP, USD, EUR).
- `comissionpaiddate` (date, required) — Date the commission was paid, in `YYYY-MM-DD` format.
- `dealnumber` (string, required) — Unique identifier of the trade that earned the commission. Matches `dealnumber` in the [Get Monthly Trades](/api-reference/affiliate-reporting/get-monthly-trades) response.

## Examples

**Request**

```json
{
  "affiliate_number": [
    "A060001"
  ],
  "statement_year": "2023",
  "statement_month": "2"
}
```

**Response**

```json
{
  "commissions": [
    {
      "commissionamount": "23.31",
      "tier": "1",
      "commissionpaidamount": "26.20",
      "comissionpaymentcurrency": "EUR",
      "exchangerate": "1.123820",
      "commissionamountcurrency": "GBP",
      "comissionpaiddate": "2023-02-02",
      "dealnumber": "0101000000163848-000000007"
    },
    {
      "commissionamount": "106.51",
      "tier": "1",
      "commissionpaidamount": "119.70",
      "comissionpaymentcurrency": "EUR",
      "exchangerate": "1.123820",
      "commissionamountcurrency": "GBP",
      "comissionpaiddate": "2023-02-02",
      "dealnumber": "0101000006061046-000000004"
    }
  ]
}
```

**SDK Code**

```python Monthly Commissions
import requests

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

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

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

print(response.json())
```

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

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

```go Monthly Commissions
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"affiliate_number\": [\n    \"A060001\"\n  ],\n  \"statement_year\": \"2023\",\n  \"statement_month\": \"2\"\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 Commissions
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v1/affiliates/commission/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\": \"2023\",\n  \"statement_month\": \"2\"\n}"

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

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

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Monthly Commissions
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v1/affiliates/commission/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\": \"2023\",\n  \"statement_month\": \"2\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Monthly Commissions
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v1/affiliates/commission/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()
```