openapi: 3.1.0 info: title: CNaught API version: '2026-10-09' description: 'GENERATED FROM DOCUMENTATION by API Evangelist on 2026-10-09: 7 operation(s) read from 11 public documentation page(s) (each operation names its page in x-source). This is not the provider''s published contract; CNaught has published no machine-readable contract that the pipeline could find. Engine: local.' x-evidence-tiers: code-example: 11 documentation: -4 pages-with-code: 11 pages-read: 11 x-generated-from: documentation x-provenance: generated x-authored-by: API Evangelist x-generated: '2026-10-09' x-generator: generate-contract-from-docs.py x-engine: local x-sources: - https://docs.cnaught.com/api-reference/orders/cancel-order.md - https://docs.cnaught.com/api-reference/orders/get-order-by-id.md - https://docs.cnaught.com/api-reference/orders/get-list-of-orders.md - https://docs.cnaught.com/api-reference/projects/get-project-by-id.md - https://docs.cnaught.com/api-reference/subaccounts/create-subaccount.md - https://docs.cnaught.com/api-reference/subaccounts/delete-subaccount.md - https://docs.cnaught.com/api-reference/subaccounts/update-subaccount.md - https://docs.cnaught.com/api-reference/portfolios/get-portfolio-by-id.md - https://docs.cnaught.com/api-reference/subaccounts/get-subaccount-by-id.md - https://docs.cnaught.com/api-reference/portfolios/get-list-of-portfolios.md - https://docs.cnaught.com/api-reference/orders/create-carbon-credits-order.md servers: - url: https://api.cnaught.com paths: /v1/orders/{id}: post: operationId: post_v1_orders_id tags: - Orders summary: POST /v1/orders/{id} x-source: https://docs.cnaught.com/api-reference/orders/cancel-order.md parameters: - name: id in: path required: true schema: type: string responses: '201': description: Success (shape read from the example response on the page) content: application/json: schema: $ref: '#/components/schemas/PostV1OrdersIdResponse' x-evidence: kind: code-example language: curl snippet: 'curl --request POST --url https://api.cnaught.com/v1/orders//cancel --header ''Authorization: Bearer '' ```' /v1/orders/{id}/cancel: post: operationId: post_v1_orders_id_cancel tags: - Orders summary: Cancel Order description: When cancelling an order that has been fulfilled, a credit for the price of the order will be applied to the current invoice. This means that it is possible for the credit for a cancellation to appear on the invoice of the following billing period. x-source: https://docs.cnaught.com/api-reference/orders/cancel-order.md parameters: - name: id in: path required: true schema: type: string - name: X-Subaccount-Id in: header required: false schema: type: string description: If present, will only cancel the order if it belongs to the subaccount with given id. - name: Idempotency-Key in: header required: false schema: type: string description: If present, a unique identifier that allows you to retry a request multiple times while only performing the action once. - name: Authorization in: header required: true schema: type: string description: Bearer token for CNaught API key responses: '201': description: Success (status as documented) content: application/json: schema: $ref: '#/components/schemas/PostV1OrdersIdCancelResponse' x-evidence: kind: documentation /v1/subaccounts/{id}: delete: operationId: delete_v1_subaccounts_id tags: - Subaccounts summary: DELETE /v1/subaccounts/{id} x-source: https://docs.cnaught.com/api-reference/subaccounts/delete-subaccount.md parameters: - name: id in: path required: true schema: type: string responses: '200': description: Success (shape read from the example response on the page) content: application/json: schema: $ref: '#/components/schemas/DeleteV1SubaccountsIdResponse' x-evidence: kind: code-example language: curl snippet: 'curl --request DELETE --url https://api.cnaught.com/v1/subaccounts/ --header ''Authorization: Bearer '' ```' put: operationId: put_v1_subaccounts_id tags: - Subaccounts summary: PUT /v1/subaccounts/{id} x-source: https://docs.cnaught.com/api-reference/subaccounts/update-subaccount.md parameters: - name: id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PutV1SubaccountsIdRequest' responses: '200': description: Success (status as documented) x-evidence: kind: code-example language: curl snippet: "curl --request PUT --url https://api.cnaught.com/v1/subaccounts/ --header 'Authorization: Bearer ' --header 'Content-Type:\ \ application/json' --data '{\n \"name\": \"Operations Department\",\n \"email\": \"jane.doe@example.com\",\n \"default_portfolio_id\"\ : \"eWvNvC12\"\n}'\n```" /v1/{v1id}: get: operationId: get_v1_v1id tags: - Api summary: GET /v1/orders x-source: https://docs.cnaught.com/api-reference/orders/get-list-of-orders.md parameters: - name: v1id in: path required: true schema: type: string responses: '200': description: Success (shape read from the example response on the page) content: application/json: schema: $ref: '#/components/schemas/GetV1V1IdResponse' x-evidence: kind: code-example language: curl snippet: 'curl --request GET --url https://api.cnaught.com/v1/orders --header ''Authorization: Bearer '' ```' collapsed_from: 2 example path(s) differing only at v1Id post: operationId: post_v1_v1id tags: - Api summary: POST /v1/orders x-source: https://docs.cnaught.com/api-reference/orders/create-carbon-credits-order.md parameters: - name: v1id in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PostV1V1IdRequest' responses: '201': description: Success (status as documented) x-evidence: kind: code-example language: curl snippet: "curl --request POST --url https://api.cnaught.com/v1/orders --header 'Authorization: Bearer ' --header 'Content-Type:\ \ application/json' --data '{\n \"metadata\": \"example metadata\",\n \"description\": \"On behalf of Jane Smith\",\n \"amount_kg\"\ : 100.5,\n \"notification_config\": {\n \"url\": \"https://www.example.com/callback\"\n }\n}'\n```" collapsed_from: 2 example path(s) differing only at v1Id /v1/{v1id}/{id}: get: operationId: get_v1_v1id_id tags: - Api summary: GET /v1/orders/{id} x-source: https://docs.cnaught.com/api-reference/orders/get-order-by-id.md parameters: - name: v1id in: path required: true schema: type: string - name: id in: path required: true schema: type: string responses: '200': description: Success (shape read from the example response on the page) content: application/json: schema: $ref: '#/components/schemas/GetV1V1IdIdResponse' x-evidence: kind: code-example language: curl snippet: 'curl --request GET --url https://api.cnaught.com/v1/orders/ --header ''Authorization: Bearer '' ```' collapsed_from: 4 example path(s) differing only at v1Id components: schemas: PostV1OrdersIdResponse: type: object properties: method: type: string headers: type: object properties: Authorization: type: string PostV1OrdersIdCancelResponse: type: object properties: '200': type: string description: Order Details '401': type: string description: Request Unauthorized '403': type: string description: Forbidden Due to Order Already Cancelled '404': type: string description: Order Not Found '409': type: string description: Concurrent Requests with Same Idempotency Key '422': type: string description: Mismatched Requests with Same Idempotency Key DeleteV1SubaccountsIdResponse: type: object properties: method: type: string headers: type: object properties: Authorization: type: string PutV1SubaccountsIdRequest: type: object properties: name: type: string email: type: string default_portfolio_id: type: string GetV1V1IdResponse: type: object properties: method: type: string headers: type: object properties: Authorization: type: string PostV1V1IdRequest: type: object properties: metadata: type: string description: type: string amount_kg: type: number notification_config: type: object properties: url: type: string GetV1V1IdIdResponse: type: object properties: method: type: string headers: type: object properties: Authorization: type: string securitySchemes: bearer: type: http scheme: bearer security: - bearer: [] tags: - name: Api - name: Orders - name: Subaccounts