Inttegro.Products (inttegro v0.2.0)

Copy Markdown View Source

Manages products and the prices, media, and attributes used to sell them.

Products are reusable catalog records. Publishing controls availability to public purchasing surfaces; archiving retires a product without rewriting historical orders that reference it.

Summary

Functions

Creates a new price for an existing product owned by the authenticated application. Key points: - The target product must belong to your authenticated application - Archived products cannot accept new prices - The response returns the created price only

Archive a product and mark it inactive. Archive blocks /products/add_price, but the current API still permits lookup, update, publish, catalog-ID order snapshots, and purchase-intent resolution for the product.

Creates a new product in your catalog. Products represent items you sell—physical goods, digital downloads, services, or subscriptions. Each product includes pricing, description, and fulfillment details. Product types: - physical: Tangible goods requiring shipping (requires shipment details) - digital: Electronic content (e-books, software, media) delivered via download/stream - service: Intangible offerings (consulting, subscriptions, memberships) - voucher: Gift cards, credits, or promotional codes - custom: Custom product types for specialized use cases - cause: Donation or charitable contribution products

Retrieves a product's details by ID. Returns the complete product record including pricing, description, category, shipment details, and all metadata.

Retrieve a paginated list of products for the authenticated application. No response ordering is guaranteed.

Mark a product active and record its publication time. Publishing can also reactivate an archived product; the archive timestamp remains part of its history.

Mark a product inactive for catalog lifecycle purposes. Existing prices and purchase intents are not disabled by this operation.

Update the mutable description, classification, fulfillment, dimension, media, attribute, and custom-data fields of an existing product. If type is supplied, it must equal the existing type. images and media are mutually exclusive. Inline price updates are not supported; use the Prices API. An ID-only request succeeds without changing the product, and archived products can still be updated.

Functions

add_price(client, request, options \\ [])

Creates a new price for an existing product owned by the authenticated application. Key points: - The target product must belong to your authenticated application - Archived products cannot accept new prices - The response returns the created price only

Parameters

Returns

Returns {:ok, Inttegro.Prices.Catalog.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Products.AddPriceRequest.new!(request_attributes)

case Inttegro.Products.add_price(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

archive(client, request, options \\ [])

Archive a product and mark it inactive. Archive blocks /products/add_price, but the current API still permits lookup, update, publish, catalog-ID order snapshots, and purchase-intent resolution for the product.

Parameters

Returns

Returns {:ok, Inttegro.Products.Product.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Products.ActionRequest.new!(request_attributes)

case Inttegro.Products.archive(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

create(client, request, options \\ [])

Creates a new product in your catalog. Products represent items you sell—physical goods, digital downloads, services, or subscriptions. Each product includes pricing, description, and fulfillment details. Product types: - physical: Tangible goods requiring shipping (requires shipment details) - digital: Electronic content (e-books, software, media) delivered via download/stream - service: Intangible offerings (consulting, subscriptions, memberships) - voucher: Gift cards, credits, or promotional codes - custom: Custom product types for specialized use cases - cause: Donation or charitable contribution products

Parameters

Returns

Returns {:ok, Inttegro.Products.Product.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Products.CreateRequest.new!(request_attributes)

case Inttegro.Products.create(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

lookup(client, request, options \\ [])

Retrieves a product's details by ID. Returns the complete product record including pricing, description, category, shipment details, and all metadata.

Parameters

Returns

Returns {:ok, Inttegro.Products.Product.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Products.LookupRequest.new!(request_attributes)

case Inttegro.Products.lookup(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

page(client, request, options \\ [])

Retrieve a paginated list of products for the authenticated application. No response ordering is guaranteed.

Parameters

Returns

Returns {:ok, Inttegro.Products.Page.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Products.PageRequest.new!(request_attributes)

case Inttegro.Products.page(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

publish(client, request, options \\ [])

Mark a product active and record its publication time. Publishing can also reactivate an archived product; the archive timestamp remains part of its history.

Parameters

Returns

Returns {:ok, Inttegro.Products.Product.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Products.ActionRequest.new!(request_attributes)

case Inttegro.Products.publish(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

unpublish(client, request, options \\ [])

Mark a product inactive for catalog lifecycle purposes. Existing prices and purchase intents are not disabled by this operation.

Parameters

Returns

Returns {:ok, Inttegro.Products.Product.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Products.ActionRequest.new!(request_attributes)

case Inttegro.Products.unpublish(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

update(client, request, options \\ [])

Update the mutable description, classification, fulfillment, dimension, media, attribute, and custom-data fields of an existing product. If type is supplied, it must equal the existing type. images and media are mutually exclusive. Inline price updates are not supported; use the Prices API. An ID-only request succeeds without changing the product, and archived products can still be updated.

Parameters

Returns

Returns {:ok, Inttegro.Products.Product.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Products.UpdateRequest.new!(request_attributes)

case Inttegro.Products.update(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end