Open Context Protocol is live! 🚀 Read the launch post

getProductsId

Retrieve a product

Details

  • Method: GET
  • Path: /v1/products/{id}
  • Operation ID: GetProductsId

Parameters

{
  "expand": {
    "description": "Specifies which fields in the response should be expanded.",
    "required": false,
    "location": "query",
    "type": "array"
  },
  "id": {
    "description": "",
    "required": true,
    "location": "path",
    "type": "string"
  }
}

Response Schema

{
  "description": "Products describe the specific goods or services you offer to your customers.\nFor example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product.\nThey can be used in conjunction with [Prices](https://api.stripe.com#prices) to configure pricing in Payment Links, Checkout, and Subscriptions.\n\nRelated guides: [Set up a subscription](https://docs.stripe.com/billing/subscriptions/set-up-subscription),\n[share a Payment Link](https://docs.stripe.com/payment-links),\n[accept payments with Checkout](https://docs.stripe.com/payments/accept-a-payment#create-product-prices-upfront),\nand more about [Products and Prices](https://docs.stripe.com/products-prices/overview)",
  "properties": {
    "active": {
      "description": "Whether the product is currently available for purchase.",
      "type": "boolean"
    },
    "created": {
      "description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
      "format": "unix-time",
      "type": "integer"
    },
    "default_price": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/price"
        }
      ],
      "description": "The ID of the [Price](https://docs.stripe.com/api/prices) object that is the default price for this product.",
      "nullable": true,
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/price"
          }
        ]
      }
    },
    "description": {
      "description": "The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.",
      "maxLength": 5000,
      "nullable": true,
      "type": "string"
    },
    "id": {
      "description": "Unique identifier for the object.",
      "maxLength": 5000,
      "type": "string"
    },
    "images": {
      "description": "A list of up to 8 URLs of images for this product, meant to be displayable to the customer.",
      "items": {
        "maxLength": 5000,
        "type": "string"
      },
      "type": "array"
    },
    "livemode": {
      "description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.",
      "type": "boolean"
    },
    "marketing_features": {
      "description": "A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://docs.stripe.com/payments/checkout/pricing-table).",
      "items": {
        "description": "",
        "properties": {
          "name": {
            "description": "The marketing feature name. Up to 80 characters long.",
            "maxLength": 5000,
            "type": "string"
          }
        },
        "title": "ProductMarketingFeature",
        "type": "object",
        "x-expandableFields": []
      },
      "type": "array"
    },
    "metadata": {
      "additionalProperties": {
        "maxLength": 500,
        "type": "string"
      },
      "description": "Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.",
      "type": "object"
    },
    "name": {
      "description": "The product's name, meant to be displayable to the customer.",
      "maxLength": 5000,
      "type": "string"
    },
    "object": {
      "description": "String representing the object's type. Objects of the same type share the same value.",
      "enum": [
        "product"
      ],
      "type": "string"
    },
    "package_dimensions": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/package_dimensions"
        }
      ],
      "description": "The dimensions of this product for shipping purposes.",
      "nullable": true
    },
    "shippable": {
      "description": "Whether this product is shipped (i.e., physical goods).",
      "nullable": true,
      "type": "boolean"
    },
    "statement_descriptor": {
      "description": "Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. Only used for subscription payments.",
      "maxLength": 5000,
      "nullable": true,
      "type": "string"
    },
    "tax_code": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/tax_code"
        }
      ],
      "description": "A [tax code](https://docs.stripe.com/tax/tax-categories) ID.",
      "nullable": true,
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/tax_code"
          }
        ]
      }
    },
    "unit_label": {
      "description": "A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.",
      "maxLength": 5000,
      "nullable": true,
      "type": "string"
    },
    "updated": {
      "description": "Time at which the object was last updated. Measured in seconds since the Unix epoch.",
      "format": "unix-time",
      "type": "integer"
    },
    "url": {
      "description": "A URL of a publicly-accessible webpage for this product.",
      "maxLength": 2048,
      "nullable": true,
      "type": "string"
    }
  },
  "required": [
    "active",
    "created",
    "id",
    "images",
    "livemode",
    "marketing_features",
    "metadata",
    "name",
    "object",
    "updated"
  ],
  "title": "Product",
  "type": "object",
  "x-expandableFields": [
    "default_price",
    "marketing_features",
    "package_dimensions",
    "tax_code"
  ],
  "x-resourceId": "product"
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('stripe')

# Call this tool
result = await agent.call_tool('getProductsId', {
    # Add required parameters here
})