naftiko: 1.0.0-alpha2 info: label: Lago API documentation — Coupons description: 'Lago API documentation — Coupons. 8 operations. Lead operation: Lago Apply a coupon to a customer. Self-contained Naftiko capability covering one Lago business surface.' tags: - Lago - Coupons created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: LAGO_API_KEY: LAGO_API_KEY capability: consumes: - type: http namespace: lago-coupons baseUri: https://api.getlago.com/api/v1 description: Lago API documentation — Coupons business capability. Self-contained, no shared references. resources: - name: applied_coupons path: /applied_coupons operations: - name: applycoupon method: POST description: Lago Apply a coupon 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: findallappliedcoupons method: GET description: Lago List all applied coupons outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: status in: query type: string description: The status of the coupon. Can be either `active` or `terminated`. - name: external_customer_id in: query type: string description: The customer external unique identifier (provided by your own application) - name: coupons path: /coupons operations: - name: createcoupon method: POST description: Lago Create a coupon outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: findallcoupons method: GET description: Lago List all coupons outputRawFormat: json outputParameters: - name: result type: object value: $. - name: coupons-code path: /coupons/{code} operations: - name: updatecoupon method: PUT description: Lago Update a coupon outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: findcoupon method: GET description: Lago Retrieve a coupon outputRawFormat: json outputParameters: - name: result type: object value: $. - name: destroycoupon method: DELETE description: Lago Delete a coupon outputRawFormat: json outputParameters: - name: result type: object value: $. - name: customers-external_customer_id-applied_coupons-applied_coupon_id path: /customers/{external_customer_id}/applied_coupons/{applied_coupon_id} operations: - name: deleteappliedcoupon method: DELETE description: Lago Delete an applied coupon outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: external_customer_id in: path type: string description: The customer external unique identifier (provided by your own application) required: true - name: applied_coupon_id in: path type: string description: Unique identifier of the applied coupon, created by Lago. required: true authentication: type: bearer token: '{{env.LAGO_API_KEY}}' exposes: - type: rest namespace: lago-coupons-rest port: 8080 description: REST adapter for Lago API documentation — Coupons. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/applied-coupons name: applied-coupons description: REST surface for applied_coupons. operations: - method: POST name: applycoupon description: Lago Apply a coupon to a customer call: lago-coupons.applycoupon with: body: rest.body outputParameters: - type: object mapping: $. - method: GET name: findallappliedcoupons description: Lago List all applied coupons call: lago-coupons.findallappliedcoupons with: status: rest.status external_customer_id: rest.external_customer_id outputParameters: - type: object mapping: $. - path: /v1/coupons name: coupons description: REST surface for coupons. operations: - method: POST name: createcoupon description: Lago Create a coupon call: lago-coupons.createcoupon with: body: rest.body outputParameters: - type: object mapping: $. - method: GET name: findallcoupons description: Lago List all coupons call: lago-coupons.findallcoupons outputParameters: - type: object mapping: $. - path: /v1/coupons/{code} name: coupons-code description: REST surface for coupons-code. operations: - method: PUT name: updatecoupon description: Lago Update a coupon call: lago-coupons.updatecoupon with: body: rest.body outputParameters: - type: object mapping: $. - method: GET name: findcoupon description: Lago Retrieve a coupon call: lago-coupons.findcoupon outputParameters: - type: object mapping: $. - method: DELETE name: destroycoupon description: Lago Delete a coupon call: lago-coupons.destroycoupon outputParameters: - type: object mapping: $. - path: /v1/customers/{external-customer-id}/applied-coupons/{applied-coupon-id} name: customers-external-customer-id-applied-coupons-applied-coupon-id description: REST surface for customers-external_customer_id-applied_coupons-applied_coupon_id. operations: - method: DELETE name: deleteappliedcoupon description: Lago Delete an applied coupon call: lago-coupons.deleteappliedcoupon with: external_customer_id: rest.external_customer_id applied_coupon_id: rest.applied_coupon_id outputParameters: - type: object mapping: $. - type: mcp namespace: lago-coupons-mcp port: 9090 transport: http description: MCP adapter for Lago API documentation — Coupons. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: lago-apply-coupon-customer description: Lago Apply a coupon to a customer hints: readOnly: false destructive: false idempotent: false call: lago-coupons.applycoupon with: body: tools.body outputParameters: - type: object mapping: $. - name: lago-list-all-applied-coupons description: Lago List all applied coupons hints: readOnly: true destructive: false idempotent: true call: lago-coupons.findallappliedcoupons with: status: tools.status external_customer_id: tools.external_customer_id outputParameters: - type: object mapping: $. - name: lago-create-coupon description: Lago Create a coupon hints: readOnly: false destructive: false idempotent: false call: lago-coupons.createcoupon with: body: tools.body outputParameters: - type: object mapping: $. - name: lago-list-all-coupons description: Lago List all coupons hints: readOnly: true destructive: false idempotent: true call: lago-coupons.findallcoupons outputParameters: - type: object mapping: $. - name: lago-update-coupon description: Lago Update a coupon hints: readOnly: false destructive: false idempotent: true call: lago-coupons.updatecoupon with: body: tools.body outputParameters: - type: object mapping: $. - name: lago-retrieve-coupon description: Lago Retrieve a coupon hints: readOnly: true destructive: false idempotent: true call: lago-coupons.findcoupon outputParameters: - type: object mapping: $. - name: lago-delete-coupon description: Lago Delete a coupon hints: readOnly: false destructive: true idempotent: true call: lago-coupons.destroycoupon outputParameters: - type: object mapping: $. - name: lago-delete-applied-coupon description: Lago Delete an applied coupon hints: readOnly: false destructive: true idempotent: true call: lago-coupons.deleteappliedcoupon with: external_customer_id: tools.external_customer_id applied_coupon_id: tools.applied_coupon_id outputParameters: - type: object mapping: $.