---
title: "Link customer subscriptions or manage their private portal access"
method: POST
path: "/contacts/{id}/subscriptions"
tags: ["Contacts"]
---

# Link customer subscriptions or manage their private portal access

`POST /contacts/{id}/subscriptions`

## Request

- Base URL: `https://ledgerhq.pro/api/v1`
- URL: `https://ledgerhq.pro/api/v1/contacts/{id}/subscriptions`
- Auth: one of:
  - HTTP bearer and API key in header `x-organization-id`
  - HTTP bearer and API key in header `x-organization-id`

Requires manage:contacts. link accepts 1–50 explicitly selected existing subscriptions; it preserves prices and schedules. unlink removes portal visibility without cancellation. payment_method_session returns checkoutUrl for the selected link and only updates that subscription's card after completion. portal_link returns {portal:{accessId,portalUrl,expiresAt}}, reusing an active link or creating a 30-day link. revoke_portal revokes all this customer's portal tokens, including unfinished token-authorized card updates. No action sends email, creates subscriptions, or collects an invoice. Actions require explicit user intent.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `ownerPortal` '1'

## Request body

- union
  - object
    - `action` 'link', required
    - `integrationId` string, uuid, required
    - `subscriptionIds` string[], required
  - object
    - `action` 'unlink' | 'payment_method_session', required
    - `linkId` string, uuid, required
  - object
    - `action` 'portal_link' | 'revoke_portal', required

## Response `200`

Link/unlink/revoke receipt, secure checkoutUrl, or private portal link

## Other responses

- `409`: A subscription is already assigned or the company Stripe connection is unavailable
- `default`: Invalid input, unavailable Stripe account, or denied customer access

---

[API](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api.md) · [All operations](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/revisions/01c3e57d281f?raw)
