comecerodocs

Save credit unit

POST
/usage/credit_unit

Revision checked credit operation. Secret and trusted tokens require the applicable resource permission. New writes require header idempotency. Immutable rates do not reprice existing agreements. Core validates exact conversion, current funding, prepared work and protected billing boundaries.

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Header Parameters

Idempotency-Key*string

Same key and canonical body replay the saved result. A different body returns CreditRequestConflict; pending work returns CreditRequestPending.

Match^[ -~]+$
Length1 <= length <= 128

Request Body

application/json
  1. body
expected_revision*integer
Range0 <= value
name*string
Length1 <= length <= 100
singular_label*string
Length1 <= length <= 96
plural_label*string
Length1 <= length <= 96

Response Body

Success.

application/json
  1. response
object?unknown
credit_unit_id?string

Stable unit identity.

name?string

Unit name.

Lengthlength <= 100
singular_label?string

Singular display label.

Lengthlength <= 96
plural_label?string

Plural display label.

Lengthlength <= 96
revision?integer
Range0 <= value
date_created?string
Formatdate-time
date_modified?string
Formatdate-time
account_id?string
test?boolean
Example Request
curl -X POST 'https://api.comecero.com/api/v1/usage/credit_unit' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "expected_revision": 0,  "name": "Compute",  "singular_label": "credit",  "plural_label": "credits"}'
Example Response
{  "object": "credit_unit",  "credit_unit_id": "unit_compute",  "account_id": "AB1234",  "test": true,  "name": "Compute",  "singular_label": "credit",  "plural_label": "credits",  "revision": 2,  "date_created": "2026-11-01T00:00:00Z",  "date_modified": "2026-11-02T00:00:00Z"}