curl --request GET \
--url https://app.flowglad.com/api/v1/customers/{externalId}/billing \
--header 'Authorization: <api-key>'import requests
url = "https://app.flowglad.com/api/v1/customers/{externalId}/billing"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.flowglad.com/api/v1/customers/{externalId}/billing', 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://app.flowglad.com/api/v1/customers/{externalId}/billing",
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: <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://app.flowglad.com/api/v1/customers/{externalId}/billing"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://app.flowglad.com/api/v1/customers/{externalId}/billing")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flowglad.com/api/v1/customers/{externalId}/billing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customer": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"email": "<string>",
"name": "<string>",
"invoiceNumberBase": "<string>",
"archived": true,
"logoURL": "<string>",
"iconURL": "<string>",
"domain": "<string>",
"externalId": "<string>",
"userId": "<string>",
"pricingModelId": "<string>",
"billingAddress": {
"address": {
"country": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
}
},
"subscriptions": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"startDate": 0,
"customerId": "<string>",
"organizationId": "<string>",
"defaultPaymentMethodId": "<string>",
"backupPaymentMethodId": "<string>",
"trialEnd": null,
"currentBillingPeriodStart": null,
"currentBillingPeriodEnd": null,
"cancellationReason": "<string>",
"replacedBySubscriptionId": "<string>",
"isFreePlan": true,
"doNotCharge": true,
"priceId": "<string>",
"runBillingAtPeriodStart": true,
"interval": null,
"intervalCount": null,
"billingCycleAnchorDate": null,
"name": "<string>",
"renews": true,
"pricingModelId": "<string>",
"current": true,
"subscriptionItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionId": "<string>",
"name": "<string>",
"addedDate": 0,
"priceId": "<string>",
"unitPrice": 4503599627370495,
"quantity": 4503599627370495,
"type": "<string>",
"externalId": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"price": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"metadata": {},
"expiredAt": 0
}
],
"metadata": {},
"canceledAt": 0,
"cancelScheduledAt": 0,
"scheduledAdjustmentAt": 0,
"experimental": {
"featureItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionItemId": "<string>",
"featureId": "<string>",
"type": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"name": "<string>",
"slug": "<string>",
"productFeatureId": "<string>",
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"expiredAt": 0,
"detachedAt": 0,
"detachedReason": "<string>",
"resourceId": null
}
],
"usageMeterBalances": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"availableBalance": 123,
"subscriptionId": "<string>"
}
]
}
}
],
"invoices": [
{
"invoice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"purchaseId": "<string>",
"invoiceNumber": "<string>",
"invoiceDate": 0,
"customerId": "<string>",
"organizationId": "<string>",
"billingRunId": "<string>",
"ownerMembershipId": "<string>",
"memo": "<string>",
"bankPaymentOnly": true,
"type": "<string>",
"taxAmount": -1,
"subtotal": -1,
"taxState": "<string>",
"taxRatePercentage": "<string>",
"applicationFee": -1,
"pricingModelId": "<string>",
"billingPeriodId": null,
"dueDate": 0,
"subscriptionId": null,
"billingPeriodStartDate": null,
"billingPeriodEndDate": null,
"pdfURL": "<string>",
"receiptPdfURL": "<string>"
},
"invoiceLineItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"invoiceId": "<string>",
"quantity": -1,
"priceId": "<string>",
"description": "<string>",
"price": -1,
"type": "<string>",
"pricingModelId": "<string>",
"ledgerAccountId": null,
"ledgerAccountCredit": null
}
]
}
],
"paymentMethods": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"customerId": "<string>",
"pricingModelId": "<string>",
"billingDetails": {
"address": {
"country": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"address": {
"country": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
}
},
"name": "<string>",
"email": "<string>"
},
"default": true,
"paymentMethodData": {},
"metadata": {}
}
],
"purchases": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"customerId": "<string>",
"organizationId": "<string>",
"priceId": "<string>",
"quantity": 123,
"priceType": "<string>",
"trialPeriodDays": 4503599627370495,
"pricePerBillingCycle": 123,
"intervalCount": 123,
"firstInvoiceValue": 4503599627370495,
"totalPurchaseValue": null,
"bankPaymentOnly": true,
"proposal": "<string>",
"archived": true,
"pricingModelId": "<string>",
"position": 123,
"billingCycleAnchor": 0,
"purchaseDate": 0,
"endDate": 0,
"billingAddress": {
"address": {
"country": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"metadata": {}
}
],
"catalog": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"isDefault": true,
"name": "<string>",
"products": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"description": "<string>",
"imageURL": "<string>",
"organizationId": "<string>",
"active": true,
"singularQuantityLabel": "<string>",
"pluralQuantityLabel": "<string>",
"pricingModelId": "<string>",
"default": true,
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"features": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"type": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"pricingModelId": "<string>",
"active": true,
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"resourceId": null
}
]
}
],
"usageMeters": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"trialPeriodDays": null,
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": 123,
"productId": null,
"active": true,
"slug": "<string>",
"usageMeterId": "<string>",
"pricingModelId": "<string>"
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"trialPeriodDays": null,
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": 123,
"productId": null,
"active": true,
"slug": "<string>",
"usageMeterId": "<string>",
"pricingModelId": "<string>"
}
}
],
"defaultProduct": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"description": "<string>",
"imageURL": "<string>",
"organizationId": "<string>",
"active": true,
"singularQuantityLabel": "<string>",
"pluralQuantityLabel": "<string>",
"pricingModelId": "<string>",
"default": true,
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"features": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"type": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"pricingModelId": "<string>",
"active": true,
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"resourceId": null
}
]
}
},
"pricingModel": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"isDefault": true,
"name": "<string>",
"products": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"description": "<string>",
"imageURL": "<string>",
"organizationId": "<string>",
"active": true,
"singularQuantityLabel": "<string>",
"pluralQuantityLabel": "<string>",
"pricingModelId": "<string>",
"default": true,
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"features": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"type": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"pricingModelId": "<string>",
"active": true,
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"resourceId": null
}
]
}
],
"usageMeters": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"trialPeriodDays": null,
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": 123,
"productId": null,
"active": true,
"slug": "<string>",
"usageMeterId": "<string>",
"pricingModelId": "<string>"
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"trialPeriodDays": null,
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": 123,
"productId": null,
"active": true,
"slug": "<string>",
"usageMeterId": "<string>",
"pricingModelId": "<string>"
}
}
],
"defaultProduct": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"description": "<string>",
"imageURL": "<string>",
"organizationId": "<string>",
"active": true,
"singularQuantityLabel": "<string>",
"pluralQuantityLabel": "<string>",
"pricingModelId": "<string>",
"default": true,
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"features": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"type": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"pricingModelId": "<string>",
"active": true,
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"resourceId": null
}
]
}
},
"billingPortalUrl": "<string>",
"currentSubscriptions": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"startDate": 0,
"customerId": "<string>",
"organizationId": "<string>",
"defaultPaymentMethodId": "<string>",
"backupPaymentMethodId": "<string>",
"trialEnd": null,
"currentBillingPeriodStart": null,
"currentBillingPeriodEnd": null,
"cancellationReason": "<string>",
"replacedBySubscriptionId": "<string>",
"isFreePlan": true,
"doNotCharge": true,
"priceId": "<string>",
"runBillingAtPeriodStart": true,
"interval": null,
"intervalCount": null,
"billingCycleAnchorDate": null,
"name": "<string>",
"renews": true,
"pricingModelId": "<string>",
"current": true,
"subscriptionItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionId": "<string>",
"name": "<string>",
"addedDate": 0,
"priceId": "<string>",
"unitPrice": 4503599627370495,
"quantity": 4503599627370495,
"type": "<string>",
"externalId": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"price": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"metadata": {},
"expiredAt": 0
}
],
"metadata": {},
"canceledAt": 0,
"cancelScheduledAt": 0,
"scheduledAdjustmentAt": 0,
"experimental": {
"featureItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionItemId": "<string>",
"featureId": "<string>",
"type": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"name": "<string>",
"slug": "<string>",
"productFeatureId": "<string>",
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"expiredAt": 0,
"detachedAt": 0,
"detachedReason": "<string>",
"resourceId": null
}
],
"usageMeterBalances": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"availableBalance": 123,
"subscriptionId": "<string>"
}
]
}
}
],
"currentSubscription": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"startDate": 0,
"customerId": "<string>",
"organizationId": "<string>",
"defaultPaymentMethodId": "<string>",
"backupPaymentMethodId": "<string>",
"trialEnd": null,
"currentBillingPeriodStart": null,
"currentBillingPeriodEnd": null,
"cancellationReason": "<string>",
"replacedBySubscriptionId": "<string>",
"isFreePlan": true,
"doNotCharge": true,
"priceId": "<string>",
"runBillingAtPeriodStart": true,
"interval": null,
"intervalCount": null,
"billingCycleAnchorDate": null,
"name": "<string>",
"renews": true,
"pricingModelId": "<string>",
"current": true,
"subscriptionItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionId": "<string>",
"name": "<string>",
"addedDate": 0,
"priceId": "<string>",
"unitPrice": 4503599627370495,
"quantity": 4503599627370495,
"type": "<string>",
"externalId": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"price": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"metadata": {},
"expiredAt": 0
}
],
"metadata": {},
"canceledAt": 0,
"cancelScheduledAt": 0,
"scheduledAdjustmentAt": 0,
"experimental": {
"featureItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionItemId": "<string>",
"featureId": "<string>",
"type": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"name": "<string>",
"slug": "<string>",
"productFeatureId": "<string>",
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"expiredAt": 0,
"detachedAt": 0,
"detachedReason": "<string>",
"resourceId": null
}
],
"usageMeterBalances": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"availableBalance": 123,
"subscriptionId": "<string>"
}
]
}
}
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Get Billing Details
curl --request GET \
--url https://app.flowglad.com/api/v1/customers/{externalId}/billing \
--header 'Authorization: <api-key>'import requests
url = "https://app.flowglad.com/api/v1/customers/{externalId}/billing"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.flowglad.com/api/v1/customers/{externalId}/billing', 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://app.flowglad.com/api/v1/customers/{externalId}/billing",
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: <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://app.flowglad.com/api/v1/customers/{externalId}/billing"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://app.flowglad.com/api/v1/customers/{externalId}/billing")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flowglad.com/api/v1/customers/{externalId}/billing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"customer": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"email": "<string>",
"name": "<string>",
"invoiceNumberBase": "<string>",
"archived": true,
"logoURL": "<string>",
"iconURL": "<string>",
"domain": "<string>",
"externalId": "<string>",
"userId": "<string>",
"pricingModelId": "<string>",
"billingAddress": {
"address": {
"country": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
}
},
"subscriptions": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"startDate": 0,
"customerId": "<string>",
"organizationId": "<string>",
"defaultPaymentMethodId": "<string>",
"backupPaymentMethodId": "<string>",
"trialEnd": null,
"currentBillingPeriodStart": null,
"currentBillingPeriodEnd": null,
"cancellationReason": "<string>",
"replacedBySubscriptionId": "<string>",
"isFreePlan": true,
"doNotCharge": true,
"priceId": "<string>",
"runBillingAtPeriodStart": true,
"interval": null,
"intervalCount": null,
"billingCycleAnchorDate": null,
"name": "<string>",
"renews": true,
"pricingModelId": "<string>",
"current": true,
"subscriptionItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionId": "<string>",
"name": "<string>",
"addedDate": 0,
"priceId": "<string>",
"unitPrice": 4503599627370495,
"quantity": 4503599627370495,
"type": "<string>",
"externalId": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"price": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"metadata": {},
"expiredAt": 0
}
],
"metadata": {},
"canceledAt": 0,
"cancelScheduledAt": 0,
"scheduledAdjustmentAt": 0,
"experimental": {
"featureItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionItemId": "<string>",
"featureId": "<string>",
"type": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"name": "<string>",
"slug": "<string>",
"productFeatureId": "<string>",
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"expiredAt": 0,
"detachedAt": 0,
"detachedReason": "<string>",
"resourceId": null
}
],
"usageMeterBalances": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"availableBalance": 123,
"subscriptionId": "<string>"
}
]
}
}
],
"invoices": [
{
"invoice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"purchaseId": "<string>",
"invoiceNumber": "<string>",
"invoiceDate": 0,
"customerId": "<string>",
"organizationId": "<string>",
"billingRunId": "<string>",
"ownerMembershipId": "<string>",
"memo": "<string>",
"bankPaymentOnly": true,
"type": "<string>",
"taxAmount": -1,
"subtotal": -1,
"taxState": "<string>",
"taxRatePercentage": "<string>",
"applicationFee": -1,
"pricingModelId": "<string>",
"billingPeriodId": null,
"dueDate": 0,
"subscriptionId": null,
"billingPeriodStartDate": null,
"billingPeriodEndDate": null,
"pdfURL": "<string>",
"receiptPdfURL": "<string>"
},
"invoiceLineItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"invoiceId": "<string>",
"quantity": -1,
"priceId": "<string>",
"description": "<string>",
"price": -1,
"type": "<string>",
"pricingModelId": "<string>",
"ledgerAccountId": null,
"ledgerAccountCredit": null
}
]
}
],
"paymentMethods": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"customerId": "<string>",
"pricingModelId": "<string>",
"billingDetails": {
"address": {
"country": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"address": {
"country": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
}
},
"name": "<string>",
"email": "<string>"
},
"default": true,
"paymentMethodData": {},
"metadata": {}
}
],
"purchases": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"customerId": "<string>",
"organizationId": "<string>",
"priceId": "<string>",
"quantity": 123,
"priceType": "<string>",
"trialPeriodDays": 4503599627370495,
"pricePerBillingCycle": 123,
"intervalCount": 123,
"firstInvoiceValue": 4503599627370495,
"totalPurchaseValue": null,
"bankPaymentOnly": true,
"proposal": "<string>",
"archived": true,
"pricingModelId": "<string>",
"position": 123,
"billingCycleAnchor": 0,
"purchaseDate": 0,
"endDate": 0,
"billingAddress": {
"address": {
"country": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>"
},
"metadata": {}
}
],
"catalog": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"isDefault": true,
"name": "<string>",
"products": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"description": "<string>",
"imageURL": "<string>",
"organizationId": "<string>",
"active": true,
"singularQuantityLabel": "<string>",
"pluralQuantityLabel": "<string>",
"pricingModelId": "<string>",
"default": true,
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"features": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"type": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"pricingModelId": "<string>",
"active": true,
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"resourceId": null
}
]
}
],
"usageMeters": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"trialPeriodDays": null,
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": 123,
"productId": null,
"active": true,
"slug": "<string>",
"usageMeterId": "<string>",
"pricingModelId": "<string>"
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"trialPeriodDays": null,
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": 123,
"productId": null,
"active": true,
"slug": "<string>",
"usageMeterId": "<string>",
"pricingModelId": "<string>"
}
}
],
"defaultProduct": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"description": "<string>",
"imageURL": "<string>",
"organizationId": "<string>",
"active": true,
"singularQuantityLabel": "<string>",
"pluralQuantityLabel": "<string>",
"pricingModelId": "<string>",
"default": true,
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"features": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"type": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"pricingModelId": "<string>",
"active": true,
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"resourceId": null
}
]
}
},
"pricingModel": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"isDefault": true,
"name": "<string>",
"products": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"description": "<string>",
"imageURL": "<string>",
"organizationId": "<string>",
"active": true,
"singularQuantityLabel": "<string>",
"pluralQuantityLabel": "<string>",
"pricingModelId": "<string>",
"default": true,
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"features": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"type": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"pricingModelId": "<string>",
"active": true,
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"resourceId": null
}
]
}
],
"usageMeters": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"trialPeriodDays": null,
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": 123,
"productId": null,
"active": true,
"slug": "<string>",
"usageMeterId": "<string>",
"pricingModelId": "<string>"
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"trialPeriodDays": null,
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": 123,
"productId": null,
"active": true,
"slug": "<string>",
"usageMeterId": "<string>",
"pricingModelId": "<string>"
}
}
],
"defaultProduct": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"description": "<string>",
"imageURL": "<string>",
"organizationId": "<string>",
"active": true,
"singularQuantityLabel": "<string>",
"pluralQuantityLabel": "<string>",
"pricingModelId": "<string>",
"default": true,
"slug": "<string>",
"prices": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
}
],
"defaultPrice": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"features": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"type": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"pricingModelId": "<string>",
"active": true,
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"resourceId": null
}
]
}
},
"billingPortalUrl": "<string>",
"currentSubscriptions": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"startDate": 0,
"customerId": "<string>",
"organizationId": "<string>",
"defaultPaymentMethodId": "<string>",
"backupPaymentMethodId": "<string>",
"trialEnd": null,
"currentBillingPeriodStart": null,
"currentBillingPeriodEnd": null,
"cancellationReason": "<string>",
"replacedBySubscriptionId": "<string>",
"isFreePlan": true,
"doNotCharge": true,
"priceId": "<string>",
"runBillingAtPeriodStart": true,
"interval": null,
"intervalCount": null,
"billingCycleAnchorDate": null,
"name": "<string>",
"renews": true,
"pricingModelId": "<string>",
"current": true,
"subscriptionItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionId": "<string>",
"name": "<string>",
"addedDate": 0,
"priceId": "<string>",
"unitPrice": 4503599627370495,
"quantity": 4503599627370495,
"type": "<string>",
"externalId": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"price": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"metadata": {},
"expiredAt": 0
}
],
"metadata": {},
"canceledAt": 0,
"cancelScheduledAt": 0,
"scheduledAdjustmentAt": 0,
"experimental": {
"featureItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionItemId": "<string>",
"featureId": "<string>",
"type": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"name": "<string>",
"slug": "<string>",
"productFeatureId": "<string>",
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"expiredAt": 0,
"detachedAt": 0,
"detachedReason": "<string>",
"resourceId": null
}
],
"usageMeterBalances": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"availableBalance": 123,
"subscriptionId": "<string>"
}
]
}
}
],
"currentSubscription": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"startDate": 0,
"customerId": "<string>",
"organizationId": "<string>",
"defaultPaymentMethodId": "<string>",
"backupPaymentMethodId": "<string>",
"trialEnd": null,
"currentBillingPeriodStart": null,
"currentBillingPeriodEnd": null,
"cancellationReason": "<string>",
"replacedBySubscriptionId": "<string>",
"isFreePlan": true,
"doNotCharge": true,
"priceId": "<string>",
"runBillingAtPeriodStart": true,
"interval": null,
"intervalCount": null,
"billingCycleAnchorDate": null,
"name": "<string>",
"renews": true,
"pricingModelId": "<string>",
"current": true,
"subscriptionItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionId": "<string>",
"name": "<string>",
"addedDate": 0,
"priceId": "<string>",
"unitPrice": 4503599627370495,
"quantity": 4503599627370495,
"type": "<string>",
"externalId": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"price": {
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"name": "<string>",
"intervalCount": 123,
"type": "<string>",
"isDefault": true,
"unitPrice": 4503599627370495,
"usageEventsPerUnit": null,
"productId": "<string>",
"active": true,
"slug": "<string>",
"usageMeterId": null,
"pricingModelId": "<string>",
"trialPeriodDays": 4503599627370495
},
"metadata": {},
"expiredAt": 0
}
],
"metadata": {},
"canceledAt": 0,
"cancelScheduledAt": 0,
"scheduledAdjustmentAt": 0,
"experimental": {
"featureItems": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"subscriptionItemId": "<string>",
"featureId": "<string>",
"type": "<string>",
"manuallyCreated": true,
"pricingModelId": "<string>",
"name": "<string>",
"slug": "<string>",
"productFeatureId": "<string>",
"amount": null,
"usageMeterId": null,
"renewalFrequency": null,
"expiredAt": 0,
"detachedAt": 0,
"detachedReason": "<string>",
"resourceId": null
}
],
"usageMeterBalances": [
{
"id": "<string>",
"createdAt": 0,
"updatedAt": 0,
"livemode": true,
"organizationId": "<string>",
"name": "<string>",
"pricingModelId": "<string>",
"slug": "<string>",
"availableBalance": 123,
"subscriptionId": "<string>"
}
]
}
}
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
Path Parameters
The ID of the customer, as defined in your application
Response
Successful response
Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A purchase record, which describes a transaction that can be associated with either a subscription or single payment price. Each purchase has a specific type that determines its behavior and required fields.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The billing portal URL for the customer
The current subscriptions for the customer. By default, customers can only have one active subscription at a time. This will only return multiple subscriptions if you have enabled multiple subscriptions per customer.
- Option 1
- Option 2
Show child attributes
Show child attributes
The most recently created current subscription for the customer. If createdAt timestamps tie, the most recently updated subscription will be returned. If updatedAt also ties, subscription id is used as the final tiebreaker.
- Option 1
- Option 2
Show child attributes
Show child attributes
Was this page helpful?