v20

OpenAPI 3.1.0raw.githubusercontent.com2026-08-01970424.3 KB
Payments

Update Item Quantity

Updates the quantity of an item for a customer. Can increase or decrease quantities, with optional expiration and negative balance control.

post/payments/items/{customer_type}/{customer_id}/{item_id}/update-quantity

Path parameters

customer_type'user' | 'team' | 'custom' required

The type of customer

Example:user

The type of customer

customer_idstring required

The ID of the customer

Example:user_1234567890abcdef

The ID of the customer

item_idstring required

The ID of the item to update

Example:credits

The ID of the item to update

Query parameters

allow_negative'true' | 'false' required

Whether to allow the quantity to go negative

Example:false

Whether to allow the quantity to go negative

Request body

deltainteger required

The amount to change the quantity by (positive to increase, negative to decrease)

expires_atstring

Optional expiration date for this quantity change (ISO 8601 format)

descriptionstring

Optional description for this quantity change

Example request

{
  "delta": 100,
  "expires_at": "2024-12-31T23:59:59Z",
  "description": "Monthly subscription renewal"
}

Response

Successful response

object required