Open Context Protocol is live! 🚀 Read the launch post

getProducts

List all products

Details

  • Method: GET
  • Path: /v1/products
  • Operation ID: GetProducts

Parameters

{
  "active": {
    "description": "Only return products that are active or inactive (e.g., pass `false` to list all inactive products).",
    "required": false,
    "location": "query",
    "type": "boolean"
  },
  "created": {
    "description": "Only return products that were created during the given date interval.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "ending_before": {
    "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "expand": {
    "description": "Specifies which fields in the response should be expanded.",
    "required": false,
    "location": "query",
    "type": "array"
  },
  "ids": {
    "description": "Only return products with the given IDs. Cannot be used with [starting_after](https://api.stripe.com#list_products-starting_after) or [ending_before](https://api.stripe.com#list_products-ending_before).",
    "required": false,
    "location": "query",
    "type": "array"
  },
  "limit": {
    "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "shippable": {
    "description": "Only return products that can be shipped (i.e., physical, not digital products).",
    "required": false,
    "location": "query",
    "type": "boolean"
  },
  "starting_after": {
    "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "url": {
    "description": "Only return products with the given url.",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "description": "",
  "properties": {
    "data": {
      "description": "Details about each object.",
      "items": {
        "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"
      },
      "type": "array"
    },
    "has_more": {
      "description": "True if this list has another page of items after this one that can be fetched.",
      "type": "boolean"
    },
    "object": {
      "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.",
      "enum": [
        "list"
      ],
      "type": "string"
    },
    "url": {
      "description": "The URL where this list can be accessed.",
      "maxLength": 5000,
      "pattern": "^/v1/products",
      "type": "string"
    }
  },
  "required": [
    "data",
    "has_more",
    "object",
    "url"
  ],
  "title": "ProductList",
  "type": "object",
  "x-expandableFields": [
    "data"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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