Invoices Report
curl --request POST \
--url https://brokers.newyorkcityservers.com/api/v1/reports/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
"[email protected]",
"[email protected]"
],
"start_date": "2026-01-01",
"end_date": "2026-01-31"
}
'import requests
url = "https://brokers.newyorkcityservers.com/api/v1/reports/invoices"
payload = {
"recipients": ["[email protected]", "[email protected]"],
"start_date": "2026-01-01",
"end_date": "2026-01-31"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
recipients: ['[email protected]', '[email protected]'],
start_date: '2026-01-01',
end_date: '2026-01-31'
})
};
fetch('https://brokers.newyorkcityservers.com/api/v1/reports/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brokers.newyorkcityservers.com/api/v1/reports/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'recipients' => [
'[email protected]',
'[email protected]'
],
'start_date' => '2026-01-01',
'end_date' => '2026-01-31'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://brokers.newyorkcityservers.com/api/v1/reports/invoices"
payload := strings.NewReader("{\n \"recipients\": [\n \"[email protected]\",\n \"[email protected]\"\n ],\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-01-31\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://brokers.newyorkcityservers.com/api/v1/reports/invoices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n \"[email protected]\",\n \"[email protected]\"\n ],\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-01-31\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brokers.newyorkcityservers.com/api/v1/reports/invoices")
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 \"recipients\": [\n \"[email protected]\",\n \"[email protected]\"\n ],\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-01-31\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"report_type": "invoices",
"total_invoices": 28,
"paid_invoices": 22,
"unpaid_invoices": 6,
"recipients_sent": 2,
"recipients_failed": 0,
"date_range": {
"start": "2026-01-01",
"end": "2026-01-31"
},
"generated_at": "2026-02-01T10:30:00.000Z"
}
}Invoices Report
Generate an invoice report and send it to email recipients.
POST
/
v1
/
reports
/
invoices
Invoices Report
curl --request POST \
--url https://brokers.newyorkcityservers.com/api/v1/reports/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
"[email protected]",
"[email protected]"
],
"start_date": "2026-01-01",
"end_date": "2026-01-31"
}
'import requests
url = "https://brokers.newyorkcityservers.com/api/v1/reports/invoices"
payload = {
"recipients": ["[email protected]", "[email protected]"],
"start_date": "2026-01-01",
"end_date": "2026-01-31"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
recipients: ['[email protected]', '[email protected]'],
start_date: '2026-01-01',
end_date: '2026-01-31'
})
};
fetch('https://brokers.newyorkcityservers.com/api/v1/reports/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brokers.newyorkcityservers.com/api/v1/reports/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'recipients' => [
'[email protected]',
'[email protected]'
],
'start_date' => '2026-01-01',
'end_date' => '2026-01-31'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://brokers.newyorkcityservers.com/api/v1/reports/invoices"
payload := strings.NewReader("{\n \"recipients\": [\n \"[email protected]\",\n \"[email protected]\"\n ],\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-01-31\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://brokers.newyorkcityservers.com/api/v1/reports/invoices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n \"[email protected]\",\n \"[email protected]\"\n ],\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-01-31\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brokers.newyorkcityservers.com/api/v1/reports/invoices")
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 \"recipients\": [\n \"[email protected]\",\n \"[email protected]\"\n ],\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-01-31\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"report_type": "invoices",
"total_invoices": 28,
"paid_invoices": 22,
"unpaid_invoices": 6,
"recipients_sent": 2,
"recipients_failed": 0,
"date_range": {
"start": "2026-01-01",
"end": "2026-01-31"
},
"generated_at": "2026-02-01T10:30:00.000Z"
}
}Generate a report for the
paid and pending invoices in a date range. The endpoint sends an Excel .xls file to each valid recipient. It does not return the file in the HTTP response.
The full endpoint is POST /api/v1/reports/invoices.
Errors
Error responses usesuccess: false and an error object.
| HTTP status | Error code | Message or cause |
|---|---|---|
400 | invalid_request | The body is not valid JSON. The message is Invalid JSON in request body. |
400 | missing_parameter | recipients is missing or is null. The response details list recipients as required. |
400 | invalid_parameter | recipients is not an array, an item is not a string, an address is invalid, or no nonempty address remains. The response details contain max_recipients: 10. |
400 | too_many_recipients | More than 10 unique normalized recipients remain. |
400 | missing_parameter | start_date or end_date is missing or empty. The response details list both date fields as required. |
400 | invalid_parameter | A date does not use YYYY-MM-DD, a date value cannot be parsed, or start_date is after end_date. |
400 | no_data | No paid or pending invoice matches the date range. The response details contain the requested dates. |
401 | authentication_failed | The Bearer token is missing, invalid, inactive, or expired. |
403 | insufficient_permissions | The request IP is not allowed, or the key does not have reports:generate or admin:full. |
429 | rate_limit_exceeded | The key reached its rate limit. Use the Retry-After response header. |
500 | server_error | The API could not get broker configuration, get invoice data, generate the report, or complete an internal operation. Individual email send failures use the recipient counts in an HTTP 200 response. |
Authorizations
Send the API key in the Authorization bearer header. Production keys begin with sk_live_.
Body
application/json
Last modified on August 2, 2026
⌘I

