> For the complete documentation index, see [llms.txt](https://docs.limio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.limio.com/guides/developer-guides/enable-self-service-on-a-cpq-order.md).

# Guide: Enable Self-Service on a CPQ Order

## Overview

If you have a sales-assisted motion, you may want to enable some level of self-service to users that originated from a sales-assisted channel. For example, you might want them to be able to retrieve their invoices, update their payments, and purchase add-ons.

Say you have an order initiated by a CPQ, such as Salesforce CPQ or Zuora CPQ, or that has been directly taken in Zuora. The order will typically create a Subscription in Zuora. You now want to enable Limio Self-Service on that Subscription.

Separately, your provisioning system or middleware will have created a User in your Identity System, for example Auth0 or Okta, so that the User can now access your application and service.

For that User to access Limio Self-Service, you will need to:

1. Sync the Subscription in Limio and retrieve the Limio Owner of that Subscription
2. Attach the User Identity to the Limio Owner

The following diagram summarises the logic:

<figure><picture><source srcset="/files/GlgC2Bk4o0FcBCD9tG3Q" media="(prefers-color-scheme: dark)"><img src="/files/0d0wXRpmjeb1qHBz0uMI" alt=""></picture><figcaption></figcaption></figure>

## How to do it

### Pre-requisites

* You have created a Subscription in Zuora
* You have a [bearer token](https://docs.limio.com/developers/api/authentication-overview/oauth-bearer-token) to access Limio's API
* You have [set up your Identity System](https://docs.limio.com/developers/api-documentation/authentication-overview/identity-federation-oauth-oidc) in Limio
* You have created [authenticated pages](https://docs.limio.com/product/authentication/authentication-provider-per-page) in Limio

### Adding the Subscription and the User Identity in Limio

To enable Limio Self-Service on a Subscription created directly in Zuora, you will need to call the [Subscription Sync API](https://docs.limio.com/api/integrations-api/zuora-sync) to sync in Limio the subscription created in Zuora.

```url
curl -i -X POST \
  'https://your-environment.prod.limio.com/api/plugins/zuora/sync/subscription/{id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
```

You'll then have the following response:

```json
{
    "success": true,
    "id": "sub-140e05e7ea51dfe102f2dfc8afa457bc",
    "owner": "id-3cbac03aa7f1217570922292c074e25e"
}
```

Then, you will need to add the User Identity to the Limio `owner` by calling the [External Identity API](https://docs.limio.com/developers/api/external-identities-api), for example submitting:

```url
curl -i -X POST \
  'https://your-environment.prod.limio.com/api/objects/externalidentity/{owner}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id_token": {
      "iss": "limio.us.auth0.com"
      "sub": "auth0|67bf2138817314f757da5abc"
    }
  }'
```

### User accesses a Limio Self-Service Page

From now, when the User accesses an authenticated Limio Self-Service page (e.g. /billing or /edit-plan), your Identity System will confirm to Limio the User Identity and automatically serve the correct Subscription(s) to them.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.limio.com/guides/developer-guides/enable-self-service-on-a-cpq-order.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
