curl https://clauhub.ai/api/rpc/books/issuance/issue \
-H "x-api-key: $CLAUHUB_API_KEY" \
-H "content-type: application/json" \
-d '{
"json": {
"organizationId": "ORGANIZATION_ID",
"fiscalEntityId": "FISCAL_ENTITY_ID",
"kind": "mx.cfdi",
"attemptId": "0b6f9c1e-6a2d-4f7e-9a51-2f0f6c8f3b10",
"capture": {
"invoiceType": "sale",
"voucherType": "I",
"paymentForm": "03",
"paymentMethod": "PUE",
"currency": "MXN",
"currencyDecimals": 2,
"exportation": "01",
"receiver": {
"rfc": "ICV060329BY0",
"name": "INMOBILIARIA CVA",
"receiverTaxPostalCode": "33826",
"receiverTaxRegime": "601",
"cfdiUsage": "G03"
},
"concepts": [
{
"productServiceCode": "81112100",
"quantity": "1",
"unitCode": "E48",
"description": "Suscripción mensual",
"unitPrice": "239.00",
"taxObject": "02",
"taxes": [
{
"type": "transfer",
"tax": "002",
"factorType": "Tasa",
"taxRate": "0.160000"
}
]
}
]
}
}
}'
const capture = {
"invoiceType": "sale",
"voucherType": "I",
"paymentForm": "03",
"paymentMethod": "PUE",
"currency": "MXN",
"currencyDecimals": 2,
"exportation": "01",
"receiver": {
"rfc": "ICV060329BY0",
"name": "INMOBILIARIA CVA",
"receiverTaxPostalCode": "33826",
"receiverTaxRegime": "601",
"cfdiUsage": "G03"
},
"concepts": [
{
"productServiceCode": "81112100",
"quantity": "1",
"unitCode": "E48",
"description": "Suscripción mensual",
"unitPrice": "239.00",
"taxObject": "02",
"taxes": [
{
"type": "transfer",
"tax": "002",
"factorType": "Tasa",
"taxRate": "0.160000"
}
]
}
]
};
const response = await fetch("https://clauhub.ai/api/rpc/books/issuance/issue", {
method: "POST",
headers: {
"x-api-key": process.env.CLAUHUB_API_KEY!,
"content-type": "application/json",
},
body: JSON.stringify({
json: {
organizationId: "ORGANIZATION_ID",
fiscalEntityId: "FISCAL_ENTITY_ID",
kind: "mx.cfdi",
attemptId: "0b6f9c1e-6a2d-4f7e-9a51-2f0f6c8f3b10",
capture,
},
}),
});
const { json: document } = await response.json();
document.state; // "queued"
{
"json": {
"id": "ISSUED_DOCUMENT_ID",
"kind": "mx.cfdi",
"state": "queued",
"status": "stamping",
"recipientTaxId": "ICV060329BY0",
"recipientName": "INMOBILIARIA CVA",
"total": "277.24",
"currency": "MXN",
"externalId": null,
"error": null,
"createdAt": "2026-10-25T17:04:12.000Z",
"stampedAt": null
},
"meta": [
[
"date",
"createdAt"
]
]
}