Create a Custom Pricing Unit object.
Learn more about calling API v2 endpoints.Parameters
- display_
namestringRequired Description that customers will see in the invoice line item. Maximum length of 10 characters.
- lookup_
keystring An internal key you can use to search for a particular custom pricing unit item. Must be unique among items. Maximum length of 200 characters.
- metadatamap
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Returns
Response attributes
- idstring
Unique identifier for the object.
- objectstring, value is "v2.billing.custom_pricing_unit"
String representing the object’s type. Objects of the same type share the same value of the object field.
- activeboolean
Whether the custom pricing unit is active.
- createdtimestamp
Timestamp of when the object was created.
- display_
namestring Description that customers will see in the invoice line item. Maximum length of 10 characters.
- livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - lookup_
keynullable string An internal key you can use to search for a particular Custom Pricing Unit. Maximum length of 200 characters.
- metadatanullable map
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Returned when another object of the same type already has the given lookup key.
{ "active": true, "created": "2025-01-01T00:00:00.000Z", "display_name": "Unit #1", "id": "cpu_61T4sQA90ELFdWUhl16Ss95I3tSQSib3S1PC0IDCSFCS", "lookup_key": "my-custom-pricing-unit-1", "metadata": { "key": "value" }, "object": "v2.billing.custom_pricing_unit", "livemode": true}
Update a Custom Pricing Unit object.
Learn more about calling API v2 endpoints.Parameters
- idstringRequired
The ID of the Custom Pricing Unit to update.
- activeboolean
Whether the Custom Pricing Unit is active.
- display_
namestring Description that customers will see in the invoice line item.
- lookup_
keystring An internal key you can use to search for a particular CustomPricingUnit item.
- metadatamap
Set of key-value pairs that you can attach to an object.
Returns
Response attributes
- idstring
Unique identifier for the object.
- objectstring, value is "v2.billing.custom_pricing_unit"
String representing the object’s type. Objects of the same type share the same value of the object field.
- activeboolean
Whether the custom pricing unit is active.
- createdtimestamp
Timestamp of when the object was created.
- display_
namestring Description that customers will see in the invoice line item. Maximum length of 10 characters.
- livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - lookup_
keynullable string An internal key you can use to search for a particular Custom Pricing Unit. Maximum length of 200 characters.
- metadatanullable map
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Returned by CustomPricingUnit API when the custom pricing unit is not found.
{ "active": true, "created": "2025-01-01T00:00:00.000Z", "display_name": "Unit #1", "id": "cpu_61T4sQA90ELFdWUhl16Ss95I3tSQSib3S1PC0IDCSFCS", "lookup_key": "my-custom-pricing-unit-1", "metadata": {}, "object": "v2.billing.custom_pricing_unit", "livemode": true}
Retrieve a Custom Pricing Unit object.
Learn more about calling API v2 endpoints.Parameters
- idstringRequired
The ID of the Custom Pricing Unit to retrieve.
Returns
Response attributes
- idstring
Unique identifier for the object.
- objectstring, value is "v2.billing.custom_pricing_unit"
String representing the object’s type. Objects of the same type share the same value of the object field.
- activeboolean
Whether the custom pricing unit is active.
- createdtimestamp
Timestamp of when the object was created.
- display_
namestring Description that customers will see in the invoice line item. Maximum length of 10 characters.
- livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - lookup_
keynullable string An internal key you can use to search for a particular Custom Pricing Unit. Maximum length of 200 characters.
- metadatanullable map
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Returned by CustomPricingUnit API when the custom pricing unit is not found.
{ "active": true, "created": "2025-01-01T00:00:00.000Z", "display_name": "Unit #1", "id": "cpu_61T4sQA90ELFdWUhl16Ss95I3tSQSib3S1PC0IDCSFCS", "lookup_key": "my-custom-pricing-unit-1", "metadata": {}, "object": "v2.billing.custom_pricing_unit", "livemode": true}
List all Custom Pricing Unit objects.
Learn more about calling API v2 endpoints.Parameters
- activeboolean
Filter for active/inactive custom pricing units. Mutually exclusive with
lookup_
.keys - limitinteger
Optionally set the maximum number of results per page. Defaults to 20.
- lookup_
keysarray of strings Filter by lookup keys. Mutually exclusive with
active
. You can specify up to 10 lookup keys. - pagestring
A cursor for use in pagination.
Returns
Response attributes
- dataarray of objects
List of Custom Pricing Units.
- next_
page_ urlnullable string The URL to get the next page of results, if there are any.
- previous_
page_ urlnullable string The URL to get the previous page of results, if there are any.
{ "data": [ { "active": true, "created": "2025-01-01T00:00:00.000Z", "display_name": "Unit #1", "id": "cpu_61T4sQA90ELFdWUhl16Ss95I3tSQSib3S1PC0IDCSFCS", "lookup_key": "my-custom-pricing-unit-1", "metadata": {}, "object": "v2.billing.custom_pricing_unit", "livemode": true } ], "next_page_url": null, "previous_page_url": null}
A Licensed Item represents any item that you bill customers for based on the subscribed quantity.