curl --request PATCH \
--url https://api.paygentic.io/v0/prices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"billableMetricId": "<string>",
"pricingUnitId": "<string>",
"invoiceDisplayName": "<string>",
"invoiceDisplayGroup": "<string>",
"invoiceRateLabel": "<string>",
"properties": {
"unitPrice": "<string>"
},
"billingCadence": "<string>",
"feature": {
"featureId": "<string>",
"entitlementTemplate": {}
},
"grantDiscountEnabled": true,
"isObligation": true,
"quantity": 1
}
'import requests
url = "https://api.paygentic.io/v0/prices/{id}"
payload = {
"billableMetricId": "<string>",
"pricingUnitId": "<string>",
"invoiceDisplayName": "<string>",
"invoiceDisplayGroup": "<string>",
"invoiceRateLabel": "<string>",
"properties": { "unitPrice": "<string>" },
"billingCadence": "<string>",
"feature": {
"featureId": "<string>",
"entitlementTemplate": {}
},
"grantDiscountEnabled": True,
"isObligation": True,
"quantity": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
billableMetricId: '<string>',
pricingUnitId: '<string>',
invoiceDisplayName: '<string>',
invoiceDisplayGroup: '<string>',
invoiceRateLabel: '<string>',
properties: {unitPrice: '<string>'},
billingCadence: '<string>',
feature: {featureId: '<string>', entitlementTemplate: {}},
grantDiscountEnabled: true,
isObligation: true,
quantity: 1
})
};
fetch('https://api.paygentic.io/v0/prices/{id}', 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.paygentic.io/v0/prices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'billableMetricId' => '<string>',
'pricingUnitId' => '<string>',
'invoiceDisplayName' => '<string>',
'invoiceDisplayGroup' => '<string>',
'invoiceRateLabel' => '<string>',
'properties' => [
'unitPrice' => '<string>'
],
'billingCadence' => '<string>',
'feature' => [
'featureId' => '<string>',
'entitlementTemplate' => [
]
],
'grantDiscountEnabled' => true,
'isObligation' => true,
'quantity' => 1
]),
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.paygentic.io/v0/prices/{id}"
payload := strings.NewReader("{\n \"billableMetricId\": \"<string>\",\n \"pricingUnitId\": \"<string>\",\n \"invoiceDisplayName\": \"<string>\",\n \"invoiceDisplayGroup\": \"<string>\",\n \"invoiceRateLabel\": \"<string>\",\n \"properties\": {\n \"unitPrice\": \"<string>\"\n },\n \"billingCadence\": \"<string>\",\n \"feature\": {\n \"featureId\": \"<string>\",\n \"entitlementTemplate\": {}\n },\n \"grantDiscountEnabled\": true,\n \"isObligation\": true,\n \"quantity\": 1\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.paygentic.io/v0/prices/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"billableMetricId\": \"<string>\",\n \"pricingUnitId\": \"<string>\",\n \"invoiceDisplayName\": \"<string>\",\n \"invoiceDisplayGroup\": \"<string>\",\n \"invoiceRateLabel\": \"<string>\",\n \"properties\": {\n \"unitPrice\": \"<string>\"\n },\n \"billingCadence\": \"<string>\",\n \"feature\": {\n \"featureId\": \"<string>\",\n \"entitlementTemplate\": {}\n },\n \"grantDiscountEnabled\": true,\n \"isObligation\": true,\n \"quantity\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/prices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"billableMetricId\": \"<string>\",\n \"pricingUnitId\": \"<string>\",\n \"invoiceDisplayName\": \"<string>\",\n \"invoiceDisplayGroup\": \"<string>\",\n \"invoiceRateLabel\": \"<string>\",\n \"properties\": {\n \"unitPrice\": \"<string>\"\n },\n \"billingCadence\": \"<string>\",\n \"feature\": {\n \"featureId\": \"<string>\",\n \"entitlementTemplate\": {}\n },\n \"grantDiscountEnabled\": true,\n \"isObligation\": true,\n \"quantity\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "price_r7s8t9u0v1w2x3y4",
"object": "price",
"billableMetricId": "bm_z5a6b7c8d9e0f1g2",
"createdAt": "2024-01-25T10:00:00Z",
"currency": "USD",
"description": "Per-call pricing for ML inference",
"invoiceDisplayName": "Inference API Calls",
"model": "standard",
"paymentTerm": "in_arrears",
"properties": {
"unitPrice": "0.05"
},
"unitAmount": "50000000",
"updatedAt": "2024-03-05T14:20:00Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "<string>",
"code": "PRICE_STRUCTURALLY_LOCKED_BY_SUBSCRIPTION",
"error": "<string>",
"details": {
"priceId": "<string>",
"fields": [
"<string>"
],
"subscriptionCount": 123
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}Update
curl --request PATCH \
--url https://api.paygentic.io/v0/prices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"billableMetricId": "<string>",
"pricingUnitId": "<string>",
"invoiceDisplayName": "<string>",
"invoiceDisplayGroup": "<string>",
"invoiceRateLabel": "<string>",
"properties": {
"unitPrice": "<string>"
},
"billingCadence": "<string>",
"feature": {
"featureId": "<string>",
"entitlementTemplate": {}
},
"grantDiscountEnabled": true,
"isObligation": true,
"quantity": 1
}
'import requests
url = "https://api.paygentic.io/v0/prices/{id}"
payload = {
"billableMetricId": "<string>",
"pricingUnitId": "<string>",
"invoiceDisplayName": "<string>",
"invoiceDisplayGroup": "<string>",
"invoiceRateLabel": "<string>",
"properties": { "unitPrice": "<string>" },
"billingCadence": "<string>",
"feature": {
"featureId": "<string>",
"entitlementTemplate": {}
},
"grantDiscountEnabled": True,
"isObligation": True,
"quantity": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
billableMetricId: '<string>',
pricingUnitId: '<string>',
invoiceDisplayName: '<string>',
invoiceDisplayGroup: '<string>',
invoiceRateLabel: '<string>',
properties: {unitPrice: '<string>'},
billingCadence: '<string>',
feature: {featureId: '<string>', entitlementTemplate: {}},
grantDiscountEnabled: true,
isObligation: true,
quantity: 1
})
};
fetch('https://api.paygentic.io/v0/prices/{id}', 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.paygentic.io/v0/prices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'billableMetricId' => '<string>',
'pricingUnitId' => '<string>',
'invoiceDisplayName' => '<string>',
'invoiceDisplayGroup' => '<string>',
'invoiceRateLabel' => '<string>',
'properties' => [
'unitPrice' => '<string>'
],
'billingCadence' => '<string>',
'feature' => [
'featureId' => '<string>',
'entitlementTemplate' => [
]
],
'grantDiscountEnabled' => true,
'isObligation' => true,
'quantity' => 1
]),
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.paygentic.io/v0/prices/{id}"
payload := strings.NewReader("{\n \"billableMetricId\": \"<string>\",\n \"pricingUnitId\": \"<string>\",\n \"invoiceDisplayName\": \"<string>\",\n \"invoiceDisplayGroup\": \"<string>\",\n \"invoiceRateLabel\": \"<string>\",\n \"properties\": {\n \"unitPrice\": \"<string>\"\n },\n \"billingCadence\": \"<string>\",\n \"feature\": {\n \"featureId\": \"<string>\",\n \"entitlementTemplate\": {}\n },\n \"grantDiscountEnabled\": true,\n \"isObligation\": true,\n \"quantity\": 1\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.paygentic.io/v0/prices/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"billableMetricId\": \"<string>\",\n \"pricingUnitId\": \"<string>\",\n \"invoiceDisplayName\": \"<string>\",\n \"invoiceDisplayGroup\": \"<string>\",\n \"invoiceRateLabel\": \"<string>\",\n \"properties\": {\n \"unitPrice\": \"<string>\"\n },\n \"billingCadence\": \"<string>\",\n \"feature\": {\n \"featureId\": \"<string>\",\n \"entitlementTemplate\": {}\n },\n \"grantDiscountEnabled\": true,\n \"isObligation\": true,\n \"quantity\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/prices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"billableMetricId\": \"<string>\",\n \"pricingUnitId\": \"<string>\",\n \"invoiceDisplayName\": \"<string>\",\n \"invoiceDisplayGroup\": \"<string>\",\n \"invoiceRateLabel\": \"<string>\",\n \"properties\": {\n \"unitPrice\": \"<string>\"\n },\n \"billingCadence\": \"<string>\",\n \"feature\": {\n \"featureId\": \"<string>\",\n \"entitlementTemplate\": {}\n },\n \"grantDiscountEnabled\": true,\n \"isObligation\": true,\n \"quantity\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "price_r7s8t9u0v1w2x3y4",
"object": "price",
"billableMetricId": "bm_z5a6b7c8d9e0f1g2",
"createdAt": "2024-01-25T10:00:00Z",
"currency": "USD",
"description": "Per-call pricing for ML inference",
"invoiceDisplayName": "Inference API Calls",
"model": "standard",
"paymentTerm": "in_arrears",
"properties": {
"unitPrice": "0.05"
},
"unitAmount": "50000000",
"updatedAt": "2024-03-05T14:20:00Z"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "<string>",
"code": "PRICE_STRUCTURALLY_LOCKED_BY_SUBSCRIPTION",
"error": "<string>",
"details": {
"priceId": "<string>",
"fields": [
"<string>"
],
"subscriptionCount": 123
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Path Parameters
The unique identifier of the price Unique identifier for a price
^price_[a-zA-Z0-9]+$Body
The unique identifier for the billable metric referred to by this price.
^bm_[a-zA-Z0-9]+$Denominate this metered price in a pricing unit (credits). Set to a pricing unit ID to draw down a credit pool, null to revert to real currency, or omit to leave unchanged.
^pu_[a-zA-Z0-9]+$Updated invoice line item label. Sample values: 'LLM Token Usage', 'Storage Charges', 'API Call Fees'
Presentation only. Prices sharing this value, within one billing period, print as a single row on the rendered invoice PDF and are described by this string. Every member still bills its own line item on the ledger, this API and the compliance document. Requires invoiceRateLabel. Sample values: 'Cross Border Fees', 'FX Fees'
This price's contribution to the combined row's rate cell, joined with ' + ' across the group. Only read for a price that sets invoiceDisplayGroup. Sample values: '1.00%', '0.30 GBP', '2.5%'
The pricing model to set. 'standard' and 'volume' are accepted. Legacy 'dynamic'/'percentage' prices can still be edited (other fields) but cannot be switched back to those models. Percentage/revenue-share is expressed via 'standard' with a unit-price multiplier.
standard, volume Standard pricing model
- StandardPriceProperties
- DynamicPriceProperties
- VolumePriceProperties
- PercentagePriceProperties
Show child attributes
Show child attributes
Billing timing preference: 'in_advance' (prepaid — charged upfront or drawn from a prepaid commitment) or 'in_arrears' (charged at period end).
in_arrears, in_advance ISO 8601 duration for recurring fees (e.g., 'P1M' for monthly, 'P1Y' for yearly, or 'P0D' for one-time)
Feature to associate. Set to null to remove existing feature. Omit to leave unchanged.
Show child attributes
Show child attributes
When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
A fixed amount owed whole rather than a per-period rate. An obligation is not prorated over a partial first period: when a subscription starts before its billing anchor, no truncated stub is billed and the first charge is the full amount at the next anchor. An obligation also refuses an interval boundary that falls strictly inside one of its own billing periods, since part of an amount owed whole is not a thing to bill. Defaults to false, which is a rate and is today's behaviour for every price. Not supported on a metered price, whose amount resolves from usage at close.
Quantity for invoice line items. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
x >= 0Response
Price updated successfully
Unique identifier for a price
^price_[a-zA-Z0-9]+$price The merchant organization that owns this price, derived from the associated fee or billable metric. Present on single-price reads.
^org_[a-zA-Z0-9]+$in_arrears, in_advance Standard pricing model
- StandardPriceProperties
- DynamicPriceProperties
- VolumePriceProperties
- PercentagePriceProperties
Show child attributes
Show child attributes
Quantity for invoice line items. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
x >= 0Unique identifier for a billable metric
^bm_[a-zA-Z0-9]+$The unique identifier for the fee referred to by this price. Present when price is linked to a fee.
^fee_[a-zA-Z0-9]+$The pricing unit this price is denominated in (credits). Present when the price draws down a credit pool instead of charging real currency.
^pu_[a-zA-Z0-9]+$ISO 8601 duration. 'P0D' for one-time, 'P1M' for monthly, 'P1Y' for yearly. Required for fees, optional for billable metrics. Defaults to plan's billingCadence if not specified.
Presentation only. Prices sharing this value, within one billing period, print as a single row on the rendered invoice PDF and are described by this string. Every member still bills its own line item on the ledger, this API and the compliance document. Requires invoiceRateLabel. Sample values: 'Cross Border Fees', 'FX Fees'
This price's contribution to the combined row's rate cell, joined with ' + ' across the group. Only read for a price that sets invoiceDisplayGroup. Sample values: '1.00%', '0.30 GBP', '2.5%'
Pricing model of a price as returned by the API. Includes the legacy models ('dynamic', 'percentage') retained for existing prices; 'standard' and 'volume' can be created (see PriceModelInput).
standard, dynamic, volume, percentage Features associated with this price
Show child attributes
Show child attributes
When true, grants applied to a subscription will discount usage charged by this price. Only supported for standard metered prices.
A fixed amount owed whole rather than a per-period rate. An obligation is not prorated over a partial first period: when a subscription starts before its billing anchor, no truncated stub is billed and the first charge is the full amount at the next anchor. An obligation also refuses an interval boundary that falls strictly inside one of its own billing periods, since part of an amount owed whole is not a thing to bill. Defaults to false, which is a rate and is today's behaviour for every price. Not supported on a metered price, whose amount resolves from usage at close.
Was this page helpful?