---
title: "Link, unlink, reprice, cancel, or update a linked subscription's card"
method: POST
path: "/companies/{companyId}/billing/subscriptions"
tags: ["Client Onboarding"]
---

# Link, unlink, reprice, cancel, or update a linked subscription's card

`POST /companies/{companyId}/billing/subscriptions`

## Request

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

Link the selected Stripe subscriptions to this company without changing billing or sending email. Existing onboarding subscriptions and subscriptions linked to another company cannot be assigned, and linking is refused while the company's onboarding pay link is open or paid. Repeated links to the same company are idempotent. Unlink removes portal access while leaving Stripe billing unchanged. payment_method_session returns secure Stripe Checkout; completion changes only that subscription's payment method and adds no immediate invoice-payment attempt. change_price sets a new monthly price in integer cents for a single fixed monthly charge; it applies from the next billing period with no proration, and other shapes return 409 to be managed in Stripe. cancel ends the subscription at the end of the current period. Each action requires explicit user intent; API callers must verify selected customer and subscription identities before linking.

## Path parameters

- `companyId` string, uuid, required

## Request body

- union
  - object
    - `action` 'link', required
    - `integrationId` string, uuid, required
    - `subscriptionIds` string[], required
  - object
    - `action` 'unlink', required
    - `linkId` string, uuid, required
  - object
    - `action` 'payment_method_session', required
    - `linkId` string, uuid, required
  - object
    - `action` 'change_price', required
    - `linkId` string, uuid, required
    - `monthlyPriceCents` integer, required: New monthly price in cents
  - object
    - `action` 'cancel', required
    - `linkId` string, uuid, required

## Response `200`

{linked:true}, {unlinked:true}, {checkoutUrl:string}, {changed:boolean}, or {cancelAtPeriodEnd:true}

## Other responses

- `409`: A selected subscription is already assigned, its Stripe account is unavailable, or the subscription cannot be repriced or cancelled here
- `default`: Error response

---

[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/9a8269f0a586?raw)
