List usage records
curl --request POST \
--url https://us.api.flexprice.io/v1/usage-records/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"currency": "<string>",
"customer_external_id": "<string>",
"customer_id": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"expand": "<string>",
"filters": [
{
"field": "<string>",
"value": {
"array": [
"<string>"
],
"boolean": true,
"date": "<string>",
"number": 123,
"string": "<string>"
}
}
],
"limit": 500,
"offset": 1,
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"plan_id": "<string>",
"sort": [
{
"field": "<string>"
}
],
"start_time": "2023-11-07T05:31:56Z",
"subscription_id": "<string>",
"synced": true
}
'import requests
url = "https://us.api.flexprice.io/v1/usage-records/search"
payload = {
"currency": "<string>",
"customer_external_id": "<string>",
"customer_id": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"expand": "<string>",
"filters": [
{
"field": "<string>",
"value": {
"array": ["<string>"],
"boolean": True,
"date": "<string>",
"number": 123,
"string": "<string>"
}
}
],
"limit": 500,
"offset": 1,
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"plan_id": "<string>",
"sort": [{ "field": "<string>" }],
"start_time": "2023-11-07T05:31:56Z",
"subscription_id": "<string>",
"synced": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: '<string>',
customer_external_id: '<string>',
customer_id: '<string>',
end_time: '2023-11-07T05:31:56Z',
expand: '<string>',
filters: [
{
field: '<string>',
value: {
array: ['<string>'],
boolean: true,
date: '<string>',
number: 123,
string: '<string>'
}
}
],
limit: 500,
offset: 1,
period_end: '2023-11-07T05:31:56Z',
period_start: '2023-11-07T05:31:56Z',
plan_id: '<string>',
sort: [{field: '<string>'}],
start_time: '2023-11-07T05:31:56Z',
subscription_id: '<string>',
synced: true
})
};
fetch('https://us.api.flexprice.io/v1/usage-records/search', 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://us.api.flexprice.io/v1/usage-records/search",
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([
'currency' => '<string>',
'customer_external_id' => '<string>',
'customer_id' => '<string>',
'end_time' => '2023-11-07T05:31:56Z',
'expand' => '<string>',
'filters' => [
[
'field' => '<string>',
'value' => [
'array' => [
'<string>'
],
'boolean' => true,
'date' => '<string>',
'number' => 123,
'string' => '<string>'
]
]
],
'limit' => 500,
'offset' => 1,
'period_end' => '2023-11-07T05:31:56Z',
'period_start' => '2023-11-07T05:31:56Z',
'plan_id' => '<string>',
'sort' => [
[
'field' => '<string>'
]
],
'start_time' => '2023-11-07T05:31:56Z',
'subscription_id' => '<string>',
'synced' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://us.api.flexprice.io/v1/usage-records/search"
payload := strings.NewReader("{\n \"currency\": \"<string>\",\n \"customer_external_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"expand\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"array\": [\n \"<string>\"\n ],\n \"boolean\": true,\n \"date\": \"<string>\",\n \"number\": 123,\n \"string\": \"<string>\"\n }\n }\n ],\n \"limit\": 500,\n \"offset\": 1,\n \"period_end\": \"2023-11-07T05:31:56Z\",\n \"period_start\": \"2023-11-07T05:31:56Z\",\n \"plan_id\": \"<string>\",\n \"sort\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"subscription_id\": \"<string>\",\n \"synced\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://us.api.flexprice.io/v1/usage-records/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"<string>\",\n \"customer_external_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"expand\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"array\": [\n \"<string>\"\n ],\n \"boolean\": true,\n \"date\": \"<string>\",\n \"number\": 123,\n \"string\": \"<string>\"\n }\n }\n ],\n \"limit\": 500,\n \"offset\": 1,\n \"period_end\": \"2023-11-07T05:31:56Z\",\n \"period_start\": \"2023-11-07T05:31:56Z\",\n \"plan_id\": \"<string>\",\n \"sort\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"subscription_id\": \"<string>\",\n \"synced\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.flexprice.io/v1/usage-records/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"<string>\",\n \"customer_external_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"expand\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"array\": [\n \"<string>\"\n ],\n \"boolean\": true,\n \"date\": \"<string>\",\n \"number\": 123,\n \"string\": \"<string>\"\n }\n }\n ],\n \"limit\": 500,\n \"offset\": 1,\n \"period_end\": \"2023-11-07T05:31:56Z\",\n \"period_start\": \"2023-11-07T05:31:56Z\",\n \"plan_id\": \"<string>\",\n \"sort\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"subscription_id\": \"<string>\",\n \"synced\": true\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"customer_external_id": "<string>",
"customer_id": "<string>",
"environment_id": "<string>",
"id": "<string>",
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"plan_id": "<string>",
"quantity": 123,
"status": "published",
"subscription_id": "<string>",
"synced": true,
"syncs": {},
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Usage Records
List usage records
Lists usage records. Also accepts filters/sort for a filtered query.
POST
/
usage-records
/
search
List usage records
curl --request POST \
--url https://us.api.flexprice.io/v1/usage-records/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"currency": "<string>",
"customer_external_id": "<string>",
"customer_id": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"expand": "<string>",
"filters": [
{
"field": "<string>",
"value": {
"array": [
"<string>"
],
"boolean": true,
"date": "<string>",
"number": 123,
"string": "<string>"
}
}
],
"limit": 500,
"offset": 1,
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"plan_id": "<string>",
"sort": [
{
"field": "<string>"
}
],
"start_time": "2023-11-07T05:31:56Z",
"subscription_id": "<string>",
"synced": true
}
'import requests
url = "https://us.api.flexprice.io/v1/usage-records/search"
payload = {
"currency": "<string>",
"customer_external_id": "<string>",
"customer_id": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"expand": "<string>",
"filters": [
{
"field": "<string>",
"value": {
"array": ["<string>"],
"boolean": True,
"date": "<string>",
"number": 123,
"string": "<string>"
}
}
],
"limit": 500,
"offset": 1,
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"plan_id": "<string>",
"sort": [{ "field": "<string>" }],
"start_time": "2023-11-07T05:31:56Z",
"subscription_id": "<string>",
"synced": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: '<string>',
customer_external_id: '<string>',
customer_id: '<string>',
end_time: '2023-11-07T05:31:56Z',
expand: '<string>',
filters: [
{
field: '<string>',
value: {
array: ['<string>'],
boolean: true,
date: '<string>',
number: 123,
string: '<string>'
}
}
],
limit: 500,
offset: 1,
period_end: '2023-11-07T05:31:56Z',
period_start: '2023-11-07T05:31:56Z',
plan_id: '<string>',
sort: [{field: '<string>'}],
start_time: '2023-11-07T05:31:56Z',
subscription_id: '<string>',
synced: true
})
};
fetch('https://us.api.flexprice.io/v1/usage-records/search', 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://us.api.flexprice.io/v1/usage-records/search",
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([
'currency' => '<string>',
'customer_external_id' => '<string>',
'customer_id' => '<string>',
'end_time' => '2023-11-07T05:31:56Z',
'expand' => '<string>',
'filters' => [
[
'field' => '<string>',
'value' => [
'array' => [
'<string>'
],
'boolean' => true,
'date' => '<string>',
'number' => 123,
'string' => '<string>'
]
]
],
'limit' => 500,
'offset' => 1,
'period_end' => '2023-11-07T05:31:56Z',
'period_start' => '2023-11-07T05:31:56Z',
'plan_id' => '<string>',
'sort' => [
[
'field' => '<string>'
]
],
'start_time' => '2023-11-07T05:31:56Z',
'subscription_id' => '<string>',
'synced' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://us.api.flexprice.io/v1/usage-records/search"
payload := strings.NewReader("{\n \"currency\": \"<string>\",\n \"customer_external_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"expand\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"array\": [\n \"<string>\"\n ],\n \"boolean\": true,\n \"date\": \"<string>\",\n \"number\": 123,\n \"string\": \"<string>\"\n }\n }\n ],\n \"limit\": 500,\n \"offset\": 1,\n \"period_end\": \"2023-11-07T05:31:56Z\",\n \"period_start\": \"2023-11-07T05:31:56Z\",\n \"plan_id\": \"<string>\",\n \"sort\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"subscription_id\": \"<string>\",\n \"synced\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://us.api.flexprice.io/v1/usage-records/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"<string>\",\n \"customer_external_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"expand\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"array\": [\n \"<string>\"\n ],\n \"boolean\": true,\n \"date\": \"<string>\",\n \"number\": 123,\n \"string\": \"<string>\"\n }\n }\n ],\n \"limit\": 500,\n \"offset\": 1,\n \"period_end\": \"2023-11-07T05:31:56Z\",\n \"period_start\": \"2023-11-07T05:31:56Z\",\n \"plan_id\": \"<string>\",\n \"sort\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"subscription_id\": \"<string>\",\n \"synced\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.flexprice.io/v1/usage-records/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"<string>\",\n \"customer_external_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"expand\": \"<string>\",\n \"filters\": [\n {\n \"field\": \"<string>\",\n \"value\": {\n \"array\": [\n \"<string>\"\n ],\n \"boolean\": true,\n \"date\": \"<string>\",\n \"number\": 123,\n \"string\": \"<string>\"\n }\n }\n ],\n \"limit\": 500,\n \"offset\": 1,\n \"period_end\": \"2023-11-07T05:31:56Z\",\n \"period_start\": \"2023-11-07T05:31:56Z\",\n \"plan_id\": \"<string>\",\n \"sort\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"subscription_id\": \"<string>\",\n \"synced\": true\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"customer_external_id": "<string>",
"customer_id": "<string>",
"environment_id": "<string>",
"id": "<string>",
"period_end": "2023-11-07T05:31:56Z",
"period_start": "2023-11-07T05:31:56Z",
"plan_id": "<string>",
"quantity": 123,
"status": "published",
"subscription_id": "<string>",
"synced": true,
"syncs": {},
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Body
application/json
Usage record filter
Generic predicate and ordering escape hatch, for comparisons that have no dedicated field below — a range such as period_end at or after a cutoff goes here.
Show child attributes
Show child attributes
Required range:
1 <= x <= 1000Required range:
x >= 0Available options:
asc, desc Exact-match on the window boundaries. Together with SubscriptionID these identify a single row: they are the columns the table's unique index is built on.
Show child attributes
Show child attributes
Available options:
published, deleted, archived ⌘I

