> ## Documentation Index
> Fetch the complete documentation index at: https://composio-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Commerce Layer

> Commerce Layer provides transactional commerce and analytics APIs for managing orders, inventory, pricing, customers, fulfillment, and related ecommerce operations.

![Commerce Layer logo](https://mintcdn.com/composio-preview/NPf8agM6UrvZD-Iu/images/toolkits/commerce_layer.svg?fit=max\&auto=format\&n=NPf8agM6UrvZD-Iu\&q=85\&s=5c349519b7da85ec131e1f2f339c5c6f)

* **Category:** commerce
* **Auth:** S2S\_OAUTH2
* **Composio-managed OAuth available?** No
* **Tools:** 10
* **Triggers:** 0
* **Slug:** `COMMERCE_LAYER`
* **Version:** 20261101\_00

## Tools

> [accordion] Create Customer
>
> **Slug:** `COMMERCE_LAYER_CREATE_CUSTOMER`
>
> Create one Commerce Layer customer from an email and optional external-reference metadata. Use a unique email or reference for automation. This mutation is cleanly undoable with DELETE\_CUSTOMER using the returned customer ID.
>
> #### Input Parameters
>
> **email** `string` *required*
>
> Customer email address.
>
> **metadata** `object`
>
> Optional JSON metadata to store on the customer.
>
> **reference** `string`
>
> External system reference for the customer.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Delete Customer
>
> **Slug:** `COMMERCE_LAYER_DELETE_CUSTOMER`
>
> Permanently delete one Commerce Layer customer by exact ID. This irreversible operation requires explicit confirmation and is intended only for confirmed cleanup or erasure, never bulk deletion. Never infer or enumerate customer IDs; call GET\_CUSTOMER first unless deleting a fixture created in the same workflow.
>
> #### Input Parameters
>
> **customer\_id** `string` *required*
>
> Exact Commerce Layer customer resource ID to permanently delete. Call GET\_CUSTOMER first unless deleting a fixture created in the same workflow.
>
> **confirm\_delete** `boolean` *required*
>
> Must be true to confirm this irreversible deletion. This confirmation is validated locally and is not sent to Commerce Layer.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Get Customer
>
> **Slug:** `COMMERCE_LAYER_GET_CUSTOMER`
>
> Retrieve one customer by its Commerce Layer resource ID.
>
> #### Input Parameters
>
> **customer\_id** `string` *required*
>
> Commerce Layer customer resource ID.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Get Order
>
> **Slug:** `COMMERCE_LAYER_GET_ORDER`
>
> Retrieve one Commerce Layer order by ID, optionally including customer, line-item, shipment, or return context.
>
> #### Input Parameters
>
> **include** `array`
>
> Optional non-empty list of related resources to include: customer, line\_items, shipments, or returns. Use only what the task needs.
>
> **order\_id** `string` *required*
>
> Commerce Layer order resource ID.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Get Order Metric
>
> **Slug:** `COMMERCE_LAYER_GET_ORDER_METRIC`
>
> Compute one common order KPI over optional date, market, currency, and status filters using the Commerce Layer Metrics API.
>
> #### Input Parameters
>
> **metric** `string ("order_count" | "unique_customers" | "gross_revenue" | "net_revenue" | "average_order_value")` *required*
>
> KPI to compute: order\_count, unique\_customers, gross\_revenue, net\_revenue, or average\_order\_value.
>
> **date\_to** `string`
>
> Optional inclusive UTC end timestamp in YYYY-MM-DDTHH:MM:SSZ format.
>
> **statuses** `array`
>
> Optional non-empty list of order statuses: placed, approved, or cancelled.
>
> **date\_from** `string`
>
> Optional inclusive UTC start timestamp in YYYY-MM-DDTHH:MM:SSZ format.
>
> **date\_field** `string ("created_at" | "updated_at" | "approved_at" | "placed_at")`
>
> Order timestamp used by date\_from and date\_to: created\_at, updated\_at, approved\_at, or placed\_at.
>
> **market\_ids** `array`
>
> Optional non-empty list of Commerce Layer market IDs to include.
>
> **currency\_codes** `array`
>
> Optional non-empty list of three-letter ISO 4217 currency codes to include. Values are normalized to uppercase.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] List Customers
>
> **Slug:** `COMMERCE_LAYER_LIST_CUSTOMERS`
>
> Return one page of customers, optionally filtered by an exact email address.
>
> #### Input Parameters
>
> **email** `string`
>
> Exact customer email to match; omit to list customers.
>
> **sort\_by** `string ("email" | "status" | "total_orders_count" | "created_at" | "updated_at" | "reference")`
>
> Optional customer field to sort by: email, status, total\_orders\_count, created\_at, updated\_at, or reference.
>
> **page\_size** `integer`
>
> Customers to return per page (1-25).
>
> **next\_cursor** `string`
>
> Opaque continuation cursor returned by a previous call; omit for the first page.
>
> **sort\_direction** `string ("ascending" | "descending")`
>
> Sort direction when sort\_by is set: ascending or descending.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] List Orders
>
> **Slug:** `COMMERCE_LAYER_LIST_ORDERS`
>
> Return one page of orders, newest first by default, for operational review and follow-up by order ID.
>
> #### Input Parameters
>
> **sort\_by** `string ("number" | "status" | "payment_status" | "fulfillment_status" | "currency_code" | "total_amount_cents" | "placed_at" | "approved_at" | "cancelled_at" | "created_at" | "updated_at")`
>
> Order field to sort by. Choose number, status, payment\_status, fulfillment\_status, currency\_code, total\_amount\_cents, placed\_at, approved\_at, cancelled\_at, created\_at, or updated\_at.
>
> **page\_size** `integer`
>
> Orders to return per page (1-25).
>
> **next\_cursor** `string`
>
> Opaque continuation cursor returned by a previous call; omit for the first page.
>
> **sort\_direction** `string ("ascending" | "descending")`
>
> Sort direction: ascending or descending.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] List SKUs
>
> **Slug:** `COMMERCE_LAYER_LIST_SKUS`
>
> Return one page of catalog SKUs for product discovery and ID lookup.
>
> #### Input Parameters
>
> **sort\_by** `string ("code" | "name" | "do_not_ship" | "do_not_track" | "created_at" | "updated_at" | "reference")`
>
> Optional SKU field to sort by: code, name, do\_not\_ship, do\_not\_track, created\_at, updated\_at, or reference.
>
> **page\_size** `integer`
>
> SKUs to return per page (1-25).
>
> **next\_cursor** `string`
>
> Opaque continuation cursor returned by a previous call; omit for the first page.
>
> **sort\_direction** `string ("ascending" | "descending")`
>
> Sort direction when sort\_by is set: ascending or descending.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] List Stock Items
>
> **Slug:** `COMMERCE_LAYER_LIST_STOCK_ITEMS`
>
> Return one page of stock items with inventory quantities and SKU codes when available.
>
> #### Input Parameters
>
> **sort\_by** `string ("quantity" | "created_at" | "updated_at" | "reference" | "reference_origin")`
>
> Optional stock item field to sort by: quantity, created\_at, updated\_at, reference, or reference\_origin.
>
> **page\_size** `integer`
>
> Stock items to return per page (1-25).
>
> **next\_cursor** `string`
>
> Opaque continuation cursor returned by a previous call; omit for the first page.
>
> **sort\_direction** `string ("ascending" | "descending")`
>
> Sort direction when sort\_by is set: ascending or descending.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Update Customer
>
> **Slug:** `COMMERCE_LAYER_UPDATE_CUSTOMER`
>
> Update selected attributes of one Commerce Layer customer. Supply at least one of email, reference, or metadata; explicit null values are rejected.
>
> #### Input Parameters
>
> **email** `string`
>
> Replacement email; omit to preserve the current email.
>
> **metadata** `object`
>
> Replacement metadata object; omit to preserve it.
>
> **reference** `string`
>
> Replacement external reference; omit to preserve it.
>
> **customer\_id** `string` *required*
>
> Commerce Layer customer resource ID.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not
