curl --request GET \
--url https://api.paygentic.io/v2/invoices/projected \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v2/invoices/projected"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v2/invoices/projected', 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.paygentic.io/v2/invoices/projected",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v2/invoices/projected"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paygentic.io/v2/invoices/projected")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v2/invoices/projected")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "<string>",
"object": "invoice",
"autoApprove": true,
"billingAnchor": "2023-11-07T05:31:56Z",
"billingCadence": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"currency": "<string>",
"gracePeriodEnd": "2023-11-07T05:31:56Z",
"grandTotal": "<string>",
"itemCount": 123,
"merchantId": "<string>",
"paidAmount": "<string>",
"periodEnd": "2023-11-07T05:31:56Z",
"periodStart": "2023-11-07T05:31:56Z",
"sequenceNumber": 123,
"status": "ACTIVE",
"subscriptionId": "<string>",
"customerId": "<string>",
"subtotal": "<string>",
"totalTax": "<string>",
"unpaidAmount": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"failureReason": "<string>",
"paymentInFlight": true,
"invoiceNumber": "<string>",
"lineItems": {
"invoiceId": "<string>",
"lineItems": [
{
"eventType": "usage",
"eventId": "<string>",
"eventSourceId": "<string>",
"billableMetricId": "<string>",
"invoiceDisplayName": "<string>",
"lineItemType": "charge",
"meterEventId": "<string>",
"metricDescription": "<string>",
"metricName": "<string>",
"metricUnit": "<string>",
"quantity": 123,
"taxRate": 123,
"totalAmount": "<string>",
"totalPrice": "<string>",
"totalTax": "<string>",
"unitPrice": "<string>",
"itemId": "<string>",
"priceId": "<string>",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"paymentTerm": "in_advance"
}
],
"totalCount": 123,
"items": [
{
"id": "<string>",
"name": "<string>",
"catalogId": "<string>",
"archivedAt": "2023-11-07T05:31:56Z",
"externalReferences": [
{
"id": "<string>",
"object": "externalReference",
"merchantId": "<string>",
"entityType": "item",
"entityId": "<string>",
"provider": "<string>",
"externalId": "<string>",
"metadata": {},
"isPrimary": true,
"isDefault": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"externalLabel": "<string>"
}
]
}
],
"nextPageToken": "<string>"
},
"metadata": {},
"nextActionAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"issuedAt": "2023-11-07T05:31:56Z",
"dueAt": "2023-11-07T05:31:56Z",
"paymentUrl": "<string>",
"pdfUrl": "<string>",
"pdfSource": "paygentic",
"documentWithheldReason": "tax_unreconciled",
"permalink": "<string>",
"tax": {
"actualTax": "<string>",
"adjustmentApplied": true,
"adjustmentNeeded": true,
"difference": "<string>",
"estimatedTax": "<string>",
"reconciled": true,
"reconciledAt": "2023-11-07T05:31:56Z"
}
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}List projected
List the invoices a subscription will issue in a range of invoice moments, one projected invoice for each distinct invoice moment. Projected invoices are derived on each read and never stored. Each has status PROJECTED, and its id is stable between reads, but GET /v2/invoices/ returns 404 for it. Totals EXCLUDE usage: metered charges are not projected, and an invoice moment that has only metered charges is omitted. Tax and sequenceNumber are estimates. The range filters on the invoice moment (invoiceAt) in [from, to). A from before now is treated as now. to must be after from and at most one year after now; now is the subscription’s test-clock time when it has a test clock. A terminated subscription returns an empty list. Each invoice carries its lines in lineItems. Authorization is the same as listing invoices.
curl --request GET \
--url https://api.paygentic.io/v2/invoices/projected \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v2/invoices/projected"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v2/invoices/projected', 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.paygentic.io/v2/invoices/projected",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v2/invoices/projected"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paygentic.io/v2/invoices/projected")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v2/invoices/projected")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "<string>",
"object": "invoice",
"autoApprove": true,
"billingAnchor": "2023-11-07T05:31:56Z",
"billingCadence": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"currency": "<string>",
"gracePeriodEnd": "2023-11-07T05:31:56Z",
"grandTotal": "<string>",
"itemCount": 123,
"merchantId": "<string>",
"paidAmount": "<string>",
"periodEnd": "2023-11-07T05:31:56Z",
"periodStart": "2023-11-07T05:31:56Z",
"sequenceNumber": 123,
"status": "ACTIVE",
"subscriptionId": "<string>",
"customerId": "<string>",
"subtotal": "<string>",
"totalTax": "<string>",
"unpaidAmount": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"failureReason": "<string>",
"paymentInFlight": true,
"invoiceNumber": "<string>",
"lineItems": {
"invoiceId": "<string>",
"lineItems": [
{
"eventType": "usage",
"eventId": "<string>",
"eventSourceId": "<string>",
"billableMetricId": "<string>",
"invoiceDisplayName": "<string>",
"lineItemType": "charge",
"meterEventId": "<string>",
"metricDescription": "<string>",
"metricName": "<string>",
"metricUnit": "<string>",
"quantity": 123,
"taxRate": 123,
"totalAmount": "<string>",
"totalPrice": "<string>",
"totalTax": "<string>",
"unitPrice": "<string>",
"itemId": "<string>",
"priceId": "<string>",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"paymentTerm": "in_advance"
}
],
"totalCount": 123,
"items": [
{
"id": "<string>",
"name": "<string>",
"catalogId": "<string>",
"archivedAt": "2023-11-07T05:31:56Z",
"externalReferences": [
{
"id": "<string>",
"object": "externalReference",
"merchantId": "<string>",
"entityType": "item",
"entityId": "<string>",
"provider": "<string>",
"externalId": "<string>",
"metadata": {},
"isPrimary": true,
"isDefault": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"externalLabel": "<string>"
}
]
}
],
"nextPageToken": "<string>"
},
"metadata": {},
"nextActionAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"issuedAt": "2023-11-07T05:31:56Z",
"dueAt": "2023-11-07T05:31:56Z",
"paymentUrl": "<string>",
"pdfUrl": "<string>",
"pdfSource": "paygentic",
"documentWithheldReason": "tax_unreconciled",
"permalink": "<string>",
"tax": {
"actualTax": "<string>",
"adjustmentApplied": true,
"adjustmentNeeded": true,
"difference": "<string>",
"estimatedTax": "<string>",
"reconciled": true,
"reconciledAt": "2023-11-07T05:31:56Z"
}
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Query Parameters
The subscription to project invoices for Unique identifier for a subscription
^sub_[a-zA-Z0-9]+$Start of the range of invoice moments, inclusive. Defaults to now. A value before now is treated as now.
End of the range of invoice moments, exclusive. Defaults to one month after from. Must be after from and at most one year after now.
Maximum number of invoices to return
1 <= x <= 100Number of invoices to skip for pagination
0 <= x <= 10000Was this page helpful?