heruAPI
e.firma and CSD

Request the worker's CSD

BuildingIn development for the v1 API. The contract is set; the route is not served yet.

POST
/workers/{id}/csd

Requests the worker's Certificado de Sello Digital from the SAT using their e.firma, so they can issue invoices directly. Needs consent and an active e.firma. Asynchronous; worker.updated fires when it is ready. Never call it twice for the same worker: the SAT issues a new certificate each time.

Needs the workers:csd scope.

Authorization

oauth2 workers:csd
headerAuthorizationBearer <token>

OAuth 2.0 client credentials. Exchange your client_id and client_secret at /oauth/token of the environment for a bearer token valid for one hour. The playground of every operation asks for your own client and keeps it in your browser tab only.

Scope: workers:csd

Path parameters

id*string

The worker id.

Match^wrk_[0-7][0-9a-hjkmnp-tv-z]{25}$

Header parameters

Idempotency-Key*string

Unique per operation. Retrying with the same key returns the original result for 24 hours.

Lengthlength <= 255

Response body

Accepted

application/json
  1. response
id*string
Match^wrk_[0-7][0-9a-hjkmnp-tv-z]{25}$
external_id*string

Your own id for this person, merchant or record. Echoed back in every response and webhook.

Lengthlength <= 128
status*string

pending until the worker completes the enrollment page; in_progress while heru validates them with the SAT or requests their CSD; ready when every service you enabled is in order; blocked when the worker has something to do, listed in open_actions; not_evaluated when the worker has no service that heru checks; removed after DELETE /workers/{id}.

Value in"ready""pending""in_progress""blocked""not_evaluated""removed"
curp*string

CURP, 18 characters.

Match^[A-Z]{4}[0-9]{6}[HM][A-Z]{5}[A-Z0-9][0-9]$
rfc?|null
name?|

Name as registered with the SAT, once heru validated the worker.

postal_code?|

Postal code of the tax address.

regimes?array<>
services*array<>

The services you enabled for the worker. ready means all of them are in order.

efirma*
csd*
open_actions*array<>

What the worker must do before they are ready: give_consent and upload_efirma on the enrollment page; renew_efirma when their e.firma expired; confirm_regime when their tax regime does not allow the services you enabled; update_postal_code when their tax address changed with the SAT. Empty when there is nothing to do.

enrollment*
consent_at?|

When the worker accepted heru's terms and privacy notice on the enrollment page. Null until then.

compliant_at?|

When the worker last became ready. Null if they have never been.

created_at*string

When you registered the worker.

Formatdate-time
updated_at*string

Last change of any field. Use it with updated_since in the workers feed.

Formatdate-time
removed_at?|

When you removed the worker. Null while active.

curl -X POST 'https://api.dev.b2b.heru.app/v1/workers/wrk_01m4rg5d0pf4w1z6f9r2g8x7mt/csd' \  -H 'Idempotency-Key: try-it-0001'
{  "id": "wrk_01m4ra8w0he5esnnsew0v9ffkv",  "external_id": "DRV-000088213",  "status": "in_progress",  "curp": "HEGL900101HDFRRS06",  "rfc": "HEGL900101K44",  "name": "JOSE LUIS HERNANDEZ GARCIA",  "postal_code": "06600",  "regimes": [    {      "code": "625",      "description": "Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas"    }  ],  "services": [    "fiscal_validation",    "efirma",    "invoicing"  ],  "efirma": {    "active": true,    "valid_from": "2024-03-02",    "valid_to": "2028-03-02"  },  "csd": {    "active": false,    "valid_from": null,    "valid_to": null  },  "open_actions": [],  "enrollment": {    "status": "completed",    "url": null,    "expires_at": null,    "completed_at": "2026-10-09T14:29:40.118Z"  },  "consent_at": "2026-10-09T14:29:40.118Z",  "compliant_at": null,  "created_at": "2026-10-09T14:22:51.604Z",  "updated_at": "2026-10-09T14:33:12.507Z",  "removed_at": null}
© 2026 Kuarto Inc. (heru)heru.appQuestions about your integration? Contact your heru account team.