> ## 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.

# Replace a subscription item

> Replace a subscription item (with details) by specifying item SKU



## OpenAPI

````yaml smt post /v1/subscriptions/replace-items
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/replace-items:
    post:
      tags:
        - Subscriptions
      summary: Replace a subscription item
      description: Replace a subscription item (with details) by specifying item SKU
      operationId: replaceItem
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceItem'
      responses:
        '200':
          description: Request processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplaceItemSuccessResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/subscriptionBadRequestError'
components:
  schemas:
    ReplaceItem:
      type: object
      description: Item to be replaced
      properties:
        item:
          type: object
          description: Replacement item details
          properties:
            sku:
              type: string
              description: Item SKU
              example: MOBO-X570
        replacementItem:
          type: object
          description: Replacement item details
          properties:
            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'
    ReplaceItemSuccessResponse:
      type: object
      description: Replace item response
      properties:
        responseStatus:
          description: Brief response status
          type: string
          example: OK
        message:
          description: Full response message
          type: string
          example: >-
            This request to replace items is currently being processed. Once
            done, we will update you via your webhooks (your webhooks need to be
            configured). Refer to our documentation on more information on
            webhooks.
    subscriptionBadRequestError:
      type: object
      description: Bad request error
      properties:
        responseStatus:
          type: string
          description: Brief response status
          example: BAD_REQUEST
        message:
          description: Full response message
          type: object
          properties:
            code:
              type: string
              description: Brief response code
              example: PRICE_NOT_FOUND
            message:
              type: string
              description: Error message
              example: No price entry found
    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
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````