PUT
/
plans
/
{planId}
curl --request PUT \
  --url https://connect.withvayu.com/plans/{planId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "status": "Active",
  "billingData": {
    "billingInterval": "Monthly",
    "duration": 1,
    "paymentTerm": "Postpayment",
    "autoRenewal": false,
    "proRated": true
  },
  "description": "<string>",
  "products": [
    {
      "name": "<string>",
      "description": "<string>",
      "variants": [
        {
          "meterId": "<string>",
          "pricing": {
            "pricingModel": "PerUnit",
            "priceConfiguration": {
              "price": 1,
              "chunkSize": 1
            }
          },
          "settings": {
            "productType": "Credit",
            "productConfiguration": {
              "shouldCreateSeparateInvoice": false
            }
          },
          "description": "<string>",
          "name": "<string>"
        }
      ],
      "basePrice": 1,
      "commitment": {
        "amount": 1,
        "type": "Price",
        "replenishmentInterval": 123
      },
      "currencyCommitment": 123,
      "paymentTerm": "Postpayment",
      "billingInterval": "Monthly",
      "accumulationInterval": 123,
      "proRata": true,
      "erpMetadata": {
        "erpId": "<string>",
        "erpName": "<string>",
        "displayId": "<string>"
      },
      "rateMultiplier": 123,
      "isPeriodicVariants": false
    }
  ],
  "trial": {
    "duration": 123,
    "type": "Weeks",
    "free": false
  },
  "basedFromPlanId": "<string>",
  "purchaseOrder": "<string>"
}'
{
  "plan": {
    "name": "<string>",
    "status": "Active",
    "billingData": {
      "billingInterval": "Monthly",
      "duration": 1,
      "paymentTerm": "Postpayment",
      "autoRenewal": false,
      "proRated": true
    },
    "description": "<string>",
    "products": [
      {
        "name": "<string>",
        "description": "<string>",
        "variants": [
          {
            "meterId": "<string>",
            "pricing": {
              "pricingModel": "PerUnit",
              "priceConfiguration": {
                "price": 1,
                "chunkSize": 1
              }
            },
            "settings": {
              "productType": "Credit",
              "productConfiguration": {
                "shouldCreateSeparateInvoice": false
              }
            },
            "description": "<string>",
            "name": "<string>"
          }
        ],
        "basePrice": 1,
        "commitment": {
          "amount": 1,
          "type": "Price",
          "replenishmentInterval": 123
        },
        "currencyCommitment": 123,
        "paymentTerm": "Postpayment",
        "billingInterval": "Monthly",
        "accumulationInterval": 123,
        "proRata": true,
        "erpMetadata": {
          "erpId": "<string>",
          "erpName": "<string>",
          "displayId": "<string>"
        },
        "rateMultiplier": 123,
        "isPeriodicVariants": false
      }
    ],
    "trial": {
      "duration": 123,
      "type": "Weeks",
      "free": false
    },
    "basedFromPlanId": "<string>",
    "purchaseOrder": "<string>",
    "id": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

planId
string
required

Body

application/json
name
string

The name of the plan

Minimum length: 1
status
enum<string>

The status of the plan. plan statuses are active, inactive

Available options:
Active,
Inactive,
Error
billingData
object

The billing data of the plan. The billing data contains the billing interval, the plan duration the payment terms and auto renewal, and the billing method.

description
string
Minimum length: 1
products
object[]

The products of the plan

trial
object
basedFromPlanId
string
purchaseOrder
string

The purchase order number

Maximum length: 20

Response

200
application/json
RequestSuccess
plan
object
required