Reconcile a usage subscription
curl --request POST \
--url https://api.example.com/v1/usage-billing/subscriptions/{id}/sync \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{}'import requests
url = "https://api.example.com/v1/usage-billing/subscriptions/{id}/sync"
payload = {}
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({})
};
fetch('https://api.example.com/v1/usage-billing/subscriptions/{id}/sync', 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://api.example.com/v1/usage-billing/subscriptions/{id}/sync",
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([
]),
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://api.example.com/v1/usage-billing/subscriptions/{id}/sync"
payload := strings.NewReader("{}")
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://api.example.com/v1/usage-billing/subscriptions/{id}/sync")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/usage-billing/subscriptions/{id}/sync")
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 = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"autoRenewEnabled": false,
"cancelAtPeriodEnd": false,
"createdAt": "2026-10-13T12:00:00.000Z",
"currency": "EUR",
"customerRef": "customer_123",
"id": "22222222-2222-4222-8222-222222222222",
"includedCredits": "1000",
"monthlyPrice": "20.00",
"notificationEmailConfigured": false,
"notificationEnabled": false,
"notificationLocale": "en",
"overageAmount": "0.00",
"overageCredits": "0",
"overageLimit": "10.00",
"overageUnitPrice": "0.01",
"paymentState": "pay_by_link",
"periodEnd": null,
"periodStart": null,
"planId": "11111111-1111-4111-8111-111111111111",
"planName": "Starter",
"remainingCredits": "0",
"status": "pending_payment",
"unit": "request",
"usedCredits": "0"
}
}{
"errorCode": "USAGE_INPUT_INVALID",
"message": "USAGE_INPUT_INVALID",
"statusCode": 400
}{
"error": "Unauthorized",
"message": "Invalid API key",
"statusCode": 401
}{
"errorCode": "USAGE_SCOPE_INACTIVE",
"statusCode": 403
}{
"errorCode": "USAGE_SUBSCRIPTION_NOT_FOUND",
"statusCode": 404
}{
"errorCode": "USAGE_EVENT_CONFLICT",
"statusCode": 409
}{
"errorCode": "IDEMPOTENCY_KEY_REUSED",
"statusCode": 422
}{
"error": "RATE_LIMITED",
"errorCode": "RATE_LIMITED",
"message": "Too many requests. Retry after the indicated delay.",
"status": false,
"statusCode": 429
}{
"errorCode": "UPSTREAM_UNAVAILABLE",
"statusCode": 502
}{
"error": "Service Unavailable",
"message": "API_KEY_VALIDATION_UNAVAILABLE",
"statusCode": 503
}{
"errorCode": "UPSTREAM_TIMEOUT",
"statusCode": 504
}Usage billing
Reconcile a usage subscription
Reconcile confirmed invoice payments and period boundaries for this subscription. Repeating this request is safe. When automatic renewal is enabled, this operation can advance the persisted Stripe payment attempt; otherwise it reconciles payment links. Scope comes from the authenticated API key.
POST
/
v1
/
usage-billing
/
subscriptions
/
{id}
/
sync
Reconcile a usage subscription
curl --request POST \
--url https://api.example.com/v1/usage-billing/subscriptions/{id}/sync \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{}'import requests
url = "https://api.example.com/v1/usage-billing/subscriptions/{id}/sync"
payload = {}
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({})
};
fetch('https://api.example.com/v1/usage-billing/subscriptions/{id}/sync', 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://api.example.com/v1/usage-billing/subscriptions/{id}/sync",
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([
]),
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://api.example.com/v1/usage-billing/subscriptions/{id}/sync"
payload := strings.NewReader("{}")
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://api.example.com/v1/usage-billing/subscriptions/{id}/sync")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/usage-billing/subscriptions/{id}/sync")
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 = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"autoRenewEnabled": false,
"cancelAtPeriodEnd": false,
"createdAt": "2026-10-13T12:00:00.000Z",
"currency": "EUR",
"customerRef": "customer_123",
"id": "22222222-2222-4222-8222-222222222222",
"includedCredits": "1000",
"monthlyPrice": "20.00",
"notificationEmailConfigured": false,
"notificationEnabled": false,
"notificationLocale": "en",
"overageAmount": "0.00",
"overageCredits": "0",
"overageLimit": "10.00",
"overageUnitPrice": "0.01",
"paymentState": "pay_by_link",
"periodEnd": null,
"periodStart": null,
"planId": "11111111-1111-4111-8111-111111111111",
"planName": "Starter",
"remainingCredits": "0",
"status": "pending_payment",
"unit": "request",
"usedCredits": "0"
}
}{
"errorCode": "USAGE_INPUT_INVALID",
"message": "USAGE_INPUT_INVALID",
"statusCode": 400
}{
"error": "Unauthorized",
"message": "Invalid API key",
"statusCode": 401
}{
"errorCode": "USAGE_SCOPE_INACTIVE",
"statusCode": 403
}{
"errorCode": "USAGE_SUBSCRIPTION_NOT_FOUND",
"statusCode": 404
}{
"errorCode": "USAGE_EVENT_CONFLICT",
"statusCode": 409
}{
"errorCode": "IDEMPOTENCY_KEY_REUSED",
"statusCode": 422
}{
"error": "RATE_LIMITED",
"errorCode": "RATE_LIMITED",
"message": "Too many requests. Retry after the indicated delay.",
"status": false,
"statusCode": 429
}{
"errorCode": "UPSTREAM_UNAVAILABLE",
"statusCode": 502
}{
"error": "Service Unavailable",
"message": "API_KEY_VALIDATION_UNAVAILABLE",
"statusCode": 503
}{
"errorCode": "UPSTREAM_TIMEOUT",
"statusCode": 504
}