# Update subscription

By using this method, merchants can <a href="https://docs.solidgate.com/billing/subscriptions/subscriptions-1.0/manage-subscription/update-subscription/" target="_blank">update</a> an active subscription by modifying the trial period, applying a discount, or changing the product. It allows multiple changes in a single request for efficient subscription management and customer retention.

Endpoint: POST /subscription/update
Version: 1.0.0
Security: merchant, signature

## Header parameters:

  - `merchant` (string, required)

  - `signature` (string, required)

## Request fields (application/json):

  - `id` (string, required)
    Unique subscription identifier.
    Example: 83b19018-cbc4-45f0-899a-dda84fd2705e

  - `product_id` (string)
    Unique product identifier to apply to the specified subscription.
    Example: ac43b415-5522-4373-b026-a365462f9657

  - `trial_ended_at` (object)
    Datetime to end the subscription trial.

  - `trial_ended_at.type` (string, required)
    Indicates how the trial should end.
- immediate - end trial immediately
- specific_date - end trial at specific date
    Enum: "specific_date", "immediate"

  - `trial_ended_at.date` (string)
    Indicates the specific date when the trial should end.
Required if the type is specific_date.Trial end date must be within 1 year from the current date.
    Example: 2026-07-20 13:20:00

  - `discount` (object)
    Discount details to manage subscription pricing.
To remove an existing discount, send null for discount.

  - `discount.coupon_id` (string, required)
    Unique coupon identifier.
    Example: 379bd8d9-7f2a-44eb-be35-b741985e1b08

  - `discount.coupon_code` (string, required)
    Coupon code for customers to redeem.
    Example: PRIME50

## Response 400 fields (application/json):

  - `error` (object, required)
    Error object.

  - `error.code` (string, required)
    Error code.
    Example: 2.01

  - `error.message` (string, required)
    Error message.
    Example: Validation error

## Response 401 fields (application/json):

  - `error` (object, required)
    Error object.

  - `error.code` (string, required)
    Error code indicating the specific authorization failure.
    Example: 1.01

  - `error.message` (string, required)
    Descriptive message providing more details about the authorization failure.
    Example: Authorization failed

## Response 403 fields (application/json):

  - `error` (object, required)
    Error object.

  - `error.code` (string, required)
    Error code indicating that access to the service is denied.
    Example: 1.02

  - `error.message` (string, required)
    Message informing that the service is not allowed for the account.
    Example: Access denied

## Response 422 fields (application/json):

  - `error` (object, required)
    Error object.

  - `error.code` (string, required)
    Error code indicating that while the request is well-formed, it cannot be processed due to conflicting or incorrect data.
    Example: 2.01

  - `error.message` (string, required)
    Descriptive message providing more details about the processing failure.
    Example: Unprocessable entity

