Get a package
curl --request POST \
--url https://api.metronome.com/v1/packages/get \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"package_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc"
}
'import requests
url = "https://api.metronome.com/v1/packages/get"
payload = { "package_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({package_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc'})
};
fetch('https://api.metronome.com/v1/packages/get', 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/packages/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'package_id' => 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.metronome.com/v1/packages/get"
payload := strings.NewReader("{\n \"package_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.metronome.com/v1/packages/get")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"package_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/packages/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"package_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
"name": "Basic Package",
"usage_statement_schedule": {
"frequency": "MONTHLY"
},
"created_at": "2019-12-31T14:23:55.234Z",
"created_by": "Alice",
"commits": [
{
"id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35",
"type": "PREPAID",
"name": "My test commit",
"description": "My test commit description",
"product": {
"id": "2e30f074-d04c-412e-a134-851ebfa5ceb2",
"name": "My product A"
},
"applicable_product_ids": [
"13a2179b-f0cb-460b-85a1-cd42964ca533"
],
"access_schedule": {
"credit_type": {
"id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
"name": "USD (cents)"
},
"schedule_items": [
{
"id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a",
"amount": 10000000,
"starting_at_offset": {
"unit": "MONTHS",
"value": 1
},
"duration": {
"unit": "MONTHS",
"value": 3
}
}
]
},
"invoice_schedule": {
"credit_type": {
"id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
"name": "USD (cents)"
},
"schedule_items": [
{
"id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4",
"unit_price": 10000000,
"quantity": 1,
"date_offset": {
"unit": "MONTHS",
"value": 4
}
}
],
"do_not_invoice": false
}
}
],
"overrides": [
{
"id": "6cf3292a-e85c-4be6-822c-e25ba9d19757",
"starting_at_offset": {
"unit": "MONTHS",
"value": 1
},
"type": "MULTIPLIER",
"multiplier": 0.1,
"override_specifiers": [
{
"product_id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8"
}
]
}
],
"scheduled_charges": [
{
"id": "04dbca69-0bc2-45c6-ba22-a53934353b10",
"name": "Test Scheduled Charge",
"description": "Test Scheduled Charge Description",
"product": {
"id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8",
"name": "My product B"
},
"schedule": {
"credit_type": {
"id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
"name": "USD (cents)"
},
"schedule_items": [
{
"id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4",
"unit_price": 10000000,
"quantity": 1,
"date_offset": {
"unit": "MONTHS",
"value": 4
}
}
]
}
}
]
}
}{
"message": "<string>"
}Packages
Get a package
Gets the details for a specific package, including name, aliases, duration, and terms. Use this endpoint to understand a package’s alias schedule, or display a specific package’s details to end customers.
POST
/
v1
/
packages
/
get
Get a package
curl --request POST \
--url https://api.metronome.com/v1/packages/get \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"package_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc"
}
'import requests
url = "https://api.metronome.com/v1/packages/get"
payload = { "package_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({package_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc'})
};
fetch('https://api.metronome.com/v1/packages/get', 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/packages/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'package_id' => 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.metronome.com/v1/packages/get"
payload := strings.NewReader("{\n \"package_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.metronome.com/v1/packages/get")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"package_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/packages/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"package_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
"name": "Basic Package",
"usage_statement_schedule": {
"frequency": "MONTHLY"
},
"created_at": "2019-12-31T14:23:55.234Z",
"created_by": "Alice",
"commits": [
{
"id": "62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35",
"type": "PREPAID",
"name": "My test commit",
"description": "My test commit description",
"product": {
"id": "2e30f074-d04c-412e-a134-851ebfa5ceb2",
"name": "My product A"
},
"applicable_product_ids": [
"13a2179b-f0cb-460b-85a1-cd42964ca533"
],
"access_schedule": {
"credit_type": {
"id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
"name": "USD (cents)"
},
"schedule_items": [
{
"id": "2d45952c-5a6e-43a9-8aab-f61ee21be81a",
"amount": 10000000,
"starting_at_offset": {
"unit": "MONTHS",
"value": 1
},
"duration": {
"unit": "MONTHS",
"value": 3
}
}
]
},
"invoice_schedule": {
"credit_type": {
"id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
"name": "USD (cents)"
},
"schedule_items": [
{
"id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4",
"unit_price": 10000000,
"quantity": 1,
"date_offset": {
"unit": "MONTHS",
"value": 4
}
}
],
"do_not_invoice": false
}
}
],
"overrides": [
{
"id": "6cf3292a-e85c-4be6-822c-e25ba9d19757",
"starting_at_offset": {
"unit": "MONTHS",
"value": 1
},
"type": "MULTIPLIER",
"multiplier": 0.1,
"override_specifiers": [
{
"product_id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8"
}
]
}
],
"scheduled_charges": [
{
"id": "04dbca69-0bc2-45c6-ba22-a53934353b10",
"name": "Test Scheduled Charge",
"description": "Test Scheduled Charge Description",
"product": {
"id": "eae8903b-693b-41a7-8c0b-f23748c9a9c8",
"name": "My product B"
},
"schedule": {
"credit_type": {
"id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
"name": "USD (cents)"
},
"schedule_items": [
{
"id": "f15e4e23-f74e-4de4-9b3a-8b07434116c4",
"unit_price": 10000000,
"quantity": 1,
"date_offset": {
"unit": "MONTHS",
"value": 4
}
}
]
}
}
]
}
}{
"message": "<string>"
}⌘I