A ServiceAction represents a recurring, automated action that can be applied as part of a subscription.
Attributes
- idstring
Unique identifier for the ServiceAction.
- objectstring, value is "v2.billing.service_action"
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.
- credit_
grantnullable object Details for the credit grant. Provided only if
type
is “credit_grant”. - credit_
grant_ per_ tenantnullable object Details for the credit grant per tenant. Provided only if
type
is “credit_grant_per_tenant”. - 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 this service action.
- service_
intervalenum The interval for assessing service.
Possible enum valuesday
Assess service by days.
month
Assess service by months.
week
Assess service by weeks.
year
Assess service by years.
- service_
interval_ countinteger The length of the interval for assessing service.
- typeenum
The type of the service action.
Possible enum valuescredit_
grant The service action is of type credit grant.
credit_
grant_ per_ tenant The service action is of type credit grant per tenant.
{ "created": "2025-01-01T00:00:00.000Z", "id": "4242", "lookup_key": "4242", "object": "4242", "service_interval": "day", "service_interval_count": 4242, "type": "credit_grant", "livemode": true, "credit_grant": { "amount": { "type": "custom_pricing_unit", "custom_pricing_unit": { "id": "4242", "value": "4242" }, "monetary": { "currency": "4242", "value": "4242" } }, "applicability_config": { "scope": { "billable_items": [ "4242" ], "price_type": "metered" } }, "expiry_config": { "type": "end_of_service_period" }, "name": "4242" }}
Create a ServiceAction object.
Learn more about calling API v2 endpoints.Parameters
- service_
intervalenumRequired The interval for assessing service.
Possible enum valuesday
Assess service by days.
month
Assess service by months.
week
Assess service by weeks.
year
Assess service by years.
- service_
interval_ countintegerRequired The length of the interval for assessing service.
- typeenumRequired
The type of the service action.
Possible enum valuescredit_
grant The service action is of type credit grant.
credit_
grant_ per_ tenant The service action is of type credit grant per tenant.
- credit_
grantobject Details for the credit grant. Required if
type
is “credit_grant”. - credit_
grant_ per_ tenantobject Details for the credit grant per tenant. Required if
type
is “credit_grant_per_tenant”. - lookup_
keystring An internal key you can use to search for this service action. Maximum length of 200 characters.
Returns
Response attributes
- idstring
Unique identifier for the ServiceAction.
- objectstring, value is "v2.billing.service_action"
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.
- credit_
grantnullable object Details for the credit grant. Provided only if
type
is “credit_grant”. - credit_
grant_ per_ tenantnullable object Details for the credit grant per tenant. Provided only if
type
is “credit_grant_per_tenant”. - 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 this service action.
- service_
intervalenum The interval for assessing service.
Possible enum valuesday
Assess service by days.
month
Assess service by months.
week
Assess service by weeks.
year
Assess service by years.
- service_
interval_ countinteger The length of the interval for assessing service.
- typeenum
The type of the service action.
Possible enum valuescredit_
grant The service action is of type credit grant.
credit_
grant_ per_ tenant The service action is of type credit grant per tenant.
Returned by ServiceAction API when the price type is invalid.
Returned by ServiceAction API when the billable item is not a metered_item.
Returned when another object of the same type already has the given lookup key.
Returned by ServiceAction API when the type is invalid.
Returned when the provided billable_item ID cannot be found.
Returned by CustomPricingUnit API when the custom pricing unit is not found.
Returned when the provided license_fee ID cannot be found.
Returned when the provided rate_card ID cannot be found.
{ "created": "2025-01-01T00:00:00.000Z", "id": "4242", "lookup_key": "4242", "object": "4242", "service_interval": "day", "service_interval_count": 4242, "type": "credit_grant", "livemode": true, "credit_grant": { "amount": { "type": "custom_pricing_unit", "custom_pricing_unit": { "id": "4242", "value": "4242" }, "monetary": { "currency": "4242", "value": "4242" } }, "applicability_config": { "scope": { "billable_items": [ "4242" ], "price_type": "metered" } }, "expiry_config": { "type": "end_of_service_period" }, "name": "4242" }}
Retrieve a ServiceAction object.
Learn more about calling API v2 endpoints.Parameters
- idstringRequired
The ID of the Service Action.
Returns
Response attributes
- idstring
Unique identifier for the ServiceAction.
- objectstring, value is "v2.billing.service_action"
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.
- credit_
grantnullable object Details for the credit grant. Provided only if
type
is “credit_grant”. - credit_
grant_ per_ tenantnullable object Details for the credit grant per tenant. Provided only if
type
is “credit_grant_per_tenant”. - 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 this service action.
- service_
intervalenum The interval for assessing service.
Possible enum valuesday
Assess service by days.
month
Assess service by months.
week
Assess service by weeks.
year
Assess service by years.
- service_
interval_ countinteger The length of the interval for assessing service.
- typeenum
The type of the service action.
Possible enum valuescredit_
grant The service action is of type credit grant.
credit_
grant_ per_ tenant The service action is of type credit grant per tenant.
Returned by ServiceAction API when the service action is not found.
{ "created": "2025-01-01T00:00:00.000Z", "id": "4242", "lookup_key": "4242", "object": "4242", "service_interval": "day", "service_interval_count": 4242, "type": "credit_grant", "livemode": true, "credit_grant": { "amount": { "type": "custom_pricing_unit", "custom_pricing_unit": { "id": "4242", "value": "4242" }, "monetary": { "currency": "4242", "value": "4242" } }, "applicability_config": { "scope": { "billable_items": [ "4242" ], "price_type": "metered" } }, "expiry_config": { "type": "end_of_service_period" }, "name": "4242" }}
Rate Cards v2
A RateCard describes usage-based pricing. To bill a customer using a RateCard, create a RateCardSubscription which links it to the corresponding Cadence.
- POST/