Skip to content
Get started

Retrieve

products.retrieve(strcode) -> ProductRetrieveResponse
GET/products/{code}

Gets a product by code

ParametersExpand Collapse
code: str

Product code

ReturnsExpand Collapse
class ProductRetrieveResponse:
data: Data

Product object

id: str

Unique identifier for the product

code: str

User-defined product identifier.

created: datetime

ISO 8601 timestamp when the product was created

formatdate-time
description: str

Description of the product

update_version: float

Version number for optimistic locking

workspace_id: str

Workspace ID this product belongs to

Retrieve

from fragment import Fragment

client = Fragment()
product = client.products.retrieve(
    "PROD_001",
)
print(product.data)
{
  "data": {
    "id": "product_1234567890",
    "code": "PROD_001",
    "created": "2024-01-13T00:00:00Z",
    "description": "Premium subscription service",
    "paid_by_roles": [
      {
        "id": "role_def123",
        "name": "buyer"
      }
    ],
    "paid_to_roles": [
      {
        "id": "role_def123",
        "name": "buyer"
      }
    ],
    "updateVersion": 1,
    "workspaceId": "ws_1234567890"
  }
}
Returns Examples
{
  "data": {
    "id": "product_1234567890",
    "code": "PROD_001",
    "created": "2024-01-13T00:00:00Z",
    "description": "Premium subscription service",
    "paid_by_roles": [
      {
        "id": "role_def123",
        "name": "buyer"
      }
    ],
    "paid_to_roles": [
      {
        "id": "role_def123",
        "name": "buyer"
      }
    ],
    "updateVersion": 1,
    "workspaceId": "ws_1234567890"
  }
}