Partners in Billing need billing-worker v1.9.0 or later. Earlier versions have no partner support.
Step by step
1
Choose the partner's billing items
Billing has three restrictions. Use one of them per partner. The API field is the
field of a scope entry; the Console shows the name in the first column.The scope catalog lists the three Billing restrictions. Read it with Retrieve a productβs scope catalog for
billing-worker.Some rules apply to every scope:- A request that does not name one of the partnerβs items is refused. For example, a partner confined to a customer cannot list invoices without filtering by that customer.
- A request that lists several customers in a query is refused when any of them is outside the scope.
- The partner reads only your own billing, whatever its scope names.
2
Give the partner its permissions and scope
Create the partner, or change it, in the Console or with the Identity API. The product slug is
billing-worker.- Add one scope entry, with one or more values. Without it, Access Manager refuses the partner with
400andIDE-1060. - Check the resources and actions. The most you can give is what the Billing
editorrole holds in your tenant. Above that, Access Manager refuses withIDE-1043. For example,catalog-versionswithcatalog-versions:readis above that role.
A permission whose item is wider than the scope is refused with
400 and IDE-1056. For example, customers with customers:read for a partner confined to a subscription. The plans (plans with plans:read) act on the whole tenant and are never given to a partner: Access Manager refuses with 400 and IDE-1056.3
Create its Billing application
Create the partnerβs application with the product
billing-worker. See Create the partnerβs applications in the API guide, or in the Console. Send the client ID and the client secret to the partner through a secure channel.4
Tell the partner how to name its items
On the routes the partner reaches, the item is in the path, so the partner sends nothing extra. Only the two listings name the customer in a query. Every value must be inside the partnerβs scope.
These routes do not name a customer, a subscription, or an invoice, and are refused to every partner:
GET /v1/plans, GET /v1/plans/{planId}, and every route of the catalog, the schedules, the deployment identity, and provisioning. Use an application of your own institution for those routes.5
Confirm that it works
This check assumes the partner has the Send the same request with a customer outside the scope. The answer is
customers resource with the customers:read action on Billing, and a scope restricted to one customer. Use the partnerβs credential. Read the customer inside its scope. The answer is 200:403 with code BLW-0003.If something fails
The answer does not say whether the permissions or the scope refused the request. This is on purpose: a partner cannot use a refusal to learn which customers, subscriptions, or invoices exist outside its scope.
For the refusals when you create or change a partner, see Error codes in the API guide.

