Skip to main content
A partner can read your billing with its own credential. In Billing, you confine that credential to a customer, to some subscriptions, or to some invoices. This page shows how to choose that scope, what it reaches, and what the partner receives when it goes outside it. A partner only reads billing. Billing gives no partner any write, and nothing of its configuration. Every Billing partner needs a scope.
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 400 and IDE-1060.
  • Check the resources and actions. The most you can give is what the Billing editor role holds in your tenant. Above that, Access Manager refuses with IDE-1043. For example, catalog-versions with catalog-versions:read is above that role.
A partner receives only these permissions, each one at the level of the item it reads: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.
A subscription or an invoice read by its ID does not name its customer. A partner confined to a customer is refused there: it reaches its subscriptions and invoices through the listings, filtered by its customer. To read one subscription or one invoice by its ID, confine the partner to that subscription or to that invoice.
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 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:
Send the same request with a customer outside the scope. The answer is 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.