Prices
Update Price Applies a partial update to a Price. Mutable fields: unitAmount, recurring, features, nickname, metadata. To switch type/currency/product, archive and create a new Price.
AuthorizationRequired Bearer <token>
API key as Bearer token
In: header
application/jsonRequired
unitAmountinteger
Minimum: 0 Maximum: 9007199254740991
featuresarray<object | object | object | object>
Pass null to clear; omit to preserve
nicknamestring
Pass null to clear; omit to preserve
metadataobject
Pass null to clear; omit to preserve
idRequired string
Price id, discoverable via list_prices
PATCH /v1/prices/{id} cURL Go Node.js Python PHP Ruby Java C# curl -X PATCH "https://api.3common.com/v1/prices/string" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"unitAmount": 9007199254740991,
"recurring": {
"interval": "day",
"intervalCount": 1
},
"features": [
{
"featureKey": "string",
"type": "boolean",
"enabled": true
}
],
"nickname": "string",
"metadata": {
"property1": "string",
"property2": "string"
}
}' Default Response 200 400 401 403 404
Response {
"data" : {
"id" : "string" ,
"hostId" : "string" ,
"productId" : "string" ,
"type" : "recurring" ,
"currency" : "USD" ,
"unitAmount" : 9007199254740991 ,
"recurring" : {
"interval" : "day" ,
"intervalCount" : 1
},
"features" : [
{
"featureKey" : "string" ,
"type" : "boolean" ,
"enabled" : true
}
],
"nickname" : "string" ,
"active" : true ,
"metadata" : {
"property1" : "string" ,
"property2" : "string"
},
"createdAt" : "2019-08-24T14:15:22Z" ,
"updatedAt" : "2019-08-24T14:15:22Z"
}
} TypeScript export interface Response {
data : {
id ?: string ;
hostId ?: string ;
/**
* The Product this Price applies to
*/
productId ?: string ;
/**
* Price cadence.
* - recurring: billed on a fixed cadence (subscription-backed)
* - one_time: single charge, typically used for add-on / top-up packs
*/
type ?: "recurring" | "one_time" ;
currency ?: "USD" | "CAD" ;
/**
* Per-unit cost in minor units (cents for USD)
*/
unitAmount ?: number ;
recurring ?: {
/**
* Cadence unit
*/
interval : "day" | "week" | "month" | "year" ;
/**
* Positive integer multiplier on interval (e.g. 3 with month = "every three months")
*/
intervalCount : number ;
};
features ?: (
| {
featureKey : string ;
type : "boolean" ;
enabled : boolean ;
}
| {
featureKey : string ;
type : "quantity" ;
/**
* null = unlimited
*/
quantity : number | null ;
rolloverEnabled : boolean ;
rolloverCap ?: number ;
expireOnCancel ?: boolean ;
}
| {
featureKey : string ;
type : "enum" ;
enumValue : string ;
}
| {
featureKey : string ;
type : "duration" ;
/**
* null = unlimited / "all time"
*/
durationDays : number | null ;
}
)[];
/**
* Admin-facing display label
*/
nickname ?: string ;
/**
* Soft-archive flag. Inactive prices cannot back new subscriptions
*/
active ?: boolean ;
/**
* Free-form key/value tags for integrations
*/
metadata ?: {
[ k : string ] : string ;
};
createdAt ?: string ;
updatedAt ?: string ;
};
}