Download OpenAPI specification:
On this page, we list all available methods in the Heru B2B API, as well as the complete reference of parameters that each one accepts. To view nested properties of an object or array of objects, you can click on the field name and expand it.
The Heru API is designed with the REST standard in mind. API endpoints are grouped by resources, have predictable URLs, responses are in JSON format, and we use standard HTTP response codes, authentication, and verbs.
During development, you can use the Heru API in Sandbox environment and the invoices you issue will not be sent to SAT nor will they have fiscal validity.
The secret key you use to authenticate will determine both the environment in which the invoice will be created (Sandbox or Production), as well as the organization to use as the issuer of your invoice, or as the owner of the resource you request to create.
Generates a new CFDI electronic invoice with the provided issuer, receiver, and line items data.
| type required | string Value: "I" Fiscal receipt type (I=Income). |
object (Issuer) Invoice issuer information. | |
required | object (Receiver) Invoice receiver information. |
object (ThirdParty) Third-party information (optional, for accounts payable to third parties). | |
required | Array of objects (InvoiceItem) non-empty List of line items included in the invoice (all fields required). |
| periodicity | string Periodicity key according to SAT catalog (required only in global invoices). |
| months | string^(0[1-9]|1[0-2])$ Month(s) covered by the invoice (required only in global invoices). |
| year | string^\d{4}$ Year of the invoice (required only in global invoices). |
| payment_method required | string Enum: "PUE" "PPD" Payment method according to SAT catalog (PUE=One-time payment, PPD=Partial or deferred payment). |
| payment_form required | string Payment form according to SAT catalog (99=To be defined). |
| cfdi_use required | string Default: "G03" CFDI use key according to SAT catalog (default G03, use S01 for global invoices). |
| vat_rate required | string^0\.\d{2}$ Transferred VAT rate. |
object Custom additional information (optional). |
Invoice where the partner is the issuer and invoices a specific receiver.
{- "type": "I",
- "issuer": {
- "rfc": "XAXX010101000"
}, - "receiver": {
- "rfc": "MOAC331119BD1",
- "name": "Juan Salas",
- "email": "juan_salas@correo.com",
- "tax_regime": "625",
- "zip_code": "12000"
}, - "items": [
- {
- "description": "Consulting service",
- "quantity": 1,
- "unit_code": "E48",
- "unit_price": 100,
- "product_code": "84111506",
- "tax_object": "02"
}
], - "payment_method": "PUE",
- "payment_form": "99",
- "cfdi_use": "G03",
- "vat_rate": "0.16",
- "metadata": {
- "skid": "123e4567-e89b-12d3-a456-426614174000"
}
}{- "message": "Request created successfully",
- "data": {
- "request_id": "12345678-1234-1234-1234-123456789012"
}
}Cancels an existing CFDI electronic invoice using its fiscal UUID.
| invoice_uuid required | string <uuid> Fiscal UUID of the invoice to cancel. |
Request to cancel an existing invoice by its UUID.
{- "invoice_uuid": "12345678-e89b-12d3-a456-426614174000"
}{- "message": "Request created successfully",
- "data": {
- "request_id": "12345678-1234-1234-1234-123456789012"
}
}Retrieves the details and status of an invoice using its fiscal UUID or requestId.
| uuid | string <uuid> Example: uuid=12345678-1234-1234-1234-123456789012 Fiscal UUID of the invoice. |
| request_id | string <uuid> Example: request_id=e4567890-e89b-12d3-a456-426614174000 Invoice request ID. |
Detail of an invoice that was issued correctly.
{- "request_id": "e4567890-e89b-12d3-a456-426614174000",
- "uuid": "12345678-1234-1234-1234-123456789012",
- "datetime": "2025-10-23T14:30:00Z",
- "message": "Invoice Issued",
- "status": "ISSUED"
}Creates a new Retention (Retención). If the document is created in Live environment, it will be stamped and sent to SAT.
required | object |
required | object |
required | object |
| withholding_description required | string Description of the retention. |
Example of a certification request with all required fields.
{- "receiver": {
- "rfc": "MOAC331119BD1",
- "name": "usuario",
- "email": "usuario@correo.com",
- "tax_regime": "625",
- "zip_code": "12000"
}, - "period": {
- "start_date": "01",
- "end_date": "08",
- "fiscal_year": "2025"
}, - "totals": {
- "total_operation_amount": 10000,
- "total_taxable_amount": 10000,
- "total_tax_exempt_amount": 0,
- "total_withheld_amount": 1000,
- "withheld_taxes": [
- {
- "withholding_base": 10000,
- "tax": "VAT",
- "withheld_amount": 1000,
- "withholding_payment_type": 1
}
]
}, - "withholding_description": "Monthly retention for professional services"
}{- "message": "Request created successfully",
- "data": {
- "request_id": "12345678-1234-1234-1234-123456789012"
}
}Retrieves the details of a specific certification using the certification_id or request_id.
| certification_id | string <uuid> Certification UUID |
| request_id | string <uuid> Request ID UUID |
{- "request_id": "e4567890-e89b-12d3-a456-426614174000",
- "uuid": "12345678-1234-1234-1234-123456789012",
- "datetime": "2025-10-23T14:30:00Z",
- "message": "Certification Issued",
- "status": "ISSUED"
}Initiates the NSS validation process (Social Security Number). If a CURP does not have an NSS and the is_register_candidate parameter is true, Heru will automatically initiate the registration process (IMSS Registration) on behalf of the citizen.
Important note: The process is asynchronous. Results will be sent to your registered webhook.
| national_id required | string (CURP) ^[A-Z]{4}\d{6}[HM][A-Z]{5}[0-9A-Z]\d$ Unique Population Registry Code (CURP) of 18 characters |
| internal_partner_id required | string Partner's internal identifier for the user |
| is_register_candidate required | boolean Default: false If true and there is no NSS, the registration process will start automatically |
object Partner's address (required if is_register_candidate is true) |
NSS validation request without authorization for automatic registration
{- "national_id": "CAME900425HNLRRD03",
- "internal_partner_id": "12345",
- "is_register_candidate": false
}{- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "status": "received",
- "message": "Request successfully accepted for processing",
- "created_at": "2024-03-15T10:30:00-06:00"
}Retrieves the status and result of a specific validation using the request_id or the national_id.
| request_id | string <uuid> Validation request ID |
| national_id | string^[A-Z]{4}\d{6}[HM][A-Z]{5}[0-9A-Z]\d$ Citizen's CURP |
Citizen with a valid NSS that was successfully validated
{- "request_data": {
- "request_id": "0000000-58cc-4372-a567-0e02b2c3d479",
- "national_id": "CAME900425HNLRRD03",
- "internal_partner_id": "559439",
- "is_register_candidate": false,
- "created_at": "2024-03-15T10:30:00-06:00",
- "updated_at": "2024-03-15T10:31:23-06:00",
- "posted_at": "2024-03-15T10:31:25-06:00"
}, - "response_body": {
- "status": "completed",
- "complementary_code": "001",
- "processing_message": "NSS and related information successfully fetched",
- "national_id": "CAME900425HNLRRD03",
- "name": "EDGAR ALAN CARDONA MORENO",
- "father_surname": "CARDONA",
- "last_name": "MORENO",
- "gender": "Male",
- "age": 34,
- "dob": "25/04/1990",
- "social_security_number": "72088408157",
- "birth_place": "NUEVO LEON",
}
}Retrieves all validation requests with pagination and optional filters.
| page | integer >= 1 Default: 1 Page number |
| pageSize | integer [ 1 .. 100 ] Default: 50 Items per page |
| status | string Enum: "processing" "completed" "retrying" "failed" Filter by status |
| complementary_code | string Enum: "001" "002" "003" "004" Filter by complementary code |
| from_date | string <date-time> Start date (ISO8601) |
| to_date | string <date-time> End date (ISO8601) |
{- "page": 0,
- "pageSize": 0,
- "totalItems": 0,
- "totalPages": 0,
- "items": [
- {
- "request_data": {
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "national_id": "ROHM800825HDFDGR09",
- "internal_partner_id": "string",
- "is_register_candidate": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "posted_at": "2019-08-24T14:15:22Z"
}, - "response_body": {
- "status": "processing",
- "complementary_code": "001",
- "processing_message": "string",
- "national_id": "ROHM800825HDFDGR09",
- "name": "string",
- "father_surname": "string",
- "last_name": "string",
- "gender": "string",
- "age": 0,
- "dob": "string",
- "social_security_number": "string",
- "birth_place": "string",
- "ssn_proof_doc_url": "string",
- "ssn_card_doc_url": "string"
}
}
]
}Initiates a new fiscal validation process for a taxpayer. Validates tax data, digital certificates, and third-party invoicing eligibility.
Important note: The process is asynchronous. Results will be sent to your registered webhook.
Recommendation: Whenever possible, send the national_id (CURP) to guarantee a 97% success rate in information gathering.
| partner required | string Partner identifier (e.g., "tpc") |
| national_id | string (CURP) ^[A-Z]{4}\d{6}[HM][A-Z]{5}[0-9A-Z]\d$ Unique Population Registry Code (CURP) of 18 characters |
| internal_partner_id required | string Partner's internal identifier |
| tax_id | string (RFC) ^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{2,3}$ Federal Taxpayer Registry (RFC) of 12 or 13 characters. |
Fiscal validation request using CURP (recommended)
{- "national_id": "ROHM800825HDFDGR09",
- "internal_partner_id": "12345",
- "tax_id": ""
}{- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "status": "received",
- "message": "Request successfully accepted for processing",
- "created_at": "2019-08-24T14:15:22Z"
}Retrieves the result of a specific full fiscal validation.
| partner required | string Partner identifier |
| national_id | string Taxpayer's CURP |
| internal_partner_id | string Partner's internal ID |
| tax_id | string Taxpayer's RFC |
| request_id | string <uuid> Request ID |
Fiscal validation completed with all data
{- "request_data": {
- "request_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
- "national_id": "CAME900425HNLRRD03",
- "internal_partner_id": "559439",
- "status": "completed",
- "created_at": "2024-03-15T10:30:00-06:00",
- "updated_at": "2024-03-15T10:31:23-06:00",
- "posted_at": "2024-03-15T10:31:25-06:00",
- "processing_message": ""
}, - "response_body": {
- "rfc": "CAME900425EA3",
- "national_id": "CAME900425HNLRRD03",
- "name": "EDGAR ALAN CARDONA MORENO",
- "first_name": "EDGAR",
- "middle_name": "ALAN",
- "father_surname": "CARDONA",
- "last_name": "MORENO",
- "zip_code": "66612",
- "regimes": [
- "601"
], - "rfc_valid": true,
- "rfc_active": true,
- "fiel_active": true,
- "fiel_valid_from": "2023-01-15T00:00:00-06:00",
- "fiel_valid_to": "2027-01-15T00:00:00-06:00",
- "csd_active": true,
- "csd_valid_from": "2023-01-15T00:00:00-06:00",
- "csd_valid_to": "2027-01-15T00:00:00-06:00",
- "fc3_eligible": true,
- "fc3_eligibility_response": "Partner meets all requirements for third-party invoicing"
}
}Retrieves all fiscal validations with pagination and filters.
| partner required | string Partner identifier |
| page | integer Default: 1 |
| limit | integer <= 100 Default: 50 |
| status | string Enum: "received" "processing" "completed" "partially_completed" "failed" |
| from_date | string <date-time> |
| to_date | string <date-time> |
{- "total": 0,
- "page": 0,
- "limit": 0,
- "results": [
- {
- "request_data": {
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "national_id": "string",
- "internal_partner_id": "string",
- "status": "received",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "posted_at": "2019-08-24T14:15:22Z",
- "processing_message": "string"
}, - "response_body": {
- "rfc": "string",
- "national_id": "string",
- "name": "string",
- "first_name": "string",
- "middle_name": "string",
- "father_surname": "string",
- "last_name": "string",
- "zip_code": "string",
- "regimes": [
- "string"
], - "validation_url": "string",
- "rfc_valid": true,
- "rfc_active": true,
- "fiel_active": true,
- "fiel_valid_from": "2019-08-24T14:15:22Z",
- "fiel_valid_to": "2019-08-24T14:15:22Z",
- "csd_active": true,
- "csd_valid_from": "2019-08-24T14:15:22Z",
- "csd_valid_to": "2019-08-24T14:15:22Z",
- "fc3_eligible": true,
- "fc3_eligibility_response": "string"
}
}
]
}Validates an RFC against the SAT registry. Verifies if the RFC exists, is active, and is on the Required Taxpayers List (LCO).
Information returned:
| rfc required | string (RFC) ^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{2,3}$ Example: XAXX010101000 RFC to validate (12 or 13 characters) |
| partner_id | integer Default: 3 Partner ID (optional, default 3) |
RFC exists and is active in SAT
{- "lco": true,
- "status": true,
- "error": false
}Validates taxpayer fiscal data for CFDI 4.0 issuance. Verifies RFC, name, postal code, tax regime, and CFDI use against tax authorities.
Validations performed:
Note: If validacionFC3 is true, an asynchronous advanced validation process will be initiated for third-party invoicing.
| rfc required | string (RFC) ^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{2,3}$ Example: rfc=XAXX010101000 RFC to validate (12 or 13 characters) |
| firstName required | string Example: firstName=Juan Taxpayer's first name(s) |
| lastName required | string Example: lastName=Pérez López Taxpayer's last name(s) |
| domicilioFiscal required | string^\d{5}$ Example: domicilioFiscal=12000 Tax address postal code (5 digits) |
| regimenFiscal | string Example: regimenFiscal=625 Tax regime code (optional) |
| usoCfdi | string Example: usoCfdi=G03 CFDI use code (optional) |
string <email> Example: email=juan@example.com Taxpayer's email (optional) | |
| cellphone | string^\d{10}$ Example: cellphone=5512345678 10-digit cell phone number (optional) |
| validacionFC3 | string Default: "false" Enum: "true" "false" Whether advanced FC3 validation should be performed |
All fields are correct
{- "rfc": "XAXX010101000",
- "name": "JUAN PÉREZ LÓPEZ",
- "tax_address": "12000",
- "tax_regime": "625",
- "cfdi_use": "G03",
- "code": "000",
- "code_meaning": "All fields are correct",
- "description": null,
- "fc3_validation": false,
- "message": "It is valid."
}It allows you to consult and verify the existence, status and validity of the digital certificates of e.firma and Digital Seal Certificate (CSD) linked to the RFC consulted, according to the information available in official or authorized access sources.
Note: The process is asynchronous. Results will be sent to your registered webhook.
| rfc required | string (RFC) ^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{2,3}$ Example: rfc=XAXX010101000 RFC to validate (12 or 13 characters) |
{- "message": "RFC has been sent for validation processing"
}