# Update Price by ID for a Product

PUT https://services.leadconnectorhq.com/products/{productId}/price/{priceId}

The "Update Price by ID for a Product" API allows modifying information for a specific price associated with a particular product using its unique identifier. Use this endpoint to update details for a single price based on the provided price ID and product ID.

## Authentication

Send `Authorization: Bearer <token>` using any one of:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `products/prices.write`
- **Agency token: OAuth access token or Private Integration Token.** Scopes: `products/prices.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `productId` | string | Yes | ID of the product that needs to be used |
| `priceId` | string | Yes | ID of the price that needs to be returned |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/products/{productId}/price/{priceId}": {
      "put": {
        "summary": "Update Price by ID for a Product",
        "operationId": "updatePriceByIdForAProduct",
        "description": "The \"Update Price by ID for a Product\" API allows modifying information for a specific price associated with a particular product using its unique identifier. Use this endpoint to update details for a single price based on the provided price ID and product ID.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "productId",
            "required": true,
            "in": "path",
            "description": "ID of the product that needs to be used",
            "schema": {
              "example": "6578278e879ad2646715ba9c",
              "type": "string"
            }
          },
          {
            "name": "priceId",
            "required": true,
            "in": "path",
            "description": "ID of the price that needs to be returned",
            "schema": {
              "example": "6578278e879ad2646715ba9c",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePriceDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePriceResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "Location-Access": [
              "products/prices.write"
            ]
          },
          {
            "Agency-Access": [
              "products/prices.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "UpdatePriceDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the price.",
            "example": "Price Name"
          },
          "type": {
            "type": "string",
            "description": "The type of the price.",
            "example": "one_time",
            "enum": [
              "one_time",
              "recurring"
            ]
          },
          "currency": {
            "type": "string",
            "description": "The currency of the price.",
            "example": "USD"
          },
          "amount": {
            "type": "number",
            "description": "The amount of the price. ( min: 0 )",
            "example": 99.99
          },
          "recurring": {
            "description": "The recurring details of the price (if type is recurring).",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "interval": {
                    "type": "string",
                    "description": "The interval at which the recurring event occurs.",
                    "example": "day",
                    "enum": [
                      "day",
                      "month",
                      "week",
                      "year"
                    ]
                  },
                  "intervalCount": {
                    "type": "number",
                    "description": "The number of intervals between each occurrence of the event.",
                    "example": 1
                  }
                },
                "required": [
                  "interval",
                  "intervalCount"
                ],
                "title": "RecurringDto"
              }
            ]
          },
          "description": {
            "type": "string",
            "description": "A brief description of the price."
          },
          "membershipOffers": {
            "description": "An array of membership offers associated with the price.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "description": "Membership offer label",
                  "example": "top_50"
                },
                "value": {
                  "type": "string",
                  "description": "Membership offer label",
                  "example": "50"
                },
                "_id": {
                  "type": "string",
                  "description": "The unique identifier for the membership offer.",
                  "example": "655b33aa2209e60b6adb87a7"
                }
              },
              "required": [
                "label",
                "value",
                "_id"
              ],
              "title": "MembershipOfferDto"
            }
          },
          "trialPeriod": {
            "type": "number",
            "description": "The trial period duration in days (if applicable).",
            "example": 7
          },
          "totalCycles": {
            "type": "number",
            "description": "The total number of billing cycles for the price. ( min: 1 )",
            "example": 12
          },
          "setupFee": {
            "type": "number",
            "description": "The setup fee for the price.",
            "example": 10.99
          },
          "variantOptionIds": {
            "description": "An array of variant option IDs associated with the price.",
            "example": [
              "option_id_1",
              "option_id_2"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "compareAtPrice": {
            "type": "number",
            "description": "The compare at price for the price.",
            "example": 19.99
          },
          "locationId": {
            "type": "string",
            "description": "The unique identifier of the location associated with the price.",
            "example": "6578278e879ad2646715ba9c"
          },
          "userId": {
            "type": "string",
            "description": "The unique identifier of the user who created the price.",
            "example": "6578278e879ad2646715ba9c"
          },
          "meta": {
            "description": "Additional metadata associated with the price.",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "description": "The source of the price.",
                    "enum": [
                      "stripe",
                      "woocommerce",
                      "shopify"
                    ],
                    "example": "stripe"
                  },
                  "sourceId": {
                    "type": "string",
                    "description": "The id of the source of the price from where it is imported",
                    "example": "123"
                  },
                  "stripePriceId": {
                    "type": "string",
                    "description": "The Stripe price ID associated with the price.",
                    "example": "price_123"
                  },
                  "internalSource": {
                    "type": "string",
                    "description": "The internal source of the price.",
                    "enum": [
                      "agency_plan",
                      "funnel",
                      "membership",
                      "communities",
                      "gokollab",
                      "calendar"
                    ],
                    "example": "agency_plan"
                  }
                },
                "required": [
                  "source",
                  "stripePriceId",
                  "internalSource"
                ],
                "title": "PriceMetaDto"
              }
            ]
          },
          "trackInventory": {
            "type": "boolean",
            "description": "Need to track inventory stock quantity",
            "example": true
          },
          "availableQuantity": {
            "type": "number",
            "description": "Available inventory stock quantity",
            "example": 5
          },
          "allowOutOfStockPurchases": {
            "type": "boolean",
            "description": "Continue selling when out of stock",
            "example": true
          },
          "sku": {
            "type": "string",
            "description": "The unique identifier of the SKU associated with the price",
            "example": "sku_123"
          },
          "shippingOptions": {
            "description": "Shipping options of the Price",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "weight": {
                    "description": "Weight options of the product",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "number",
                            "description": "Actual weight of the product",
                            "example": 10
                          },
                          "unit": {
                            "type": "string",
                            "description": "Weight unit of the product",
                            "example": "kg",
                            "enum": [
                              "kg",
                              "lb",
                              "g",
                              "oz"
                            ]
                          }
                        },
                        "required": [
                          "value",
                          "unit"
                        ],
                        "title": "WeightOptionsDto"
                      }
                    ]
                  },
                  "dimensions": {
                    "description": "Dimensions of the product",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "height": {
                            "type": "number",
                            "description": "Height of the price",
                            "example": 10
                          },
                          "width": {
                            "type": "number",
                            "description": "Width of the price",
                            "example": 10
                          },
                          "length": {
                            "type": "number",
                            "description": "Length of the price",
                            "example": 10
                          },
                          "unit": {
                            "type": "string",
                            "description": "Unit of the price dimensions",
                            "example": "cm",
                            "enum": [
                              "cm",
                              "in",
                              "m"
                            ]
                          }
                        },
                        "required": [
                          "height",
                          "width",
                          "length",
                          "unit"
                        ],
                        "title": "PriceDimensionsDto"
                      }
                    ]
                  }
                },
                "title": "ShippingOptionsDto"
              }
            ]
          },
          "isDigitalProduct": {
            "type": "boolean",
            "description": "Is the product a digital product",
            "example": true
          },
          "digitalDelivery": {
            "description": "Digital delivery options",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "type",
          "currency",
          "amount",
          "locationId"
        ],
        "title": "UpdatePriceDto"
      },
      "UpdatePriceResponseDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "The unique identifier for the price.",
            "example": "655b33aa2209e60b6adb87a7"
          },
          "membershipOffers": {
            "description": "An array of membership offers associated with the price.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "description": "Membership offer label",
                  "example": "top_50"
                },
                "value": {
                  "type": "string",
                  "description": "Membership offer label",
                  "example": "50"
                },
                "_id": {
                  "type": "string",
                  "description": "The unique identifier for the membership offer.",
                  "example": "655b33aa2209e60b6adb87a7"
                }
              },
              "required": [
                "label",
                "value",
                "_id"
              ],
              "title": "MembershipOfferDto"
            }
          },
          "variantOptionIds": {
            "description": "An array of variant option IDs associated with the price.",
            "example": [
              "h4z7u0im2q8",
              "h3nst2ltsnn"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locationId": {
            "type": "string",
            "description": "The unique identifier for the location.",
            "example": "3SwdhCsvxI8Au3KsPJt6"
          },
          "product": {
            "type": "string",
            "description": "The unique identifier for the associated product.",
            "example": "655b33a82209e60b6adb87a5"
          },
          "userId": {
            "type": "string",
            "description": "The unique identifier for the user.",
            "example": "6YAtzfzpmHAdj0e8GkKp"
          },
          "name": {
            "type": "string",
            "description": "The name of the price.",
            "example": "Red / S"
          },
          "type": {
            "type": "string",
            "description": "The type of the price (e.g., one_time).",
            "example": "one_time",
            "enum": [
              "one_time",
              "recurring"
            ]
          },
          "currency": {
            "type": "string",
            "description": "The currency code for the price.",
            "example": "INR"
          },
          "amount": {
            "type": "number",
            "description": "The amount of the price.",
            "example": 199999
          },
          "recurring": {
            "description": "The recurring details of the price (if type is recurring).",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "interval": {
                    "type": "string",
                    "description": "The interval at which the recurring event occurs.",
                    "example": "day",
                    "enum": [
                      "day",
                      "month",
                      "week",
                      "year"
                    ]
                  },
                  "intervalCount": {
                    "type": "number",
                    "description": "The number of intervals between each occurrence of the event.",
                    "example": 1
                  }
                },
                "required": [
                  "interval",
                  "intervalCount"
                ],
                "title": "RecurringDto"
              }
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "The creation timestamp of the price.",
            "example": "2023-11-20T10:23:38.645Z"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string",
            "description": "The last update timestamp of the price.",
            "example": "2024-01-23T09:57:04.852Z"
          },
          "compareAtPrice": {
            "type": "number",
            "description": "The compare-at price for comparison purposes.",
            "example": 2000000
          },
          "trackInventory": {
            "type": "boolean",
            "description": "Indicates whether inventory tracking is enabled.",
            "example": null
          },
          "availableQuantity": {
            "type": "number",
            "description": "Available inventory stock quantity",
            "example": 5
          },
          "allowOutOfStockPurchases": {
            "type": "boolean",
            "description": "Continue selling when out of stock",
            "example": true
          }
        },
        "required": [
          "_id",
          "name",
          "type",
          "currency",
          "amount"
        ],
        "title": "UpdatePriceResponseDto"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## HighLevel SDK Examples

**Node.js** (`@gohighlevel/api-client`)

```javascript
import HighLevel from '@gohighlevel/api-client';

const ghl = new HighLevel({
  privateIntegrationToken: '<PRIVATE_INTEGRATION_TOKEN>'
});

const body = {
  "name": "Price Name",
  "type": "one_time",
  "currency": "USD",
  "amount": 99.99,
  "recurring": {
    "interval": "day",
    "intervalCount": 1
  },
  "membershipOffers": [
    {
      "label": "top_50",
      "value": "50",
      "_id": "655b33aa2209e60b6adb87a7"
    }
  ],
  "trialPeriod": 7,
  "totalCycles": 12,
  "setupFee": 10.99,
  "variantOptionIds": [
    "option_id_1",
    "option_id_2"
  ],
  "compareAtPrice": 19.99,
  "locationId": "6578278e879ad2646715ba9c",
  "userId": "6578278e879ad2646715ba9c",
  "meta": {
    "source": "stripe",
    "sourceId": "123",
    "stripePriceId": "price_123",
    "internalSource": "agency_plan"
  },
  "trackInventory": true,
  "availableQuantity": 5,
  "allowOutOfStockPurchases": true,
  "sku": "sku_123",
  "shippingOptions": {
    "weight": {
      "value": 10,
      "unit": "kg"
    },
    "dimensions": {
      "height": 10,
      "width": 10,
      "length": 10,
      "unit": "cm"
    }
  },
  "isDigitalProduct": true,
  "digitalDelivery": []
};

const response = await ghl.products.updatePriceByIdForAProduct('<PRODUCTID>', '<PRICEID>', body);
console.log(response);
```

**Python** (`gohighlevel-api-client`)

```python
from highlevel import HighLevel

client = HighLevel(
    private_integration_token='<PRIVATE_INTEGRATION_TOKEN>'
)

body = {
    "name": "Price Name",
    "type": "one_time",
    "currency": "USD",
    "amount": 99.99,
    "recurring": {
        "interval": "day",
        "intervalCount": 1
    },
    "membershipOffers": [
        {
            "label": "top_50",
            "value": "50",
            "_id": "655b33aa2209e60b6adb87a7"
        }
    ],
    "trialPeriod": 7,
    "totalCycles": 12,
    "setupFee": 10.99,
    "variantOptionIds": [
        "option_id_1",
        "option_id_2"
    ],
    "compareAtPrice": 19.99,
    "locationId": "6578278e879ad2646715ba9c",
    "userId": "6578278e879ad2646715ba9c",
    "meta": {
        "source": "stripe",
        "sourceId": "123",
        "stripePriceId": "price_123",
        "internalSource": "agency_plan"
    },
    "trackInventory": true,
    "availableQuantity": 5,
    "allowOutOfStockPurchases": true,
    "sku": "sku_123",
    "shippingOptions": {
        "weight": {
            "value": 10,
            "unit": "kg"
        },
        "dimensions": {
            "height": 10,
            "width": 10,
            "length": 10,
            "unit": "cm"
        }
    },
    "isDigitalProduct": true,
    "digitalDelivery": []
}

response = await client.products.update_price_by_id_for_a_product('<PRODUCTID>', '<PRICEID>', body=body)
print(response)
```

**PHP** (`gohighlevel/api-client`)

```php
<?php
require_once 'vendor/autoload.php';

use HighLevel\HighLevel;
use HighLevel\HighLevelConfig;

$config = new HighLevelConfig([
    'privateIntegrationToken' => '<PRIVATE_INTEGRATION_TOKEN>'
]);
$ghl = new HighLevel($config);

$body = [
    'name' => 'Price Name',
    'type' => 'one_time',
    'currency' => 'USD',
    'amount' => 99.99,
    'recurring' => [
        'interval' => 'day',
        'intervalCount' => 1
    ],
    'membershipOffers' => [
        [
            'label' => 'top_50',
            'value' => '50',
            '_id' => '655b33aa2209e60b6adb87a7'
        ]
    ],
    'trialPeriod' => 7,
    'totalCycles' => 12,
    'setupFee' => 10.99,
    'variantOptionIds' => [
        'option_id_1',
        'option_id_2'
    ],
    'compareAtPrice' => 19.99,
    'locationId' => '6578278e879ad2646715ba9c',
    'userId' => '6578278e879ad2646715ba9c',
    'meta' => [
        'source' => 'stripe',
        'sourceId' => '123',
        'stripePriceId' => 'price_123',
        'internalSource' => 'agency_plan'
    ],
    'trackInventory' => true,
    'availableQuantity' => 5,
    'allowOutOfStockPurchases' => true,
    'sku' => 'sku_123',
    'shippingOptions' => [
        'weight' => [
            'value' => 10,
            'unit' => 'kg'
        ],
        'dimensions' => [
            'height' => 10,
            'width' => 10,
            'length' => 10,
            'unit' => 'cm'
        ]
    ],
    'isDigitalProduct' => true,
    'digitalDelivery' => []
];

$response = $ghl->products->updatePriceByIdForAProduct('<PRODUCTID>', '<PRICEID>', $body);
echo json_encode($response, JSON_PRETTY_PRINT);
```

## Code Examples

**cURL**

```bash
curl -L -X PUT 'https://services.leadconnectorhq.com/products/<productId>/price/<priceId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "Price Name",
  "type": "one_time",
  "currency": "USD",
  "amount": 99.99,
  "recurring": {
    "interval": "day",
    "intervalCount": 1
  },
  "membershipOffers": [
    {
      "label": "top_50",
      "value": "50",
      "_id": "655b33aa2209e60b6adb87a7"
    }
  ],
  "trialPeriod": 7,
  "totalCycles": 12,
  "setupFee": 10.99,
  "variantOptionIds": [
    "option_id_1",
    "option_id_2"
  ],
  "compareAtPrice": 19.99,
  "locationId": "6578278e879ad2646715ba9c",
  "userId": "6578278e879ad2646715ba9c",
  "meta": {
    "source": "stripe",
    "sourceId": "123",
    "stripePriceId": "price_123",
    "internalSource": "agency_plan"
  },
  "trackInventory": true,
  "availableQuantity": 5,
  "allowOutOfStockPurchases": true,
  "sku": "sku_123",
  "shippingOptions": {
    "weight": {
      "value": 10,
      "unit": "kg"
    },
    "dimensions": {
      "height": 10,
      "width": 10,
      "length": 10,
      "unit": "cm"
    }
  },
  "isDigitalProduct": true,
  "digitalDelivery": []
}'
```

**Node.js**

```javascript
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "name": "Price Name",
      "type": "one_time",
      "currency": "USD",
      "amount": 99.99,
      "recurring": {
        "interval": "day",
        "intervalCount": 1
      },
      "membershipOffers": [
        {
          "label": "top_50",
          "value": "50",
          "_id": "655b33aa2209e60b6adb87a7"
        }
      ],
      "trialPeriod": 7,
      "totalCycles": 12,
      "setupFee": 10.99,
      "variantOptionIds": [
        "option_id_1",
        "option_id_2"
      ],
      "compareAtPrice": 19.99,
      "locationId": "6578278e879ad2646715ba9c",
      "userId": "6578278e879ad2646715ba9c",
      "meta": {
        "source": "stripe",
        "sourceId": "123",
        "stripePriceId": "price_123",
        "internalSource": "agency_plan"
      },
      "trackInventory": true,
      "availableQuantity": 5,
      "allowOutOfStockPurchases": true,
      "sku": "sku_123",
      "shippingOptions": {
        "weight": {
          "value": 10,
          "unit": "kg"
        },
        "dimensions": {
          "height": 10,
          "width": 10,
          "length": 10,
          "unit": "cm"
        }
      },
      "isDigitalProduct": true,
      "digitalDelivery": []
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/products/<productId>/price/<priceId>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/products/{productId}/price/{priceId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

payload = {
    "name": "Price Name",
    "type": "one_time",
    "currency": "USD",
    "amount": 99.99,
    "recurring": {
        "interval": "day",
        "intervalCount": 1
    },
    "membershipOffers": [
        {
            "label": "top_50",
            "value": "50",
            "_id": "655b33aa2209e60b6adb87a7"
        }
    ],
    "trialPeriod": 7,
    "totalCycles": 12,
    "setupFee": 10.99,
    "variantOptionIds": [
        "option_id_1",
        "option_id_2"
    ],
    "compareAtPrice": 19.99,
    "locationId": "6578278e879ad2646715ba9c",
    "userId": "6578278e879ad2646715ba9c",
    "meta": {
        "source": "stripe",
        "sourceId": "123",
        "stripePriceId": "price_123",
        "internalSource": "agency_plan"
    },
    "trackInventory": true,
    "availableQuantity": 5,
    "allowOutOfStockPurchases": true,
    "sku": "sku_123",
    "shippingOptions": {
        "weight": {
            "value": 10,
            "unit": "kg"
        },
        "dimensions": {
            "height": 10,
            "width": 10,
            "length": 10,
            "unit": "cm"
        }
    },
    "isDigitalProduct": true,
    "digitalDelivery": []
}

response = requests.put(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/products/<productId>/price/<priceId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "name": "Price Name",
  "type": "one_time",
  "currency": "USD",
  "amount": 99.99,
  "recurring": {
    "interval": "day",
    "intervalCount": 1
  },
  "membershipOffers": [
    {
      "label": "top_50",
      "value": "50",
      "_id": "655b33aa2209e60b6adb87a7"
    }
  ],
  "trialPeriod": 7,
  "totalCycles": 12,
  "setupFee": 10.99,
  "variantOptionIds": [
    "option_id_1",
    "option_id_2"
  ],
  "compareAtPrice": 19.99,
  "locationId": "6578278e879ad2646715ba9c",
  "userId": "6578278e879ad2646715ba9c",
  "meta": {
    "source": "stripe",
    "sourceId": "123",
    "stripePriceId": "price_123",
    "internalSource": "agency_plan"
  },
  "trackInventory": true,
  "availableQuantity": 5,
  "allowOutOfStockPurchases": true,
  "sku": "sku_123",
  "shippingOptions": {
    "weight": {
      "value": 10,
      "unit": "kg"
    },
    "dimensions": {
      "height": 10,
      "width": 10,
      "length": 10,
      "unit": "cm"
    }
  },
  "isDigitalProduct": true,
  "digitalDelivery": []
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .put("https://services.leadconnectorhq.com/products/<productId>/price/<priceId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .header("Content-Type", "application/json")
  .body("{\"name\":\"Price Name\",\"type\":\"one_time\",\"currency\":\"USD\",\"amount\":99.99,\"recurring\":{\"interval\":\"day\",\"intervalCount\":1},\"membershipOffers\":[{\"label\":\"top_50\",\"value\":\"50\",\"_id\":\"655b33aa2209e60b6adb87a7\"}],\"trialPeriod\":7,\"totalCycles\":12,\"setupFee\":10.99,\"variantOptionIds\":[\"option_id_1\",\"option_id_2\"],\"compareAtPrice\":19.99,\"locationId\":\"6578278e879ad2646715ba9c\",\"userId\":\"6578278e879ad2646715ba9c\",\"meta\":{\"source\":\"stripe\",\"sourceId\":\"123\",\"stripePriceId\":\"price_123\",\"internalSource\":\"agency_plan\"},\"trackInventory\":true,\"availableQuantity\":5,\"allowOutOfStockPurchases\":true,\"sku\":\"sku_123\",\"shippingOptions\":{\"weight\":{\"value\":10,\"unit\":\"kg\"},\"dimensions\":{\"height\":10,\"width\":10,\"length\":10,\"unit\":\"cm\"}},\"isDigitalProduct\":true,\"digitalDelivery\":[]}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/products/<productId>/price/<priceId>"
  payload := strings.NewReader(`{
  "name": "Price Name",
  "type": "one_time",
  "currency": "USD",
  "amount": 99.99,
  "recurring": {
    "interval": "day",
    "intervalCount": 1
  },
  "membershipOffers": [
    {
      "label": "top_50",
      "value": "50",
      "_id": "655b33aa2209e60b6adb87a7"
    }
  ],
  "trialPeriod": 7,
  "totalCycles": 12,
  "setupFee": 10.99,
  "variantOptionIds": [
    "option_id_1",
    "option_id_2"
  ],
  "compareAtPrice": 19.99,
  "locationId": "6578278e879ad2646715ba9c",
  "userId": "6578278e879ad2646715ba9c",
  "meta": {
    "source": "stripe",
    "sourceId": "123",
    "stripePriceId": "price_123",
    "internalSource": "agency_plan"
  },
  "trackInventory": true,
  "availableQuantity": 5,
  "allowOutOfStockPurchases": true,
  "sku": "sku_123",
  "shippingOptions": {
    "weight": {
      "value": 10,
      "unit": "kg"
    },
    "dimensions": {
      "height": 10,
      "width": 10,
      "length": 10,
      "unit": "cm"
    }
  },
  "isDigitalProduct": true,
  "digitalDelivery": []
}`)
  req, _ := http.NewRequest("PUT", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/products/<productId>/price/<priceId>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"
request["Content-Type"] = "application/json"
request.body = '{
  "name": "Price Name",
  "type": "one_time",
  "currency": "USD",
  "amount": 99.99,
  "recurring": {
    "interval": "day",
    "intervalCount": 1
  },
  "membershipOffers": [
    {
      "label": "top_50",
      "value": "50",
      "_id": "655b33aa2209e60b6adb87a7"
    }
  ],
  "trialPeriod": 7,
  "totalCycles": 12,
  "setupFee": 10.99,
  "variantOptionIds": [
    "option_id_1",
    "option_id_2"
  ],
  "compareAtPrice": 19.99,
  "locationId": "6578278e879ad2646715ba9c",
  "userId": "6578278e879ad2646715ba9c",
  "meta": {
    "source": "stripe",
    "sourceId": "123",
    "stripePriceId": "price_123",
    "internalSource": "agency_plan"
  },
  "trackInventory": true,
  "availableQuantity": 5,
  "allowOutOfStockPurchases": true,
  "sku": "sku_123",
  "shippingOptions": {
    "weight": {
      "value": 10,
      "unit": "kg"
    },
    "dimensions": {
      "height": 10,
      "width": 10,
      "length": 10,
      "unit": "cm"
    }
  },
  "isDigitalProduct": true,
  "digitalDelivery": []
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$body = '{
  "name": "Price Name",
  "type": "one_time",
  "currency": "USD",
  "amount": 99.99,
  "recurring": {
    "interval": "day",
    "intervalCount": 1
  },
  "membershipOffers": [
    {
      "label": "top_50",
      "value": "50",
      "_id": "655b33aa2209e60b6adb87a7"
    }
  ],
  "trialPeriod": 7,
  "totalCycles": 12,
  "setupFee": 10.99,
  "variantOptionIds": [
    "option_id_1",
    "option_id_2"
  ],
  "compareAtPrice": 19.99,
  "locationId": "6578278e879ad2646715ba9c",
  "userId": "6578278e879ad2646715ba9c",
  "meta": {
    "source": "stripe",
    "sourceId": "123",
    "stripePriceId": "price_123",
    "internalSource": "agency_plan"
  },
  "trackInventory": true,
  "availableQuantity": 5,
  "allowOutOfStockPurchases": true,
  "sku": "sku_123",
  "shippingOptions": {
    "weight": {
      "value": 10,
      "unit": "kg"
    },
    "dimensions": {
      "height": 10,
      "width": 10,
      "length": 10,
      "unit": "cm"
    }
  },
  "isDigitalProduct": true,
  "digitalDelivery": []
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/products/<productId>/price/<priceId>' -Method 'PUT' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
