List customer plans
curl --request GET \
--url https://api.metronome.com/v1/customers/{customer_id}/plans \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.metronome.com/v1/customers/{customer_id}/plans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.metronome.com/v1/customers/{customer_id}/plans', 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.metronome.com/v1/customers/{customer_id}/plans",
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.metronome.com/v1/customers/{customer_id}/plans"
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.metronome.com/v1/customers/{customer_id}/plans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/customers/{customer_id}/plans")
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{
"data": [
{
"id": "7aa11640-0703-4600-8eb9-293f535a6b74",
"plan_id": "94293d66-aa05-4a8e-881a-c90872047b67",
"plan_name": "Standard",
"plan_description": "The standard plan for all customers",
"starting_on": "2021-01-01T00:00:00Z",
"trial_info": {
"ending_before": "2021-01-15T00:00:00Z",
"spending_caps": []
},
"custom_fields": {
"x_account_id": "KyVnHhSBWl7eY2bl"
}
}
],
"next_page": null
}Customers
List customer plans
List the given customer’s plans in reverse-chronological order. This is a Plans (deprecated) endpoint. New clients should implement using Contracts.
GET
/
customers
/
{customer_id}
/
plans
List customer plans
curl --request GET \
--url https://api.metronome.com/v1/customers/{customer_id}/plans \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.metronome.com/v1/customers/{customer_id}/plans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.metronome.com/v1/customers/{customer_id}/plans', 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.metronome.com/v1/customers/{customer_id}/plans",
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.metronome.com/v1/customers/{customer_id}/plans"
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.metronome.com/v1/customers/{customer_id}/plans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/customers/{customer_id}/plans")
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{
"data": [
{
"id": "7aa11640-0703-4600-8eb9-293f535a6b74",
"plan_id": "94293d66-aa05-4a8e-881a-c90872047b67",
"plan_name": "Standard",
"plan_description": "The standard plan for all customers",
"starting_on": "2021-01-01T00:00:00Z",
"trial_info": {
"ending_before": "2021-01-15T00:00:00Z",
"spending_caps": []
},
"custom_fields": {
"x_account_id": "KyVnHhSBWl7eY2bl"
}
}
],
"next_page": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Max number of results that should be returned
Required range:
1 <= x <= 100Cursor that indicates where the next page of results should start.
⌘I