Set billing provider configurations for a customer
curl --request POST \
--url https://api.metronome.com/v1/setCustomerBillingProviderConfigurations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "stripe",
"configuration": {
"stripe_customer_id": "cus_1234",
"stripe_collection_method": "charge_automatically",
"leave_stripe_invoices_in_draft": true
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "aws_marketplace",
"configuration": {
"aws_customer_id": "ABC123ABC12",
"aws_product_code": "my_product",
"aws_region": "us-west-1"
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "azure_marketplace",
"configuration": {
"azure_subscription_id": "my_subscription"
},
"delivery_method_id": "5b9e3072-415b-4842-94f0-0b6700c8b6be"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "aws_marketplace",
"configuration": {
"aws_customer_id": "ABC123ABC12",
"aws_product_code": "my_product",
"aws_region": "us-west-1",
"aws_is_subscription_product": true
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "gcp_marketplace",
"configuration": {
"gcp_entitlement_id": "my_entitlement",
"gcp_service_name": "my.service.endpoint.goog"
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "netsuite",
"configuration": {
"netsuite_customer_id": "12345"
},
"delivery_method": "direct_to_billing_provider"
}
]
}
'import requests
url = "https://api.metronome.com/v1/setCustomerBillingProviderConfigurations"
payload = { "data": [
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "stripe",
"configuration": {
"stripe_customer_id": "cus_1234",
"stripe_collection_method": "charge_automatically",
"leave_stripe_invoices_in_draft": True
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "aws_marketplace",
"configuration": {
"aws_customer_id": "ABC123ABC12",
"aws_product_code": "my_product",
"aws_region": "us-west-1"
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "azure_marketplace",
"configuration": { "azure_subscription_id": "my_subscription" },
"delivery_method_id": "5b9e3072-415b-4842-94f0-0b6700c8b6be"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "aws_marketplace",
"configuration": {
"aws_customer_id": "ABC123ABC12",
"aws_product_code": "my_product",
"aws_region": "us-west-1",
"aws_is_subscription_product": True
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "gcp_marketplace",
"configuration": {
"gcp_entitlement_id": "my_entitlement",
"gcp_service_name": "my.service.endpoint.goog"
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "netsuite",
"configuration": { "netsuite_customer_id": "12345" },
"delivery_method": "direct_to_billing_provider"
}
] }
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({
data: [
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'stripe',
configuration: {
stripe_customer_id: 'cus_1234',
stripe_collection_method: 'charge_automatically',
leave_stripe_invoices_in_draft: true
},
delivery_method: 'direct_to_billing_provider'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'aws_marketplace',
configuration: {
aws_customer_id: 'ABC123ABC12',
aws_product_code: 'my_product',
aws_region: 'us-west-1'
},
delivery_method: 'direct_to_billing_provider'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'azure_marketplace',
configuration: {azure_subscription_id: 'my_subscription'},
delivery_method_id: '5b9e3072-415b-4842-94f0-0b6700c8b6be'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'aws_marketplace',
configuration: {
aws_customer_id: 'ABC123ABC12',
aws_product_code: 'my_product',
aws_region: 'us-west-1',
aws_is_subscription_product: true
},
delivery_method: 'direct_to_billing_provider'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'gcp_marketplace',
configuration: {
gcp_entitlement_id: 'my_entitlement',
gcp_service_name: 'my.service.endpoint.goog'
},
delivery_method: 'direct_to_billing_provider'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'netsuite',
configuration: {netsuite_customer_id: '12345'},
delivery_method: 'direct_to_billing_provider'
}
]
})
};
fetch('https://api.metronome.com/v1/setCustomerBillingProviderConfigurations', 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/setCustomerBillingProviderConfigurations",
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([
'data' => [
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'stripe',
'configuration' => [
'stripe_customer_id' => 'cus_1234',
'stripe_collection_method' => 'charge_automatically',
'leave_stripe_invoices_in_draft' => true
],
'delivery_method' => 'direct_to_billing_provider'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'aws_marketplace',
'configuration' => [
'aws_customer_id' => 'ABC123ABC12',
'aws_product_code' => 'my_product',
'aws_region' => 'us-west-1'
],
'delivery_method' => 'direct_to_billing_provider'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'azure_marketplace',
'configuration' => [
'azure_subscription_id' => 'my_subscription'
],
'delivery_method_id' => '5b9e3072-415b-4842-94f0-0b6700c8b6be'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'aws_marketplace',
'configuration' => [
'aws_customer_id' => 'ABC123ABC12',
'aws_product_code' => 'my_product',
'aws_region' => 'us-west-1',
'aws_is_subscription_product' => true
],
'delivery_method' => 'direct_to_billing_provider'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'gcp_marketplace',
'configuration' => [
'gcp_entitlement_id' => 'my_entitlement',
'gcp_service_name' => 'my.service.endpoint.goog'
],
'delivery_method' => 'direct_to_billing_provider'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'netsuite',
'configuration' => [
'netsuite_customer_id' => '12345'
],
'delivery_method' => 'direct_to_billing_provider'
]
]
]),
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/setCustomerBillingProviderConfigurations"
payload := strings.NewReader("{\n \"data\": [\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"stripe\",\n \"configuration\": {\n \"stripe_customer_id\": \"cus_1234\",\n \"stripe_collection_method\": \"charge_automatically\",\n \"leave_stripe_invoices_in_draft\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"azure_marketplace\",\n \"configuration\": {\n \"azure_subscription_id\": \"my_subscription\"\n },\n \"delivery_method_id\": \"5b9e3072-415b-4842-94f0-0b6700c8b6be\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\",\n \"aws_is_subscription_product\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"gcp_marketplace\",\n \"configuration\": {\n \"gcp_entitlement_id\": \"my_entitlement\",\n \"gcp_service_name\": \"my.service.endpoint.goog\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"netsuite\",\n \"configuration\": {\n \"netsuite_customer_id\": \"12345\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n }\n ]\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/setCustomerBillingProviderConfigurations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"stripe\",\n \"configuration\": {\n \"stripe_customer_id\": \"cus_1234\",\n \"stripe_collection_method\": \"charge_automatically\",\n \"leave_stripe_invoices_in_draft\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"azure_marketplace\",\n \"configuration\": {\n \"azure_subscription_id\": \"my_subscription\"\n },\n \"delivery_method_id\": \"5b9e3072-415b-4842-94f0-0b6700c8b6be\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\",\n \"aws_is_subscription_product\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"gcp_marketplace\",\n \"configuration\": {\n \"gcp_entitlement_id\": \"my_entitlement\",\n \"gcp_service_name\": \"my.service.endpoint.goog\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"netsuite\",\n \"configuration\": {\n \"netsuite_customer_id\": \"12345\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/setCustomerBillingProviderConfigurations")
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 \"data\": [\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"stripe\",\n \"configuration\": {\n \"stripe_customer_id\": \"cus_1234\",\n \"stripe_collection_method\": \"charge_automatically\",\n \"leave_stripe_invoices_in_draft\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"azure_marketplace\",\n \"configuration\": {\n \"azure_subscription_id\": \"my_subscription\"\n },\n \"delivery_method_id\": \"5b9e3072-415b-4842-94f0-0b6700c8b6be\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\",\n \"aws_is_subscription_product\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"gcp_marketplace\",\n \"configuration\": {\n \"gcp_entitlement_id\": \"my_entitlement\",\n \"gcp_service_name\": \"my.service.endpoint.goog\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"netsuite\",\n \"configuration\": {\n \"netsuite_customer_id\": \"12345\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"configuration": {},
"delivery_method_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}Customers
Set billing provider configurations for a customer
Create a billing configuration for a customer. Once created, these configurations are available to associate to a contract and dictates which downstream system to collect payment in or send the invoice to. You can create multiple configurations per customer. The configuration formats are distinct for each downstream provider.
Use this endpoint to:
- Add the initial configuration to an existing customer. Once created, the billing configuration can then be associated to the customer’s contract.
- Add a new configuration to an existing customer. This might be used as part of an upgrade or downgrade workflow where the customer was previously billed through system A (e.g. Stripe) but will now be billed through system B (e.g. AWS). Once created, the new configuration can then be associated to the customer’s contract.
- Multiple configurations can be added per destination. For example, you can create two Stripe billing configurations for a Metronome customer that each have a distinct
collection_method.
Delivery method options:
direct_to_billing_provider: Use when Metronome should send invoices directly to the billing provider’s API (e.g., Stripe, NetSuite). This is the most common method for automated billing workflows.tackle: Use specifically for AWS Marketplace transactions that require Tackle’s co-selling platform for partner attribution and commission tracking.aws_sqs: Use when you want invoice data delivered to an AWS SQS queue for custom processing before sending to your billing system.aws_sns: Use when you want invoice notifications published to an AWS SNS topic for event-driven billing workflows.
Key response fields:
The id for the customer billing configuration. This id can be used to associate the billing configuration to a contract.
Usage guidelines:
Must use the delivery_method_id if you have multiple Stripe accounts connected to Metronome.
POST
/
v1
/
setCustomerBillingProviderConfigurations
Set billing provider configurations for a customer
curl --request POST \
--url https://api.metronome.com/v1/setCustomerBillingProviderConfigurations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "stripe",
"configuration": {
"stripe_customer_id": "cus_1234",
"stripe_collection_method": "charge_automatically",
"leave_stripe_invoices_in_draft": true
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "aws_marketplace",
"configuration": {
"aws_customer_id": "ABC123ABC12",
"aws_product_code": "my_product",
"aws_region": "us-west-1"
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "azure_marketplace",
"configuration": {
"azure_subscription_id": "my_subscription"
},
"delivery_method_id": "5b9e3072-415b-4842-94f0-0b6700c8b6be"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "aws_marketplace",
"configuration": {
"aws_customer_id": "ABC123ABC12",
"aws_product_code": "my_product",
"aws_region": "us-west-1",
"aws_is_subscription_product": true
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "gcp_marketplace",
"configuration": {
"gcp_entitlement_id": "my_entitlement",
"gcp_service_name": "my.service.endpoint.goog"
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "netsuite",
"configuration": {
"netsuite_customer_id": "12345"
},
"delivery_method": "direct_to_billing_provider"
}
]
}
'import requests
url = "https://api.metronome.com/v1/setCustomerBillingProviderConfigurations"
payload = { "data": [
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "stripe",
"configuration": {
"stripe_customer_id": "cus_1234",
"stripe_collection_method": "charge_automatically",
"leave_stripe_invoices_in_draft": True
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "aws_marketplace",
"configuration": {
"aws_customer_id": "ABC123ABC12",
"aws_product_code": "my_product",
"aws_region": "us-west-1"
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "azure_marketplace",
"configuration": { "azure_subscription_id": "my_subscription" },
"delivery_method_id": "5b9e3072-415b-4842-94f0-0b6700c8b6be"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "aws_marketplace",
"configuration": {
"aws_customer_id": "ABC123ABC12",
"aws_product_code": "my_product",
"aws_region": "us-west-1",
"aws_is_subscription_product": True
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "gcp_marketplace",
"configuration": {
"gcp_entitlement_id": "my_entitlement",
"gcp_service_name": "my.service.endpoint.goog"
},
"delivery_method": "direct_to_billing_provider"
},
{
"customer_id": "4db51251-61de-4bfe-b9ce-495e244f3491",
"billing_provider": "netsuite",
"configuration": { "netsuite_customer_id": "12345" },
"delivery_method": "direct_to_billing_provider"
}
] }
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({
data: [
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'stripe',
configuration: {
stripe_customer_id: 'cus_1234',
stripe_collection_method: 'charge_automatically',
leave_stripe_invoices_in_draft: true
},
delivery_method: 'direct_to_billing_provider'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'aws_marketplace',
configuration: {
aws_customer_id: 'ABC123ABC12',
aws_product_code: 'my_product',
aws_region: 'us-west-1'
},
delivery_method: 'direct_to_billing_provider'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'azure_marketplace',
configuration: {azure_subscription_id: 'my_subscription'},
delivery_method_id: '5b9e3072-415b-4842-94f0-0b6700c8b6be'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'aws_marketplace',
configuration: {
aws_customer_id: 'ABC123ABC12',
aws_product_code: 'my_product',
aws_region: 'us-west-1',
aws_is_subscription_product: true
},
delivery_method: 'direct_to_billing_provider'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'gcp_marketplace',
configuration: {
gcp_entitlement_id: 'my_entitlement',
gcp_service_name: 'my.service.endpoint.goog'
},
delivery_method: 'direct_to_billing_provider'
},
{
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
billing_provider: 'netsuite',
configuration: {netsuite_customer_id: '12345'},
delivery_method: 'direct_to_billing_provider'
}
]
})
};
fetch('https://api.metronome.com/v1/setCustomerBillingProviderConfigurations', 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/setCustomerBillingProviderConfigurations",
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([
'data' => [
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'stripe',
'configuration' => [
'stripe_customer_id' => 'cus_1234',
'stripe_collection_method' => 'charge_automatically',
'leave_stripe_invoices_in_draft' => true
],
'delivery_method' => 'direct_to_billing_provider'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'aws_marketplace',
'configuration' => [
'aws_customer_id' => 'ABC123ABC12',
'aws_product_code' => 'my_product',
'aws_region' => 'us-west-1'
],
'delivery_method' => 'direct_to_billing_provider'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'azure_marketplace',
'configuration' => [
'azure_subscription_id' => 'my_subscription'
],
'delivery_method_id' => '5b9e3072-415b-4842-94f0-0b6700c8b6be'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'aws_marketplace',
'configuration' => [
'aws_customer_id' => 'ABC123ABC12',
'aws_product_code' => 'my_product',
'aws_region' => 'us-west-1',
'aws_is_subscription_product' => true
],
'delivery_method' => 'direct_to_billing_provider'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'gcp_marketplace',
'configuration' => [
'gcp_entitlement_id' => 'my_entitlement',
'gcp_service_name' => 'my.service.endpoint.goog'
],
'delivery_method' => 'direct_to_billing_provider'
],
[
'customer_id' => '4db51251-61de-4bfe-b9ce-495e244f3491',
'billing_provider' => 'netsuite',
'configuration' => [
'netsuite_customer_id' => '12345'
],
'delivery_method' => 'direct_to_billing_provider'
]
]
]),
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/setCustomerBillingProviderConfigurations"
payload := strings.NewReader("{\n \"data\": [\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"stripe\",\n \"configuration\": {\n \"stripe_customer_id\": \"cus_1234\",\n \"stripe_collection_method\": \"charge_automatically\",\n \"leave_stripe_invoices_in_draft\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"azure_marketplace\",\n \"configuration\": {\n \"azure_subscription_id\": \"my_subscription\"\n },\n \"delivery_method_id\": \"5b9e3072-415b-4842-94f0-0b6700c8b6be\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\",\n \"aws_is_subscription_product\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"gcp_marketplace\",\n \"configuration\": {\n \"gcp_entitlement_id\": \"my_entitlement\",\n \"gcp_service_name\": \"my.service.endpoint.goog\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"netsuite\",\n \"configuration\": {\n \"netsuite_customer_id\": \"12345\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n }\n ]\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/setCustomerBillingProviderConfigurations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"stripe\",\n \"configuration\": {\n \"stripe_customer_id\": \"cus_1234\",\n \"stripe_collection_method\": \"charge_automatically\",\n \"leave_stripe_invoices_in_draft\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"azure_marketplace\",\n \"configuration\": {\n \"azure_subscription_id\": \"my_subscription\"\n },\n \"delivery_method_id\": \"5b9e3072-415b-4842-94f0-0b6700c8b6be\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\",\n \"aws_is_subscription_product\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"gcp_marketplace\",\n \"configuration\": {\n \"gcp_entitlement_id\": \"my_entitlement\",\n \"gcp_service_name\": \"my.service.endpoint.goog\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"netsuite\",\n \"configuration\": {\n \"netsuite_customer_id\": \"12345\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/setCustomerBillingProviderConfigurations")
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 \"data\": [\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"stripe\",\n \"configuration\": {\n \"stripe_customer_id\": \"cus_1234\",\n \"stripe_collection_method\": \"charge_automatically\",\n \"leave_stripe_invoices_in_draft\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"azure_marketplace\",\n \"configuration\": {\n \"azure_subscription_id\": \"my_subscription\"\n },\n \"delivery_method_id\": \"5b9e3072-415b-4842-94f0-0b6700c8b6be\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"aws_marketplace\",\n \"configuration\": {\n \"aws_customer_id\": \"ABC123ABC12\",\n \"aws_product_code\": \"my_product\",\n \"aws_region\": \"us-west-1\",\n \"aws_is_subscription_product\": true\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"gcp_marketplace\",\n \"configuration\": {\n \"gcp_entitlement_id\": \"my_entitlement\",\n \"gcp_service_name\": \"my.service.endpoint.goog\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n },\n {\n \"customer_id\": \"4db51251-61de-4bfe-b9ce-495e244f3491\",\n \"billing_provider\": \"netsuite\",\n \"configuration\": {\n \"netsuite_customer_id\": \"12345\"\n },\n \"delivery_method\": \"direct_to_billing_provider\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"configuration": {},
"delivery_method_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The details of the billing provider configurations to insert
Show child attributes
Show child attributes
Response
Success
Show child attributes
Show child attributes
⌘I