naftiko: 1.0.0-alpha2 info: label: Commerce Layer Metrics API — Returns description: 'Analytics queries for returns.' tags: - Commerce Layer created: '2026-05-25' modified: '2026-05-25' binds: - namespace: env keys: COMMERCE_LAYER_ACCESS_TOKEN: COMMERCE_LAYER_ACCESS_TOKEN COMMERCE_LAYER_ORG_SLUG: COMMERCE_LAYER_ORG_SLUG capability: consumes: - type: http namespace: metrics-returns baseUri: https://{{env.COMMERCE_LAYER_ORG_SLUG}}.commercelayer.io/metrics description: Commerce Layer Metrics API — Returns business surface. resources: - name: returns-breakdown path: /returns/breakdown operations: - name: returnsbreakdown method: POST description: Run A Returns Breakdown Query outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object required: true - name: returns-date_breakdown path: /returns/date_breakdown operations: - name: returnsdatebreakdown method: POST description: Run A Returns Date-Breakdown Query outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object required: true - name: returns-stats path: /returns/stats operations: - name: returnsstats method: POST description: Run A Returns Stats Query outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object required: true - name: returns-search path: /returns/search operations: - name: returnssearch method: POST description: Run A Returns Search Query outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object required: true - name: returns-export path: /returns/export operations: - name: returnsexport method: POST description: Run A Returns Export Query outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object required: true authentication: type: oauth2 flow: client_credentials tokenUrl: https://auth.commercelayer.io/oauth/token value: 'Bearer {{env.COMMERCE_LAYER_ACCESS_TOKEN}}' placement: header key: Authorization exposes: - type: rest namespace: metrics-returns-rest port: 8080 description: REST adapter for Commerce Layer Metrics API — Returns. resources: - path: /api/returns/breakdown name: returns-breakdown operations: - method: POST name: returnsbreakdown call: metrics-returns.returnsbreakdown with: body: rest.body outputParameters: - type: object mapping: $. - path: /api/returns/date_breakdown name: returns-date-breakdown operations: - method: POST name: returnsdatebreakdown call: metrics-returns.returnsdatebreakdown with: body: rest.body outputParameters: - type: object mapping: $. - path: /api/returns/stats name: returns-stats operations: - method: POST name: returnsstats call: metrics-returns.returnsstats with: body: rest.body outputParameters: - type: object mapping: $. - path: /api/returns/search name: returns-search operations: - method: POST name: returnssearch call: metrics-returns.returnssearch with: body: rest.body outputParameters: - type: object mapping: $. - path: /api/returns/export name: returns-export operations: - method: POST name: returnsexport call: metrics-returns.returnsexport with: body: rest.body outputParameters: - type: object mapping: $. - type: mcp namespace: metrics-returns-mcp port: 9090 transport: http description: MCP adapter for Commerce Layer Metrics API — Returns. tools: - name: commerce-layer-returnsbreakdown description: Run A Returns Breakdown Query hints: readOnly: false idempotent: false destructive: false call: metrics-returns.returnsbreakdown with: body: tools.body outputParameters: - type: object mapping: $. - name: commerce-layer-returnsdatebreakdown description: Run A Returns Date-Breakdown Query hints: readOnly: false idempotent: false destructive: false call: metrics-returns.returnsdatebreakdown with: body: tools.body outputParameters: - type: object mapping: $. - name: commerce-layer-returnsstats description: Run A Returns Stats Query hints: readOnly: false idempotent: false destructive: false call: metrics-returns.returnsstats with: body: tools.body outputParameters: - type: object mapping: $. - name: commerce-layer-returnssearch description: Run A Returns Search Query hints: readOnly: false idempotent: false destructive: false call: metrics-returns.returnssearch with: body: tools.body outputParameters: - type: object mapping: $. - name: commerce-layer-returnsexport description: Run A Returns Export Query hints: readOnly: false idempotent: false destructive: false call: metrics-returns.returnsexport with: body: tools.body outputParameters: - type: object mapping: $.