This documentation provides a comprehensive guide on how to purchase carbon credits and offset emissions seamlessly using the c-mass API.

Welcome to the c-mass API

The c-mass API enables businesses to easily integrate carbon credit purchases into their operations, covering various activities such as transportation, logistics, and more.

API Endpoint

The base URL for this API version is: https://carbon-engine.onrender.com/v1

All endpoints referenced in this documentation are relative to this base URL.


Authentication

To access the API, clients must authenticate using their c-mass API Key by including it in the Authorization header.

  • If an invalid API key is provided, the API will return a 401 Unauthorized error.
  • Use the test API key for test requests and the live API key for production requests.

Test Mode

c-mass offers a Test Mode that allows users to explore API functionalities without incurring charges or purchasing real carbon credits.

  • Toggle Test Mode via the web dashboard.
  • The same API endpoints are used for both test and live modes, but a test API key must be provided.
  • API keys (both test and live) can be generated from the Devs page.

Rate Limiting

To maintain system stability, c-mass API enforces rate limits:

  • 100 write operations per second
  • 100 read operations per second
  • Requests exceeding these limits will return a 429 Too Many Requests response.

Recommendation: Implement a retry mechanism with exponential backoff to handle rate limits efficiently.


Error Handling

The c-mass API uses standard HTTP status codes to indicate the success or failure of a request.

Status CodeErrorDescription
400Bad RequestThe request parameters are invalid.
401UnauthorizedAPI key is missing or invalid.
403ForbiddenAction is not permitted.
409ConflictIdempotency conflict detected.
422Unprocessable EntityIdempotency key used with a different payload.
429Too Many RequestsAPI rate limit exceeded.
503Service UnavailableTemporary server issue, retry the request later.

For more details, refer to the specific API endpoint documentation.