List Invoices
curl --request GET \
--url https://api.prime.coinbase.com/v1/entities/{entity_id}/invoicesimport requests
url = "https://api.prime.coinbase.com/v1/entities/{entity_id}/invoices"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/entities/{entity_id}/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://api.prime.coinbase.com/v1/entities/{entity_id}/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prime.coinbase.com/v1/entities/{entity_id}/invoices"
req, _ := http.NewRequest("GET", url, nil)
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.prime.coinbase.com/v1/entities/{entity_id}/invoices")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/entities/{entity_id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"invoices": [
{
"id": "<string>",
"billing_month": 123,
"billing_year": 123,
"due_date": "<string>",
"invoice_number": "<string>",
"usd_amount_paid": 123,
"usd_amount_owed": 123,
"invoice_items": [
{
"description": "<string>",
"currency_symbol": "<string>",
"rate": 123,
"quantity": 123,
"price": 123,
"average_auc": 123,
"total": 123
}
]
}
]
}Invoice
List Invoices
Retrieve a list of invoices belonging to an entity.
GET
/
v1
/
entities
/
{entity_id}
/
invoices
List Invoices
curl --request GET \
--url https://api.prime.coinbase.com/v1/entities/{entity_id}/invoicesimport requests
url = "https://api.prime.coinbase.com/v1/entities/{entity_id}/invoices"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/entities/{entity_id}/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://api.prime.coinbase.com/v1/entities/{entity_id}/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prime.coinbase.com/v1/entities/{entity_id}/invoices"
req, _ := http.NewRequest("GET", url, nil)
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.prime.coinbase.com/v1/entities/{entity_id}/invoices")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/entities/{entity_id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"invoices": [
{
"id": "<string>",
"billing_month": 123,
"billing_year": 123,
"due_date": "<string>",
"invoice_number": "<string>",
"usd_amount_paid": 123,
"usd_amount_owed": 123,
"invoice_items": [
{
"description": "<string>",
"currency_symbol": "<string>",
"rate": 123,
"quantity": 123,
"price": 123,
"average_auc": 123,
"total": 123
}
]
}
]
}Use the Prime SDK or CLI to test this endpoint by following the quickstart guide and running with the following examples
For more information, please visit the Prime Java SDK.For more information, please visit the Prime .NET SDK.For more information, please visit the Prime Go SDK.For more information, please visit the Prime Python SDK.For more information, please visit the Prime CLI.For more information, please visit the Prime TS SDK.
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
InvoiceService invoiceService = PrimeServiceFactory.createInvoiceService(client);
ListInvoicesRequest request = new ListInvoicesRequest.Builder("ENTITY_ID_HERE").build();
ListInvoicesResponse response = invoiceService.listInvoices(request);
var invoiceService = new InvoiceService(client);
var request = new ListInvoicesRequest("ENTITY_ID_HERE");
var response = invoiceService.ListInvoices(request);
invoiceService := invoice.NewInvoiceService(client)
request := &invoice.ListInvoicesRequest{
EntityId: "ENTITY_ID_HERE",
}
response, err := invoiceService.ListInvoices(context.Background(), request)
prime_client = PrimeClient(credentials)
request = ListInvoicesRequest(
entity_id="ENTITY_ID_HERE",
)
response = prime_client.list_invoices(request)
primectl list-invoices --help
const invoicesService = new InvoicesService(client);
invoicesService.listInvoices({
entityId: 'ENTITY_ID_HERE'
}).then(async (response) => {
console.log('Invoices: ', response);
})
Path Parameters
The entity ID
Query Parameters
Invoice states to filter the response
Available options:
INVOICE_STATE_IMPORTED, INVOICE_STATE_BILLED, INVOICE_STATE_PARTIALLY_PAID, INVOICE_STATE_PAID Filter invoices by year
Integer representing the month to filter by, 1 for January, 12 for December
Cursor used for pagination (last consumed record)
Number of items to retrieve
Response
200 - application/json
A successful response.
Show child attributes
Show child attributes
Was this page helpful?
⌘I