Lago · Capability

Lago API documentation — Subscriptions

Lago API documentation — Subscriptions. 7 operations. Lead operation: Lago Assign a plan to a customer. Self-contained Naftiko capability covering one Lago business surface.

Run with Naftiko LagoSubscriptions

What You Can Do

POST
Createsubscription — Lago Assign a plan to a customer
/v1/subscriptions
GET
Findallsubscriptions — Lago List all subscriptions
/v1/subscriptions
GET
Findsubscription — Lago Retrieve a subscription
/v1/subscriptions/{external-id}
PUT
Updatesubscription — Lago Update a subscription
/v1/subscriptions/{external-id}
DELETE
Destroysubscription — Lago Terminate a subscription
/v1/subscriptions/{external-id}
GET
Getsubscriptionlifetimeusage — Lago Retrive subscription lifetime usage
/v1/subscriptions/{external-id}/lifetime-usage
PUT
Updatesubscriptionlifetimeusage — Lago Update a subscription lifetime usage
/v1/subscriptions/{external-id}/lifetime-usage

MCP Tools

lago-assign-plan-customer

Lago Assign a plan to a customer

lago-list-all-subscriptions

Lago List all subscriptions

read-only idempotent
lago-retrieve-subscription

Lago Retrieve a subscription

read-only idempotent
lago-update-subscription

Lago Update a subscription

idempotent
lago-terminate-subscription

Lago Terminate a subscription

idempotent
lago-retrive-subscription-lifetime-usage

Lago Retrive subscription lifetime usage

read-only idempotent
lago-update-subscription-lifetime-usage

Lago Update a subscription lifetime usage

idempotent

Capability Spec

lago-subscriptions.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Lago API documentation — Subscriptions
  description: 'Lago API documentation — Subscriptions. 7 operations. Lead operation: Lago Assign a plan to a customer. Self-contained
    Naftiko capability covering one Lago business surface.'
  tags:
  - Lago
  - Subscriptions
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    LAGO_API_KEY: LAGO_API_KEY
capability:
  consumes:
  - type: http
    namespace: lago-subscriptions
    baseUri: https://api.getlago.com/api/v1
    description: Lago API documentation — Subscriptions business capability. Self-contained, no shared references.
    resources:
    - name: subscriptions
      path: /subscriptions
      operations:
      - name: createsubscription
        method: POST
        description: Lago Assign a plan to a customer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: findallsubscriptions
        method: GET
        description: Lago List all subscriptions
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: external_customer_id
          in: query
          type: string
          description: The customer external unique identifier (provided by your own application)
        - name: plan_code
          in: query
          type: string
          description: The unique code representing the plan to be attached to the customer. This code must correspond to
            the code property of one of the active plans.
        - name: status[]
          in: query
          type: array
          description: If the field is not defined, Lago will return only `active` subscriptions. However, if you wish to
            fetch subscriptions by different status you can define them i
    - name: subscriptions-external_id
      path: /subscriptions/{external_id}
      operations:
      - name: findsubscription
        method: GET
        description: Lago Retrieve a subscription
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updatesubscription
        method: PUT
        description: Lago Update a subscription
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: destroysubscription
        method: DELETE
        description: Lago Terminate a subscription
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: status
          in: query
          type: string
          description: If the field is not defined, Lago will terminate only `active` subscriptions. However, if you wish
            to cancel a `pending` subscription, please ensure that you in
    - name: subscriptions-external_id-lifetime_usage
      path: /subscriptions/{external_id}/lifetime_usage
      operations:
      - name: getsubscriptionlifetimeusage
        method: GET
        description: Lago Retrive subscription lifetime usage
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updatesubscriptionlifetimeusage
        method: PUT
        description: Lago Update a subscription lifetime usage
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: bearer
      token: '{{env.LAGO_API_KEY}}'
  exposes:
  - type: rest
    namespace: lago-subscriptions-rest
    port: 8080
    description: REST adapter for Lago API documentation — Subscriptions. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/subscriptions
      name: subscriptions
      description: REST surface for subscriptions.
      operations:
      - method: POST
        name: createsubscription
        description: Lago Assign a plan to a customer
        call: lago-subscriptions.createsubscription
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: findallsubscriptions
        description: Lago List all subscriptions
        call: lago-subscriptions.findallsubscriptions
        with:
          external_customer_id: rest.external_customer_id
          plan_code: rest.plan_code
          status[]: rest.status[]
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/subscriptions/{external-id}
      name: subscriptions-external-id
      description: REST surface for subscriptions-external_id.
      operations:
      - method: GET
        name: findsubscription
        description: Lago Retrieve a subscription
        call: lago-subscriptions.findsubscription
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updatesubscription
        description: Lago Update a subscription
        call: lago-subscriptions.updatesubscription
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: destroysubscription
        description: Lago Terminate a subscription
        call: lago-subscriptions.destroysubscription
        with:
          status: rest.status
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/subscriptions/{external-id}/lifetime-usage
      name: subscriptions-external-id-lifetime-usage
      description: REST surface for subscriptions-external_id-lifetime_usage.
      operations:
      - method: GET
        name: getsubscriptionlifetimeusage
        description: Lago Retrive subscription lifetime usage
        call: lago-subscriptions.getsubscriptionlifetimeusage
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updatesubscriptionlifetimeusage
        description: Lago Update a subscription lifetime usage
        call: lago-subscriptions.updatesubscriptionlifetimeusage
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: lago-subscriptions-mcp
    port: 9090
    transport: http
    description: MCP adapter for Lago API documentation — Subscriptions. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: lago-assign-plan-customer
      description: Lago Assign a plan to a customer
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: lago-subscriptions.createsubscription
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: lago-list-all-subscriptions
      description: Lago List all subscriptions
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: lago-subscriptions.findallsubscriptions
      with:
        external_customer_id: tools.external_customer_id
        plan_code: tools.plan_code
        status[]: tools.status[]
      outputParameters:
      - type: object
        mapping: $.
    - name: lago-retrieve-subscription
      description: Lago Retrieve a subscription
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: lago-subscriptions.findsubscription
      outputParameters:
      - type: object
        mapping: $.
    - name: lago-update-subscription
      description: Lago Update a subscription
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: lago-subscriptions.updatesubscription
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: lago-terminate-subscription
      description: Lago Terminate a subscription
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: lago-subscriptions.destroysubscription
      with:
        status: tools.status
      outputParameters:
      - type: object
        mapping: $.
    - name: lago-retrive-subscription-lifetime-usage
      description: Lago Retrive subscription lifetime usage
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: lago-subscriptions.getsubscriptionlifetimeusage
      outputParameters:
      - type: object
        mapping: $.
    - name: lago-update-subscription-lifetime-usage
      description: Lago Update a subscription lifetime usage
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: lago-subscriptions.updatesubscriptionlifetimeusage
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.