comecerodocs

Quote credit quantity

POST
/customers/{customer_id}/credit_purchase_quotes

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.

Path Parameters

customer_id*string

Resource identity owned by this account and mode.

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
subscription_id*string
credits*string

Exact invariant decimal string, at most six decimal places.

Match^(0|[1-9][0-9]*)(\.[0-9]{1,6})?$
replaces_invoice_id?string

Own unpaid unit purchase invoice. Replacement can be refused while payment reconciliation is incomplete.

Response Body

Success.

application/json
  1. response
quote_id?string
expires_at?string
Formatdate-time
agreement_id?string
credit_entitlement_id?string
unit_snapshot?
credits?string

Exact invariant decimal string, at most six decimal places.

Match^(0|[1-9][0-9]*)(\.[0-9]{1,6})?$
principal?string
tax?string
total?string
currency?string
purchase_input_amount?string
replaces_invoice_id?string|null
Example Request
curl -X POST 'https://api.comecero.com/api/v1/customers/string/credit_purchase_quotes' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "subscription_id": "SB0123456789",  "credits": "1000"}'
Example Response
{  "quote_id": "quote_compute_1",  "expires_at": "2026-11-26T12:05:00Z",  "agreement_id": "agr_cust_8412",  "credit_entitlement_id": "credit_cust_8412",  "unit_snapshot": {    "object": "credit_unit_rate",    "credit_unit_rate_id": "rate_compute_usd_1",    "credit_unit_id": "unit_compute",    "account_id": "AB1234",    "test": true,    "currency": "USD",    "version": 1,    "money_per_credit": "0.01",    "credits_per_money": "100",    "singular_label": "credit",    "plural_label": "credits",    "date_published": "2026-11-02T00:00:00Z"  },  "credits": "1000",  "principal": "10",  "tax": "2",  "total": "12",  "currency": "USD",  "purchase_input_amount": "12",  "replaces_invoice_id": null}