Skip to content
Oclavex is in private preview, open to existing MonetizeIt users. New users who would like to evaluate Oclavex before the public launch can request access at info@revenusion.com.

Replace entitlement billing

PUT
/api/v1/provision/admin/entitlements/{entitlementId}/billing
curl --request PUT \
--url https://example.com/api/v1/provision/admin/entitlements/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/billing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "provider": "example", "mode": "ProviderManaged", "modeReason": "example", "method": "Unspecified", "interval": "Unspecified", "price": { "amount": 1, "currency": "example" }, "billingReference": "example", "notes": "example", "contactName": "example", "contactEmail": "example", "contactPhone": "example", "addressLine1": "example", "addressLine2": "example", "postalCode": "example", "city": "example", "stateOrProvince": "example", "countryCode": "example", "details": { "additionalProperty": "example" } }'

Creates or replaces the operator-editable part of the entitlement’s billing record. A member the body does not have is refused with 400 naming it: providerCustomerReference is read-only, written only by the billing provider’s subscription events.

  • oidc
    provision.entitlement.update
entitlementId
required
string format: uuid

Entitlement id.

X-Correlation-Id
string

An id of your own for the call. The answer returns it in the same header, and the server log carries it; when you send none, the server makes one.

The record’s provider, mode, method, amount, contact, reference, notes and details.

Media typeapplication/json

The operator-editable part of a billing record, replaced whole by a PUT. The provider anchors and the subscription state are Provision’s and are not on this payload. Use FromBilling(EntitlementBilling billing) to prefill from the current record.

object
provider
string
mode

Who drives the entitlement’s plan.

Allowed values: ProviderManaged OperatorManaged NotBillable
modeReason
string
method

How money is collected for the entitlement.

Allowed values: Unspecified Subscription OneTime Invoice Free
interval

How often the entitlement bills.

Allowed values: Unspecified Day Week Month Year Once
price
One of:
null
billingReference
string
notes
string
contactName
string
contactEmail
string
contactPhone
string
addressLine1
string
addressLine2
string
postalCode
string
city
string
stateOrProvince
string
countryCode
string
details
object
key
additional properties
string

OK

Media typeapplication/json

The billing record of an entitlement, or the billing template of an offer: who bills it and how, the invoice recipient, the customer’s own reference, an amount recorded for the vendor’s overview, and the provider’s identifiers. Provision writes the provider anchors and the subscription state from the connector’s events; everything else is the operator’s.

object
id
string format: uuid
entitlementId
string format: uuid
provider

One of BillingProviders, or a value a connector registered.

string
mode

Who drives the entitlement’s plan.

Allowed values: ProviderManaged OperatorManaged NotBillable
modeReason

Why an operator manages the plan by hand; set with BillingMode.OperatorManaged.

string
method

How money is collected for the entitlement.

Allowed values: Unspecified Subscription OneTime Invoice Free
interval

How often the entitlement bills.

Allowed values: Unspecified Day Week Month Year Once
price
One of:
null
providerCustomerReference

The provider’s own customer id (cus_…); written by Provision from the subscription event.

string
providerSubscriptionReference

The provider’s own subscription id (sub_…); unique per tenant and provider, written by Provision.

string
billingReference

The customer’s purchase order number or cost centre — what must appear on the invoice.

string
notes
string
contactName
string
contactEmail
string
contactPhone
string
addressLine1
string
addressLine2
string
postalCode
string
city
string
stateOrProvince
string
countryCode

ISO 3166-1 alpha-2.

string
details

Provider-specific key-values, keys prefixed by provider (stripe.price_lookup_key).

object
key
additional properties
string
state

Where the provider’s subscription stands, as Provision last recorded it from the subscription event. The connector holds the live picture; this is the copy the entitlement list filters on.

Allowed values: None Active Paid InvoiceOpen Trialing PastDue Paused Incomplete Canceled
stateObservedAt
null | string format: date-time
currentPeriodEndsAt
null | string format: date-time
pastDueAt

Start of the open past-due episode, when a payment failed and none has succeeded since.

null | string format: date-time
lapsePendingAt

When a lapse was recorded that could not be applied yet because another plan override stands.

null | string format: date-time
lapsedAt

When the payment lapse was applied to the plan; null once a payment or an operator lifts it.

null | string format: date-time
createdAt
string format: date-time
updatedAt
string format: date-time
Example
{
"mode": "ProviderManaged",
"method": "Unspecified",
"interval": "Unspecified",
"state": "None"
}
X-Correlation-Id
string

The correlation id of the call: the one you sent, or the one the server made.

Bad Request

Media typeapplication/problem+json

The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.

object
type

A reference to the code’s entry on the error-codes page.

string
title

A short summary of the problem.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong in this call, in a sentence.

string
instance

The path of the call.

string
code
required

The stable numeric error code. The error-codes page lists them.

integer format: int32
codeName
required

The stable name of the error code, for example resource.not_found.

string
traceId
required

The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.

string
requires

The scope or condition the caller is missing, on a refusal that names one.

null | string
scope

The limiter that shed the call, on a 429.

null | string
errors

On a validation failure, the messages for each field, keyed by the field’s name.

null | object
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"code": 1,
"codeName": "example",
"traceId": "example",
"requires": "example",
"scope": "example",
"errors": "example"
}
X-Correlation-Id
string

The correlation id of the call: the one you sent, or the one the server made.

The request carries no valid access token (auth.required).

Media typeapplication/problem+json

The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.

object
type

A reference to the code’s entry on the error-codes page.

string
title

A short summary of the problem.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong in this call, in a sentence.

string
instance

The path of the call.

string
code
required

The stable numeric error code. The error-codes page lists them.

integer format: int32
codeName
required

The stable name of the error code, for example resource.not_found.

string
traceId
required

The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.

string
requires

The scope or condition the caller is missing, on a refusal that names one.

null | string
scope

The limiter that shed the call, on a 429.

null | string
errors

On a validation failure, the messages for each field, keyed by the field’s name.

null | object
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"code": 1,
"codeName": "example",
"traceId": "example",
"requires": "example",
"scope": "example",
"errors": "example"
}
X-Correlation-Id
string

The correlation id of the call: the one you sent, or the one the server made.

WWW-Authenticate
string

How to authenticate: the bearer challenge.

The caller may not make this call. The code and requires members say why: a missing scope, or a plan that does not include it.

Media typeapplication/problem+json

The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.

object
type

A reference to the code’s entry on the error-codes page.

string
title

A short summary of the problem.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong in this call, in a sentence.

string
instance

The path of the call.

string
code
required

The stable numeric error code. The error-codes page lists them.

integer format: int32
codeName
required

The stable name of the error code, for example resource.not_found.

string
traceId
required

The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.

string
requires

The scope or condition the caller is missing, on a refusal that names one.

null | string
scope

The limiter that shed the call, on a 429.

null | string
errors

On a validation failure, the messages for each field, keyed by the field’s name.

null | object
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"code": 1,
"codeName": "example",
"traceId": "example",
"requires": "example",
"scope": "example",
"errors": "example"
}
X-Correlation-Id
string

The correlation id of the call: the one you sent, or the one the server made.

Not Found

Media typeapplication/problem+json

The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.

object
type

A reference to the code’s entry on the error-codes page.

string
title

A short summary of the problem.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong in this call, in a sentence.

string
instance

The path of the call.

string
code
required

The stable numeric error code. The error-codes page lists them.

integer format: int32
codeName
required

The stable name of the error code, for example resource.not_found.

string
traceId
required

The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.

string
requires

The scope or condition the caller is missing, on a refusal that names one.

null | string
scope

The limiter that shed the call, on a 429.

null | string
errors

On a validation failure, the messages for each field, keyed by the field’s name.

null | object
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"code": 1,
"codeName": "example",
"traceId": "example",
"requires": "example",
"scope": "example",
"errors": "example"
}
X-Correlation-Id
string

The correlation id of the call: the one you sent, or the one the server made.

The body is not sent as application/json (request.unsupported).

Media typeapplication/problem+json

The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.

object
type

A reference to the code’s entry on the error-codes page.

string
title

A short summary of the problem.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong in this call, in a sentence.

string
instance

The path of the call.

string
code
required

The stable numeric error code. The error-codes page lists them.

integer format: int32
codeName
required

The stable name of the error code, for example resource.not_found.

string
traceId
required

The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.

string
requires

The scope or condition the caller is missing, on a refusal that names one.

null | string
scope

The limiter that shed the call, on a 429.

null | string
errors

On a validation failure, the messages for each field, keyed by the field’s name.

null | object
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"code": 1,
"codeName": "example",
"traceId": "example",
"requires": "example",
"scope": "example",
"errors": "example"
}
X-Correlation-Id
string

The correlation id of the call: the one you sent, or the one the server made.

Too many requests. Wait the seconds in Retry-After, then send the call again (service.too-many-requests).

Media typeapplication/problem+json

The body of every failed call, served as application/problem+json (RFC 9457) with the members the platform adds: a numeric code, a codeName and a traceId.

object
type

A reference to the code’s entry on the error-codes page.

string
title

A short summary of the problem.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong in this call, in a sentence.

string
instance

The path of the call.

string
code
required

The stable numeric error code. The error-codes page lists them.

integer format: int32
codeName
required

The stable name of the error code, for example resource.not_found.

string
traceId
required

The id of the call in the server log. Quote it when you contact support. It equals the X-Correlation-Id of the answer.

string
requires

The scope or condition the caller is missing, on a refusal that names one.

null | string
scope

The limiter that shed the call, on a 429.

null | string
errors

On a validation failure, the messages for each field, keyed by the field’s name.

null | object
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"code": 1,
"codeName": "example",
"traceId": "example",
"requires": "example",
"scope": "example",
"errors": "example"
}
X-Correlation-Id
string

The correlation id of the call: the one you sent, or the one the server made.

Retry-After
integer

The seconds to wait before the call is sent again.

X-RateLimit-Limit
integer

The calls the limiter allows in its window, when it knows.

X-RateLimit-Remaining
integer

The calls left in the window, when the limiter knows.

X-RateLimit-Reset
integer

The seconds until the window resets, when the limiter knows.

X-RateLimit-Scope
string

Names the limiter that shed the call.