The CustomPricingUnit object 

Attributes

  • idstring

    The ID of the custom pricing unit.

  • 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.

  • createdtimestamp

    Timestamp of when the object was created.

  • display_namestring

    Description that customers will see in the invoice line item. Maximum length of 250 characters.

  • livemodeboolean

    Has the value true if the object exists in live mode or the value false if the object exists in test mode.

  • lookup_keynullable string

    An internal key you can use to search for a particular CustomPricingUnit item. 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.

The CustomPricingUnit object
{
"created": "2025-01-01T00:00:00.000Z",
"display_name": "4242",
"id": "4242",
"lookup_key": "4242",
"metadata": {
"4242": "4242"
},
"object": "4242",
"livemode": true
}

createCustomPricingUnit v2

Create a CustomPricingUnit object.

Learn more about calling API v2 endpoints.

Parameters

  • display_namestringRequired

    Description that customers will see in the invoice line item. Maximum length of 250 characters.

  • lookup_keystring

    An internal key you can use to search for a particular CustomPricingUnit 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

    The ID of the custom pricing unit.

  • 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.

  • createdtimestamp

    Timestamp of when the object was created.

  • display_namestring

    Description that customers will see in the invoice line item. Maximum length of 250 characters.

  • livemodeboolean

    Has the value true if the object exists in live mode or the value false if the object exists in test mode.

  • lookup_keynullable string

    An internal key you can use to search for a particular CustomPricingUnit item. 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.

Error Codes
400lookup_key_already_used

Returned when another object of the same type already has the given lookup key.

POST /v2/billing/custom_pricing_units
curl -X POST https://api.stripe.com/v2/billing/custom_pricing_units \
-H "Authorization: Bearer sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2" \
-H "Stripe-Version: 2025-07-30.preview" \
--json {"display_name":"4242"}
Response
{
"created": "2025-01-01T00:00:00.000Z",
"display_name": "4242",
"id": "4242",
"lookup_key": "4242",
"metadata": {
"4242": "4242"
},
"object": "4242",
"livemode": true
}

retrieveCustomPricingUnit v2

Retrieve a CustomPricingUnit object.

Learn more about calling API v2 endpoints.

Parameters

  • idstringRequired

    The ID of the custom pricing unit.

Returns

Response attributes

  • idstring

    The ID of the custom pricing unit.

  • 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.

  • createdtimestamp

    Timestamp of when the object was created.

  • display_namestring

    Description that customers will see in the invoice line item. Maximum length of 250 characters.

  • livemodeboolean

    Has the value true if the object exists in live mode or the value false if the object exists in test mode.

  • lookup_keynullable string

    An internal key you can use to search for a particular CustomPricingUnit item. 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.

Error Codes
404custom_pricing_unit_not_found

Returned by CustomPricingUnit API when the custom pricing unit is not found.

GET /v2/billing/custom_pricing_units/:id
curl https://api.stripe.com/v2/billing/custom_pricing_units/REPLACE ME \
-H "Authorization: Bearer sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2" \
-H "Stripe-Version: 2025-07-30.preview"
Response
{
"created": "2025-01-01T00:00:00.000Z",
"display_name": "4242",
"id": "4242",
"lookup_key": "4242",
"metadata": {
"4242": "4242"
},
"object": "4242",
"livemode": true
}

Licensed Items v2

Service Actions v2

A ServiceAction represents a recurring, automated action that can be applied as part of a subscription.