---
title: "Update existing Smartrr Script"
method: PUT
path: "/vendor/smartrr-script/{scriptId}"
tags: ["Smartrr Script"]
---

# Update existing Smartrr Script

`PUT /vendor/smartrr-script/{scriptId}`

## Path parameters

- `scriptId` string, required

## Request body

- IScriptCreate
  - `priority` number, required
  - `condition` ScriptCondition, required
    - `orderNumber` number
    - `eventType` 'BEFORE_BILLING_ATTEMPT' | 'AFTER_ORDER_CREATED'
  - `action` union, required
    - object
      - `actionType` 'REPLACE_PRODUCT_VARIANT'
      - `originalProductVariantId` string
      - `newProductVariantId` string
      - `newSellingPlanShopifyId` string
      - `sellingPlanGroupId` string
    - object
      - `actionType` 'REMOVE_PRODUCT_VARIANT'
      - `productVariantId` string
    - object
      - `actionType` 'TERMINATE_SUBSCRIPTION'

## Response `200`

Successful response

- IScript
  - `id` string
  - `priority` number
  - `condition` ScriptCondition
    - `orderNumber` number
    - `eventType` 'BEFORE_BILLING_ATTEMPT' | 'AFTER_ORDER_CREATED'
  - `action` union
    - object
      - `actionType` 'REPLACE_PRODUCT_VARIANT'
      - `originalProductVariantId` string
      - `newProductVariantId` string
      - `newSellingPlanShopifyId` string
      - `sellingPlanGroupId` string
    - object
      - `actionType` 'REMOVE_PRODUCT_VARIANT'
      - `productVariantId` string
    - object
      - `actionType` 'TERMINATE_SUBSCRIPTION'
  - `createdDate` string
  - `updatedDate` string

---

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