---
title: "Update a subscription"
method: PATCH
path: "/payment/{connection_id}/subscription/{id}"
tags: ["payment", "subscription"]
---

# Update a subscription

`PATCH /payment/{connection_id}/subscription/{id}`

## Request

- Base URL: `http://api.unified.to`
- URL: `http://api.unified.to/payment/{connection_id}/subscription/{id}`
- Auth: API key in header `authorization`

## Path parameters

- `connection_id` string, required
- `id` string, required

## Query parameters

- `fields` string[]
- `raw` string

## Request body

- PaymentSubscription
  - `id` string
  - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `description` string
  - `contact_id` string: a reference to an Accounting Contact (reference to AccountingContact)
  - `invoice_id` string: a reference to an Accounting Invoice (reference to AccountingInvoice)
  - `current_period_end_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `current_period_start_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `canceled_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `currency` string
  - `total_amount` number
  - `start_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `end_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `status` 'ACTIVE' | 'INACTIVE' | 'CANCELED' | 'PAUSED'
  - `month` number: the month on which to charge a customer (1-12). Only applies when the interval_unit is YEAR.
  - `interval_unit` 'YEAR' | 'MONTH' | 'WEEK' | 'DAY'
  - `day_of_month` number: The day of the month to charge customers on. 1-28 or -1 to indicate the last day of the month. Only applies when the interval_unit is MONTH.
  - `day_of_week` number: The day of the week to charge customers on. 1-7 or -1 to indicate the last day of the week. Only applies when the interval_unit is WEEK.
  - `interval` number: The number of intervals between charges within the interval_unit. Defaults to 1.
  - `lineitems` PaymentLineitem[]
    - `id` string
    - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `refunded_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `total_amount` number
    - `refund_amount` number: new field
    - `discount_amount` number
    - `tax_amount` number
    - `item_id` string: (reference to CommerceItem)
    - `unit_amount` number
    - `unit_quantity` number
    - `item_sku` string
    - `item_name` string
    - `item_description` string
    - `notes` string
    - `taxrate_id` string
    - `account_id` string: (reference to AccountingAccount)
  - `metadata` PaymentMetadata[]
    - `id` string
    - `slug` string
    - `value` unknown
    - `namespace` string
    - `format` 'TEXT' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'FILE' | 'TEXTAREA' | 'SINGLE_SELECT' | 'MULTIPLE_SELECT' | 'MEASUREMENT' | 'PRICE' | 'YES_NO' | 'CURRENCY' | 'URL'
    - `extra_data` unknown
  - `raw` unknown

## Response `200`

Successful

- PaymentSubscription
  - `id` string
  - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `description` string
  - `contact_id` string: a reference to an Accounting Contact (reference to AccountingContact)
  - `invoice_id` string: a reference to an Accounting Invoice (reference to AccountingInvoice)
  - `current_period_end_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `current_period_start_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `canceled_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `currency` string
  - `total_amount` number
  - `start_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `end_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `status` 'ACTIVE' | 'INACTIVE' | 'CANCELED' | 'PAUSED'
  - `month` number: the month on which to charge a customer (1-12). Only applies when the interval_unit is YEAR.
  - `interval_unit` 'YEAR' | 'MONTH' | 'WEEK' | 'DAY'
  - `day_of_month` number: The day of the month to charge customers on. 1-28 or -1 to indicate the last day of the month. Only applies when the interval_unit is MONTH.
  - `day_of_week` number: The day of the week to charge customers on. 1-7 or -1 to indicate the last day of the week. Only applies when the interval_unit is WEEK.
  - `interval` number: The number of intervals between charges within the interval_unit. Defaults to 1.
  - `lineitems` PaymentLineitem[]
    - `id` string
    - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `refunded_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
    - `total_amount` number
    - `refund_amount` number: new field
    - `discount_amount` number
    - `tax_amount` number
    - `item_id` string: (reference to CommerceItem)
    - `unit_amount` number
    - `unit_quantity` number
    - `item_sku` string
    - `item_name` string
    - `item_description` string
    - `notes` string
    - `taxrate_id` string
    - `account_id` string: (reference to AccountingAccount)
  - `metadata` PaymentMetadata[]
    - `id` string
    - `slug` string
    - `value` unknown
    - `namespace` string
    - `format` 'TEXT' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'FILE' | 'TEXTAREA' | 'SINGLE_SELECT' | 'MULTIPLE_SELECT' | 'MEASUREMENT' | 'PRICE' | 'YES_NO' | 'CURRENCY' | 'URL'
    - `extra_data` unknown
  - `raw` unknown

---

[API](https://skmtc.dev/unified/apis/unified-to-api-2.md) · [All operations](https://skmtc.dev/unified/apis/unified-to-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/unified/apis/unified-to-api-2/revisions/7a38bdd7f089?raw)
