➕ Create new documents
Postman collection
To help you with your integration, download our Postman Collection here: https://github.com/koyweforest/api-billing-postman
IMPORTANT: SAT requires legal_name, activity, postal code and RFC to do an exact match
When generating an invoice, you have the choice of using the generic RFC
- XAXX010101000 for nationals who only have CURP but no RFC
- XEXX010101000 for foreign companies or individuals
if you use a different RFC, then you will need to make sure you have an EXACT match of the legal_name, postal code and activity (régimen fiscal). If any those don’t make an exact match, you will receive a message on the response with the SAT validation and the document won’t be issued. (note that SAT messages are in spanish)
To help with testing, you can use the following information when issuing documents
Legal names MUST NOT include the organization type (example: SAIC).
You can validate the data here: https://agsc.siat.sat.gob.mx/PTSC/ValidaRFC/index.jsf (works ONLY from Mexico, blocked by the SAT from other countries).
product_service_identifier and measure_unit_code
Mexico requires detail lines to be properly identified for tax purposes. If omitted, default values will be used.
List of product/service identifiers: http://pys.sat.gob.mx/PyS/catPyS.aspx List of measure unit codes: http://pys.sat.gob.mx/PyS/catUnidades.aspx
Invoice
In order to create a new mexican invoice, you need to use the /documents endpoint with the proper parameters.
Mexican invoices can be type I, E or T. To define which type to use, please check the document_type_id field proper values.
Invoice I (Factura I - Factura Ingreso)
- Endpoint: https://api-billing.koywe.com/V1/documents
- Method: POST
- Required headers:
- Content-Type: application/json
- Authorization: Bearer <token>
- Accept: */*
Invoice E (Factura E - Factura Egreso)
- Endpoint: https://api-billing.koywe.com/V1/documents
- Method: POST
- Required headers:
- Content-Type: application/json
- Authorization: Bearer <token>
- Accept: */*
Invoice T (Factura T - Factura Traslado)
- Endpoint: https://api-billing.koywe.com/V1/documents
- Method: POST
- Required headers:
- Content-Type: application/json
- Authorization: Bearer <token>
- Accept: */*
Invoice T with bill of lading complement (Factura T con Complemento de Carta Porte)
In order to create a new mexican invoice with bill of lading complement, you need to use the /documents endpoint with the proper parameters.
- Endpoint: https://api-billing.koywe.com/V1/documents
- Method: POST
- Required headers:
- Content-Type: application/json
- Authorization: Bearer <token>
- Accept: */*
Invoice I with exports complement (Factura I con Complemento de Exportación)
In order to create a new mexican invoice with international commerce complement, you need to use the /documents endpoint with the proper parameters.
- Endpoint: https://api-billing.koywe.com/V1/documents
- Method: POST
- Required headers:
- Content-Type: application/json
- Authorization: Bearer <token>
- Accept: */*
Invoice I Foreigner without RFC (Factura I - Factura Ingreso Extranjero sin RFC)
- Endpoint: https://api-billing.koywe.com/V1/documents
- Method: POST
- Required headers:
- Content-Type: application/json
- Authorization: Bearer <token>
- Accept: */*
Invoice I National without RFC (Factura I - Factura Ingreso Nacional sin RFC)
- Endpoint: https://api-billing.koywe.com/V1/documents
- Method: POST
- Required headers:
- Content-Type: application/json
- Authorization: Bearer <token>
- Accept: */*
Invoice I with VAT and IEPS taxes (Factura I - Factura Ingreso con IVA y IEPS)
- Endpoint: https://api-billing.koywe.com/V1/documents
- Method: POST
- Required headers:
- Content-Type: application/json
- Authorization: Bearer <token>
- Accept: */*