commercetools · Capability

commercetools HTTP API — Carts

commercetools HTTP API — Carts. 5 operations. Lead operation: List carts. Self-contained Naftiko capability covering one Commercetools business surface.

Run with Naftiko CommercetoolsCarts

What You Can Do

GET
Listcarts — List carts
/v1/{projectkey}/carts
POST
Createcart — Create a cart
/v1/{projectkey}/carts
GET
Getcartbyid — Get a cart by ID
/v1/{projectkey}/carts/{id}
POST
Updatecartbyid — Update a cart by ID
/v1/{projectkey}/carts/{id}
DELETE
Deletecartbyid — Delete a cart by ID
/v1/{projectkey}/carts/{id}

MCP Tools

list-carts

List carts

read-only idempotent
create-cart

Create a cart

get-cart-id

Get a cart by ID

read-only idempotent
update-cart-id

Update a cart by ID

delete-cart-id

Delete a cart by ID

idempotent

Capability Spec

http-carts.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: commercetools HTTP API — Carts
  description: 'commercetools HTTP API — Carts. 5 operations. Lead operation: List carts. Self-contained Naftiko capability
    covering one Commercetools business surface.'
  tags:
  - Commercetools
  - Carts
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    COMMERCETOOLS_API_KEY: COMMERCETOOLS_API_KEY
capability:
  consumes:
  - type: http
    namespace: http-carts
    baseUri: https://api.{region}.commercetools.com
    description: commercetools HTTP API — Carts business capability. Self-contained, no shared references.
    resources:
    - name: projectKey-carts
      path: /{projectKey}/carts
      operations:
      - name: listcarts
        method: GET
        description: List carts
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createcart
        method: POST
        description: Create a cart
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: projectKey-carts-id
      path: /{projectKey}/carts/{id}
      operations:
      - name: getcartbyid
        method: GET
        description: Get a cart by ID
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updatecartbyid
        method: POST
        description: Update a cart by ID
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deletecartbyid
        method: DELETE
        description: Delete a cart by ID
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: bearer
      token: '{{env.COMMERCETOOLS_API_KEY}}'
  exposes:
  - type: rest
    namespace: http-carts-rest
    port: 8080
    description: REST adapter for commercetools HTTP API — Carts. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/{projectkey}/carts
      name: projectkey-carts
      description: REST surface for projectKey-carts.
      operations:
      - method: GET
        name: listcarts
        description: List carts
        call: http-carts.listcarts
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createcart
        description: Create a cart
        call: http-carts.createcart
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/{projectkey}/carts/{id}
      name: projectkey-carts-id
      description: REST surface for projectKey-carts-id.
      operations:
      - method: GET
        name: getcartbyid
        description: Get a cart by ID
        call: http-carts.getcartbyid
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: updatecartbyid
        description: Update a cart by ID
        call: http-carts.updatecartbyid
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletecartbyid
        description: Delete a cart by ID
        call: http-carts.deletecartbyid
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: http-carts-mcp
    port: 9090
    transport: http
    description: MCP adapter for commercetools HTTP API — Carts. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: list-carts
      description: List carts
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: http-carts.listcarts
      outputParameters:
      - type: object
        mapping: $.
    - name: create-cart
      description: Create a cart
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: http-carts.createcart
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-cart-id
      description: Get a cart by ID
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: http-carts.getcartbyid
      outputParameters:
      - type: object
        mapping: $.
    - name: update-cart-id
      description: Update a cart by ID
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: http-carts.updatecartbyid
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-cart-id
      description: Delete a cart by ID
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: http-carts.deletecartbyid
      outputParameters:
      - type: object
        mapping: $.