---
title: "Update subscription contract lines"
method: POST
path: "/customers/{customerId}/subscriptions/{subscriptionId}/lines"
tags: ["Subscriptions"]
---

# Update subscription contract lines

`POST /customers/{customerId}/subscriptions/{subscriptionId}/lines`

Update subscription contract lines.

**Discount codes**: It's an array type, but we only accept one discount code currently. Important note: If no discount code is provided, any existing discount codes will be removed from the subscription.

**Editing lines associated with a build a box**:
When editing lines associated with a build-a-box make sure to pass in, and update when needed, the custom attributes. If you don't provide the correct custom attributes you are at risk of breaking the box functionality. When unsure, pass along the same exact custom attributes as were previously on the line. When adding a new line to a box, make sure to provide the same custom attributes that exist on each other line in the box. All lines in a Dynamic Build-a-box will contain the same custom attributes as each other.

## Path parameters

- `customerId` string, required
- `subscriptionId` string, required

## Request body

- object
  - `lines` object[]
    - `id` string — Line id (not required for new lines)
    - `input` object — Input
      - `quantity` integer — Quantity (0 to remove line)
      - `productVariantId` string — Product variant id
      - `customAttributes` object — Custom attributes (will override existing ones)
      - `lineSellingPolicy` object — Line selling policy
      - `isAddon` boolean — Whether this line is an addon
      - `previousQuantity` integer — Previous quantity
  - `sellingPlan` string — Selling plan id
  - `discountCodes` string[] — Discount codes (only one supported at the moment, if not provided the current discounts will be removed)

## Response `200`

Lines updated

- object
  - `subscriptionContractId` string
  - `lines` LineResponse[]
    - `updatedPrices` object
      - `computedPrice` object
      - `computedPricingPolicy` object
      - `line` string
    - `operation` string
    - `variantId` string
    - `id` string
    - `title` string
    - `variantTitle` string
    - `productId` string
    - `quantity` integer
    - `customAttributes` object[]
    - `oneTimeAddon` boolean
  - `subscriptionContract` SubscriptionDynamo
    - `SubscriptionId` string — Identifier
    - `SubscriptionStatus` string — Status
    - `NextBillingDate` string, date-time — Date of the next billing

## Other responses

- `400` — Validation error

---

[API](https://skmtc.net/awtomic/apis/awtomic-api.md) · [All operations](https://skmtc.net/awtomic/apis/awtomic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/awtomic/awtomic-api/versions/dfe3dfce125c/schema)
