curl --request GET \
--url https://api.salesbricks.com/api/v2/invoices/{invoice_id} \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/invoices/{invoice_id}"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/invoices/{invoice_id}', 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.salesbricks.com/api/v2/invoices/{invoice_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SALESBRICKS-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"
"net/http"
"io"
)
func main() {
url := "https://api.salesbricks.com/api/v2/invoices/{invoice_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
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.salesbricks.com/api/v2/invoices/{invoice_id}")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/invoices/{invoice_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billed_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"bill_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"fully_paid_at": "2023-11-07T05:31:56Z",
"grand_total": 123,
"remaining_amount": 123,
"currency": "<string>",
"is_renewal_estimate": true,
"customer_name": "<string>",
"time_zone": "<string>",
"payments": [
{
"payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"invoice_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paid_amount": 123,
"paid_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"error": "<string>"
}
],
"attachments": [
"<unknown>"
],
"line_items": [
{
"brick_name": "<string>",
"brick_id": "<string>",
"quantity": 123,
"tax": 123,
"grand_total": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}
],
"metadata": "<unknown>",
"purchase_order": {
"code": "<string>"
}
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "Not found — the resource you are looking for does not exist."
}
}Retrieve an invoice
Retrieves the invoice details by ID.
curl --request GET \
--url https://api.salesbricks.com/api/v2/invoices/{invoice_id} \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/invoices/{invoice_id}"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/invoices/{invoice_id}', 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.salesbricks.com/api/v2/invoices/{invoice_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SALESBRICKS-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"
"net/http"
"io"
)
func main() {
url := "https://api.salesbricks.com/api/v2/invoices/{invoice_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
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.salesbricks.com/api/v2/invoices/{invoice_id}")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/invoices/{invoice_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billed_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"bill_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"fully_paid_at": "2023-11-07T05:31:56Z",
"grand_total": 123,
"remaining_amount": 123,
"currency": "<string>",
"is_renewal_estimate": true,
"customer_name": "<string>",
"time_zone": "<string>",
"payments": [
{
"payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"invoice_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paid_amount": 123,
"paid_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"error": "<string>"
}
],
"attachments": [
"<unknown>"
],
"line_items": [
{
"brick_name": "<string>",
"brick_id": "<string>",
"quantity": 123,
"tax": 123,
"grand_total": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}
],
"metadata": "<unknown>",
"purchase_order": {
"code": "<string>"
}
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "Not found — the resource you are looking for does not exist."
}
}Authorizations
API key for authentication
Path Parameters
^([a-zA-Z\d\-]+)$Response
Unique identifier for the invoice. If the id is null, this is an estimate
ID of the subscription this invoice belongs to. Null for standalone (one-off) invoices.
ID of the end customer this invoice is for — the company that consumes the subscription. Never collect or charge payment methods against this id: on a partner-billed invoice the paying party is a different company, and billed_company_id is always the id to collect against.
ID of the company actually billed for this invoice — the party whose Stripe customer POST /invoices/{invoice_id}/pay charges. Equal to customer_id unless the invoice is partner-billed, in which case it is the partner's company. Collect and list payment methods against this id, never customer_id. Always present and never null, including on the renewal estimate returned by GET /subscriptions/{subscription_id}/invoices/next, which resolves the company its renewal would bill.
Short form identifier for the invoice. If the invoice_number is null, this is an estimate
The date on which this invoice is expected to be paid by.
The date on which this invoice will be issued and potentially charged.
The date on which this invoice was issued.
Current status of the invoice. One of:
MUTED— Invoice will not be sent. Muted invoices come from migration cut-overs or from muting invoices in the product settings.SCHEDULED— Scheduled to be issued on a future date.OUTSTANDING— Issued and awaiting payment.DUE— Payment is due.PAST_DUE— Payment is past its due date.PAID— Fully paid.PARTIALLY_PAID— Partially paid, with a remaining balance.ADJUSTED— Adjusted after issuance.CREDITED— Settled by applying credit.UNPAID— Unpaid.PAUSED— Collection is paused.VOIDED— Voided and no longer collectible.
The date on which this invoice was fully paid.
Total amount due for this invoice.
Invoices that have not been generated yet (e.g. SCHEDULED) report the total expected at the time they were created. That figure does NOT include usage metered since — a usage invoice whose meters have not been priced reports 0. Pass ?calculate_expected_usage=true to re-price against the order and include estimated usage instead; it is slower, so it is off by default on list endpoints.
Remaining amount for this invoice.
The currency in which the invoice is denominated (e.g., USD, EUR).
This is an estimate for a renewal that has not yet closed, but is expected to.
Name of the customer who will pay this invoice
Invoice timezone
All payments made against this invoice, newest first.
Show child attributes
Show child attributes
Current attachments for this invoice as a flat array. Each item includes 'target' field indicating invoice or subscription level. Sorted by unified order.
Line item breakdown for this invoice
Show child attributes
Show child attributes
Optional metadata stored against the invoice.
Purchase order shown on this invoice: the invoice's own purchase order when it has one, otherwise the subscription's. Matches the PO printed on the invoice PDF. Null when neither carries one.
Show child attributes
Show child attributes