> ## Documentation Index
> Fetch the complete documentation index at: https://developer.fabric.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Update single subscription

> Update single subscription by subscription ID



## OpenAPI

````yaml smt patch /v1/subscriptions/{id}
openapi: 3.0.0
info:
  title: Subscriptions (SMT API)
  description: >-
    fabric's Subscriptions API lets your customers set recurring purchases of
    their desired products or services for a scheduled period (weekly, monthly,
    etc.). In addition, Subscriptions helps you retrieve and update subscription
    details, and lets your customers skip one or more subscription schedules, or
    remove a subscription. This API also lets you create and updates customers
    cancellation reasons, and subscription discounts.
  version: 2.0.0
  contact:
    email: support@fabric.inc
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
servers:
  - url: https://prod01.copilot.fabric.inc/data-subscription
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Subscribers
    description: >-
      These endpoints let you create, update, or get one or all of your
      subscribers (customers who have subscriptions). If you request all
      subscribers, you will receive a paginated response; you can specify the
      page size, and which page you want.
  - name: Subscriptions
    description: >-
      These endpoints let your customers set recurring purchases of their
      desired products or services for a scheduled period (weekly, monthly,
      etc.). In addition, these endpoints let you get and update subscription
      details, and let your customers skip one or more subscription schedules,
      or remove a subscription.
  - name: Orders
    description: >-
      These endpoints let your customers purchase products and services from
      your store.
  - name: Cancellation Reasons
    description: These endpoints let you create and get cancellation reasons.
  - name: Subscription Discounts
    description: >-
      These endpoints let you create, update, deactivate, and get discount
      offers for the orders placed by your customers.
paths:
  /v1/subscriptions/{id}:
    patch:
      tags:
        - Subscriptions
      summary: Update single subscription
      description: Update single subscription by subscription ID
      operationId: updateSubscription
      parameters:
        - in: path
          name: id
          required: true
          schema:
            description: Subscription ID
            type: string
            example: 6169b2d892a5f30009d76480
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionRequestBody'
      responses:
        '200':
          description: Request processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubscriptionByIdSuccessResponse'
        '404':
          description: Subscription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notFoundSubscriptionError'
components:
  schemas:
    UpdateSubscriptionRequestBody:
      type: object
      description: Details used to update subscription
      properties:
        channel:
          type: string
          description: Channel
          example: WEBSITE
          enum:
            - WEBSITE
            - POS
        customer:
          $ref: '#/components/schemas/CustomerUpdateBody'
        shipTo:
          $ref: '#/components/schemas/AddressUpdateShipTo'
        billTo:
          $ref: '#/components/schemas/AddressUpdate'
        paymentDetails:
          $ref: '#/components/schemas/UpdatePaymentDetails'
        customAttributes:
          $ref: '#/components/schemas/CustomAttributes'
        item:
          $ref: '#/components/schemas/UpdateItem'
        plan:
          $ref: '#/components/schemas/UpdatePlan'
        offer:
          $ref: '#/components/schemas/UpdateOffer'
        shipping:
          $ref: '#/components/schemas/UpdateShipping'
        expiry:
          $ref: '#/components/schemas/Expiry'
    GetSubscriptionByIdSuccessResponse:
      type: object
      description: Subscription returned by ID
      properties:
        responseStatus:
          description: Brief response status
          type: string
          example: OK
        message:
          description: Full response message
          type: string
          example: Request processed successfully
        data:
          type: object
          description: Subscription details
          properties:
            subscription:
              $ref: '#/components/schemas/GetSubscriptionById'
    notFoundSubscriptionError:
      type: object
      description: Not found
      properties:
        responseStatus:
          description: Brief response status
          type: string
          example: NOT_FOUND
        message:
          description: Full response message
          type: string
          example: Subscription not found
    CustomerUpdateBody:
      required:
        - customerReferenceId
      description: Customer details to be updated
      type: object
      properties:
        customerReferenceId:
          type: string
          description: Customer reference ID
          example: '12345'
        locale:
          type: string
          description: Customer locale (language_country)
          example: en_US
        email:
          type: string
          description: Customer's email address
          example: customer@example.com
        contactnumber:
          type: string
          example: '+923333709568'
          description: Customer's contact number
        firstName:
          type: string
          example: Pat
          description: Customer's first name
        middleName:
          type: string
          example: E
          description: Customer's middle name or initial
        lastName:
          type: string
          example: Kake
          description: Customer's last name
        segment:
          type: array
          description: Customer's segments
          items:
            type: string
            example: employee
            description: Customer's segment (employee, management, pro user, etc.)
        employeeId:
          type: string
          example: '345'
          description: Customer employee ID
        communicationPreference:
          $ref: '#/components/schemas/communicationPreference'
    AddressUpdateShipTo:
      type: object
      description: Ship to details
      properties:
        name:
          $ref: '#/components/schemas/NameUpdate'
        streetAddress:
          $ref: '#/components/schemas/StreetAddressUpdate'
        city:
          description: City name
          type: string
          example: Boston
        state:
          description: State name
          type: string
          example: MA
        postalCode:
          description: Postal code
          type: string
          example: '02127'
        country:
          description: Country name
          type: string
          example: US
        phone:
          $ref: '#/components/schemas/PhoneUpdate'
    AddressUpdate:
      type: object
      description: Billing address update details
      properties:
        name:
          $ref: '#/components/schemas/NameUpdate'
        streetAddress:
          $ref: '#/components/schemas/StreetAddressUpdate'
        city:
          description: City name
          type: string
          example: Boston
        state:
          description: State name
          type: string
          example: MA
        postalCode:
          description: Postal code
          type: string
          example: '02127'
        country:
          description: Country name
          type: string
          example: US
        phone:
          $ref: '#/components/schemas/PhoneUpdate'
    UpdatePaymentDetails:
      type: object
      description: Payment details to be updated
      properties:
        paymentIdentifier:
          $ref: '#/components/schemas/UpdatePaymentIdentifier'
        paymentMethod:
          type: string
          description: Payment method
          example: credit_card
        paymentKind:
          type: string
          description: Payment type
          example: credit
    CustomAttributes:
      type: object
      description: Custom attributes
      properties:
        storeId:
          type: string
          description: Store ID
          example: 60cb07fc20387b000821c5c3
        associateId:
          type: integer
          description: Associate ID
          example: 1
        trackingUrl:
          type: string
          description: Tracking URL
          example: 609436d21baded0008945b05
    UpdateItem:
      type: object
      description: Item details to be updated
      properties:
        id:
          type: integer
          description: Item ID
          example: 1000000006
        sku:
          type: string
          description: Item SKU
          example: MOBO-X570
        quantity:
          type: integer
          description: Number of items
          example: 1
        weight:
          type: integer
          description: Item weight amount
          example: 10
        weightUnit:
          type: string
          description: Item weight unit
          example: lb
        title:
          type: string
          description: Item name
          example: Vitamin
        description:
          type: string
          description: Item description
          example: Vitamin C
        itemPrice:
          $ref: '#/components/schemas/UpdateItemPrice'
        tax:
          $ref: '#/components/schemas/UpdateTax'
    UpdatePlan:
      type: object
      description: Subscription plan details
      properties:
        id:
          type: string
          description: Subscription plan ID
          example: '1001'
        frequency:
          type: integer
          description: Subscription plan frequency value
          example: 30
        frequencyType:
          type: string
          description: Subscription plan frequency period
          example: Daily
    UpdateOffer:
      type: object
      description: Offer details to be updated
      properties:
        id:
          type: string
          description: Offer ID
          example: SUB-E10717
        source:
          type: string
          description: Offer source
          example: PDP
          enum:
            - PDP
            - CART
    UpdateShipping:
      type: object
      description: Shipping details to be updated
      properties:
        shipmentCarrier:
          type: string
          description: Shipment carrier
          example: USPS
        shipmentMethod:
          type: string
          description: Shipment method
          example: Ground
        shipmentInstructions:
          type: string
          description: Shipment instructions
          example: Please leave the package in the box
        taxCode:
          type: string
          description: Shipment tax code
          example: SHP020000
        shippingAmount:
          type: integer
          description: Shipping cost
          example: 10
        taxAmount:
          type: integer
          description: Shipment tax amount (value, not percentage)
          example: 1
        currencyCode:
          type: string
          description: Shipment currency code
          example: USD
    Expiry:
      type: object
      description: Expiration date and billing cycle
      properties:
        expiryDate:
          type: string
          description: Card expiration date
          example: '2022-07-18T09:16:11.437Z'
        billingCycles:
          type: number
          description: Billing cycle number
          example: 2
    GetSubscriptionById:
      type: object
      description: Single subscription details
      properties:
        id:
          type: string
          description: Subscription ID
          example: 6256610bc312410009b7390b
        customer:
          $ref: '#/components/schemas/CustomerResponse'
        item:
          $ref: '#/components/schemas/Item'
        plan:
          $ref: '#/components/schemas/Plan'
        offer:
          $ref: '#/components/schemas/Offer'
        shipping:
          $ref: '#/components/schemas/Shipping'
        expiry:
          $ref: '#/components/schemas/Expiry'
        shipTo:
          $ref: '#/components/schemas/AddressShipTo'
        billTo:
          $ref: '#/components/schemas/Address'
        paymentDetails:
          $ref: '#/components/schemas/PaymentDetails'
        customAttributes:
          $ref: '#/components/schemas/CustomAttributes'
        status:
          type: string
          description: Subscription status
          example: ACTIVE
        isDeleted:
          type: boolean
          description: >-
            true: Subscription is deleted<br />false: Subscription is not
            deleted
          example: false
        deletedAt:
          type: string
          description: >-
            If `isDeleted`=true, time at which the subscription was deleted<br
            />If `isDeleted`=false, NULL
          example: '2019-01-01T00:00:00.000Z'
        channel:
          type: string
          description: Channel
          example: WEBSITE
        originOrderId:
          type: string
          description: Client's origin order ID
          example: 22-4498-4800
        offsetDays:
          description: Number of days after which order is to be created
          type: integer
          example: 2
        createdAt:
          type: string
          description: Time subscription was created
          example: '2021-10-12T21:35:05.756Z'
        updatedAt:
          type: string
          description: Most recent time subscription was updated
          example: '2021-10-14T05:40:55.997Z'
        statusUpdatedAt:
          type: string
          description: Most recent time order status was updated
          example: '2021-10-14T10:24:36.468Z'
    communicationPreference:
      type: object
      description: Customer's communications preferences
      properties:
        email:
          type: boolean
          description: >-
            true: Customer agrees to be contacted via email<br />false: Customer
            does not want to be contacted via email
          example: true
        sms:
          type: boolean
          description: >-
            true: Customer agrees to be contacted via text message<br />false:
            Customer does not want to be contacted via text message
          example: true
    NameUpdate:
      type: object
      description: Customer's name to be updated
      properties:
        firstName:
          type: string
          example: Pat
          description: Customer's first name
        middleName:
          type: string
          example: E
          description: Customer's middle name or initial
        lastName:
          type: string
          example: Kake
          description: Customer's last name
    StreetAddressUpdate:
      type: object
      description: Street address to be updated
      properties:
        street1:
          description: Street address field 1
          type: string
          example: 123 Main St
        street2:
          description: Street address field 2
          type: string
          example: Suite 100
    PhoneUpdate:
      type: object
      description: Customer's phone details to be updated
      properties:
        number:
          type: string
          description: Phone number
          example: '5555551234'
        kind:
          type: string
          description: Phone type
          example: home
    UpdatePaymentIdentifier:
      type: object
      description: Payment identifier details to be updated
      properties:
        cardIdentifier:
          type: string
          description: Last four digits of credit card number
          example: '1234'
        expiryDate:
          type: string
          description: Card expiration date
          example: 12/20
    UpdateItemPrice:
      type: object
      description: Item price details to be updated
      properties:
        price:
          type: integer
          description: Item price
          example: 100
        currencyCode:
          type: string
          description: Item currency code
          example: USD
    UpdateTax:
      type: object
      description: Tax details to be updated
      properties:
        taxCode:
          type: string
          description: Tax code
          example: FR020000
        taxAmount:
          type: integer
          description: Tax amount (value, not percentage)
          example: 10
        currencyCode:
          type: string
          description: Tax currency code
          example: USD
    CustomerResponse:
      description: Customer details after creation
      type: object
      properties:
        id:
          description: Customer ID
          type: string
          example: 62cffd65e8d7eb868c6a29d6
        customerReferenceId:
          type: string
          description: Customer reference ID
          example: '12345'
        locale:
          type: string
          description: Customer locale (language_country)
          example: en_US
        email:
          type: string
          description: Customer's email address
          example: customer@example.com
        contactNumber:
          type: string
          example: '+923333709568'
          description: Customer's contact number
        firstName:
          type: string
          example: Pat
          description: Customer's first name
        middleName:
          type: string
          example: E
          description: Customer's middle name or initial
        lastName:
          type: string
          example: Kake
          description: Customer's last name
        segment:
          type: array
          description: Customer's segments
          items:
            type: string
            example: employee
            description: Customer's segment (employee, management, pro user, etc.)
        employeeId:
          type: string
          example: '345'
          description: Customer employee ID
        communicationPreference:
          $ref: '#/components/schemas/communicationPreference'
        status:
          type: string
          description: Customer status
          example: ACTIVE
          enum:
            - ACTIVE
            - INACTIVE
        createdAt:
          type: string
          description: Time customer was created
          example: '2021-10-12T21:35:05.756Z'
        updatedAt:
          type: string
          description: Most recent time customer was updated
          example: '2021-10-14T05:40:55.997Z'
    Item:
      required:
        - id
        - sku
        - quantity
        - itemPrice
      type: object
      description: Item details
      properties:
        id:
          type: integer
          description: Item ID
          example: 1000000006
        sku:
          type: string
          description: Item SKU
          example: MOBO-X570
        quantity:
          type: integer
          description: Number of items
          example: 1
        weight:
          type: integer
          description: Item weight amount
          example: 10
        weightUnit:
          type: string
          description: Item weight unit
          example: lb
        title:
          type: string
          description: Item name
          example: Vitamin
        description:
          type: string
          description: Item description
          example: Vitamin C
        itemPrice:
          $ref: '#/components/schemas/ItemPrice'
        tax:
          $ref: '#/components/schemas/Tax'
    Plan:
      required:
        - frequency
        - frequencyType
      type: object
      description: Subscription plan details
      properties:
        id:
          type: string
          description: Subscription plan ID
          example: '1001'
        frequency:
          type: integer
          description: Subscription plan frequency value
          example: 30
        frequencyType:
          type: string
          description: Subscription plan frequency period
          example: Daily
    Offer:
      required:
        - id
      type: object
      description: Offer details
      properties:
        id:
          type: string
          description: Offer ID
          example: SUB-E10717
        source:
          type: string
          description: Offer source
          example: PDP
          enum:
            - PDP
            - CART
    Shipping:
      required:
        - shipmentCarrier
        - shipmentMethod
        - shipmentInstructions
        - shippingAmount
        - taxCode
        - taxAmount
        - currencyCode
      type: object
      description: Shipping details
      properties:
        shipmentCarrier:
          type: string
          description: Shipment carrier
          example: USPS
        shipmentMethod:
          type: string
          description: Shipment method
          example: Ground
        shipmentInstructions:
          type: string
          description: Shipment instructions
          example: Please leave the package in the box
        taxCode:
          type: string
          description: Shipment tax code
          example: SHP020000
        shippingAmount:
          type: integer
          description: Shipping cost
          example: 10
        taxAmount:
          type: integer
          description: Shipment tax amount (value, not percentage)
          example: 1
        currencyCode:
          type: string
          description: Shipment currency code
          example: USD
    AddressShipTo:
      required:
        - name
        - streetAddress
        - city
        - state
        - postalCode
        - country
        - phone
      type: object
      description: Ship-to address and phone details
      properties:
        name:
          $ref: '#/components/schemas/Name'
        streetAddress:
          $ref: '#/components/schemas/StreetAddress'
        city:
          description: City name
          type: string
          example: Boston
        state:
          description: State name
          type: string
          example: MA
        postalCode:
          description: Postal code
          type: string
          example: '02127'
        country:
          description: Country name
          type: string
          example: US
        phone:
          $ref: '#/components/schemas/Phone'
    Address:
      required:
        - name
        - streetAddress
        - city
        - state
        - postalCode
        - country
        - phone
      type: object
      description: Bill-to address and phone details
      properties:
        name:
          $ref: '#/components/schemas/Name'
        streetAddress:
          $ref: '#/components/schemas/StreetAddress'
        city:
          description: City name
          type: string
          example: Boston
        state:
          description: State name
          type: string
          example: MA
        postalCode:
          description: Postal code
          type: string
          example: '02127'
        country:
          description: Country name
          type: string
          example: US
        phone:
          $ref: '#/components/schemas/Phone'
    PaymentDetails:
      required:
        - paymentIdentifier
      type: object
      description: Payment details
      properties:
        paymentIdentifier:
          $ref: '#/components/schemas/PaymentIdentifier'
        paymentMethod:
          type: string
          description: Payment method
          example: credit_card
        paymentKind:
          type: string
          description: Payment type
          example: Visa
    ItemPrice:
      required:
        - price
        - currencyCode
      type: object
      description: Item price details
      properties:
        price:
          type: integer
          description: Item price
          example: 100
        currencyCode:
          type: string
          description: Item currency code
          example: USD
    Tax:
      required:
        - taxCode
        - taxAmount
        - currencyCode
      type: object
      description: Tax details
      properties:
        taxCode:
          type: string
          description: Tax code
          example: FR020000
        taxAmount:
          type: integer
          description: Tax amount (value, not percentage)
          example: 10
        currencyCode:
          type: string
          description: Tax currency code
          example: USD
    Name:
      required:
        - firstName
        - lastName
      type: object
      description: Customer's name
      properties:
        firstName:
          type: string
          example: Pat
          description: Customer's first name
        middleName:
          type: string
          example: E
          description: Customer's middle name or initial
        lastName:
          type: string
          example: Kake
          description: Customer's last name
    StreetAddress:
      required:
        - street1
      description: Street address
      type: object
      properties:
        street1:
          description: Street address field 1
          type: string
          example: 123 Main St
        street2:
          description: Street address field 2
          type: string
          example: Suite 100
    Phone:
      required:
        - number
      type: object
      description: Customer's phone details
      properties:
        number:
          type: string
          description: Phone number
          example: '5555551234'
        kind:
          type: string
          description: Phone type
          example: home
    PaymentIdentifier:
      required:
        - cardIdentifier
        - expiryDate
      type: object
      description: Payment identifier details
      properties:
        cardIdentifier:
          type: string
          description: Last four digits of credit card number
          example: '1234'
        expiryDate:
          type: string
          description: Card expiration date
          example: 12/20
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````