Emitir documento
Crea y envía un documento tributario electrónico (factura, boleta, nota de crédito/débito, etc.) de forma asíncrona
curl --request POST \
--url https://api.emify.co/api/companies/{company_id}/invoices \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"branch_office": 0,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"recipient": {
"legal_name": "<string>",
"document_type": "<string>",
"document_number": "<string>",
"internal_code": "<string>",
"address": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"phone": "<string>"
},
"tax_information": {
"tax_condition": "<string>",
"start_activities_date": "2023-12-25",
"activity": "<string>",
"activity_codes": [
123
],
"resolution_date": "<string>",
"resolution_number": "<string>"
}
},
"currency": {
"code": "<string>",
"exchange_rate": 123
},
"items": [
{
"quantity": 123,
"unit_price": 123,
"description": "<string>",
"code_unit_of_measure": "<string>",
"discount_amount": 123,
"code": {
"type": "<string>",
"value": "<string>"
},
"taxes": [
{
"type": "<string>",
"amount": 123,
"rate": 123
}
],
"additional_info": {
"customs_number": "<string>"
}
}
],
"totals": {
"sub_total": 123,
"total": 123,
"discount": 123,
"taxes": [
{
"type": "<string>",
"base_amount": 123,
"rate": 123,
"amount": 123
}
]
},
"serie": "A",
"payment_due_date": "2024-04-15",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"service_indicator": 1,
"concept": 1,
"reason_code": 1,
"cancellation_date": "2024-03-20",
"observations": "Pago a 30 días",
"external_reference": "OC-2024-001",
"export_payment_method_code": 21,
"payment_method": {
"code": "<string>",
"description": "<string>"
},
"global_taxes": [
{
"type": "<string>",
"base_amount": 123,
"rate": 123,
"amount": 123,
"description": "<string>"
}
],
"billing_reference": [
{
"invoice_type": "<string>",
"branch_office": 123,
"number": 123,
"invoice_date": "2023-12-25",
"cae": "<string>"
}
],
"additional_header_info": [
{
"key": "<string>",
"value": "<string>"
}
],
"additional_footer_info": [
{
"key": "<string>",
"value": "<string>"
}
],
"additional_export_info": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.emify.co/api/companies/{company_id}/invoices"
payload = {
"branch_office": 0,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"recipient": {
"legal_name": "<string>",
"document_type": "<string>",
"document_number": "<string>",
"internal_code": "<string>",
"address": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"phone": "<string>"
},
"tax_information": {
"tax_condition": "<string>",
"start_activities_date": "2023-12-25",
"activity": "<string>",
"activity_codes": [123],
"resolution_date": "<string>",
"resolution_number": "<string>"
}
},
"currency": {
"code": "<string>",
"exchange_rate": 123
},
"items": [
{
"quantity": 123,
"unit_price": 123,
"description": "<string>",
"code_unit_of_measure": "<string>",
"discount_amount": 123,
"code": {
"type": "<string>",
"value": "<string>"
},
"taxes": [
{
"type": "<string>",
"amount": 123,
"rate": 123
}
],
"additional_info": { "customs_number": "<string>" }
}
],
"totals": {
"sub_total": 123,
"total": 123,
"discount": 123,
"taxes": [
{
"type": "<string>",
"base_amount": 123,
"rate": 123,
"amount": 123
}
]
},
"serie": "A",
"payment_due_date": "2024-04-15",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"service_indicator": 1,
"concept": 1,
"reason_code": 1,
"cancellation_date": "2024-03-20",
"observations": "Pago a 30 días",
"external_reference": "OC-2024-001",
"export_payment_method_code": 21,
"payment_method": {
"code": "<string>",
"description": "<string>"
},
"global_taxes": [
{
"type": "<string>",
"base_amount": 123,
"rate": 123,
"amount": 123,
"description": "<string>"
}
],
"billing_reference": [
{
"invoice_type": "<string>",
"branch_office": 123,
"number": 123,
"invoice_date": "2023-12-25",
"cae": "<string>"
}
],
"additional_header_info": [
{
"key": "<string>",
"value": "<string>"
}
],
"additional_footer_info": [
{
"key": "<string>",
"value": "<string>"
}
],
"additional_export_info": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch_office: 0,
invoice_type: 33,
invoice_date: '2024-03-15',
recipient: {
legal_name: '<string>',
document_type: '<string>',
document_number: '<string>',
internal_code: '<string>',
address: {
address: '<string>',
city: '<string>',
region: '<string>',
country: '<string>',
phone: '<string>'
},
tax_information: {
tax_condition: '<string>',
start_activities_date: '2023-12-25',
activity: '<string>',
activity_codes: [123],
resolution_date: '<string>',
resolution_number: '<string>'
}
},
currency: {code: '<string>', exchange_rate: 123},
items: [
{
quantity: 123,
unit_price: 123,
description: '<string>',
code_unit_of_measure: '<string>',
discount_amount: 123,
code: {type: '<string>', value: '<string>'},
taxes: [{type: '<string>', amount: 123, rate: 123}],
additional_info: {customs_number: '<string>'}
}
],
totals: {
sub_total: 123,
total: 123,
discount: 123,
taxes: [{type: '<string>', base_amount: 123, rate: 123, amount: 123}]
},
serie: 'A',
payment_due_date: '2024-04-15',
service_start_date: '2024-03-01',
service_end_date: '2024-03-31',
service_indicator: 1,
concept: 1,
reason_code: 1,
cancellation_date: '2024-03-20',
observations: 'Pago a 30 días',
external_reference: 'OC-2024-001',
export_payment_method_code: 21,
payment_method: {code: '<string>', description: '<string>'},
global_taxes: [
{
type: '<string>',
base_amount: 123,
rate: 123,
amount: 123,
description: '<string>'
}
],
billing_reference: [
{
invoice_type: '<string>',
branch_office: 123,
number: 123,
invoice_date: '2023-12-25',
cae: '<string>'
}
],
additional_header_info: [{key: '<string>', value: '<string>'}],
additional_footer_info: [{key: '<string>', value: '<string>'}],
additional_export_info: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://api.emify.co/api/companies/{company_id}/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.emify.co/api/companies/{company_id}/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'branch_office' => 0,
'invoice_type' => 33,
'invoice_date' => '2024-03-15',
'recipient' => [
'legal_name' => '<string>',
'document_type' => '<string>',
'document_number' => '<string>',
'internal_code' => '<string>',
'address' => [
'address' => '<string>',
'city' => '<string>',
'region' => '<string>',
'country' => '<string>',
'phone' => '<string>'
],
'tax_information' => [
'tax_condition' => '<string>',
'start_activities_date' => '2023-12-25',
'activity' => '<string>',
'activity_codes' => [
123
],
'resolution_date' => '<string>',
'resolution_number' => '<string>'
]
],
'currency' => [
'code' => '<string>',
'exchange_rate' => 123
],
'items' => [
[
'quantity' => 123,
'unit_price' => 123,
'description' => '<string>',
'code_unit_of_measure' => '<string>',
'discount_amount' => 123,
'code' => [
'type' => '<string>',
'value' => '<string>'
],
'taxes' => [
[
'type' => '<string>',
'amount' => 123,
'rate' => 123
]
],
'additional_info' => [
'customs_number' => '<string>'
]
]
],
'totals' => [
'sub_total' => 123,
'total' => 123,
'discount' => 123,
'taxes' => [
[
'type' => '<string>',
'base_amount' => 123,
'rate' => 123,
'amount' => 123
]
]
],
'serie' => 'A',
'payment_due_date' => '2024-04-15',
'service_start_date' => '2024-03-01',
'service_end_date' => '2024-03-31',
'service_indicator' => 1,
'concept' => 1,
'reason_code' => 1,
'cancellation_date' => '2024-03-20',
'observations' => 'Pago a 30 días',
'external_reference' => 'OC-2024-001',
'export_payment_method_code' => 21,
'payment_method' => [
'code' => '<string>',
'description' => '<string>'
],
'global_taxes' => [
[
'type' => '<string>',
'base_amount' => 123,
'rate' => 123,
'amount' => 123,
'description' => '<string>'
]
],
'billing_reference' => [
[
'invoice_type' => '<string>',
'branch_office' => 123,
'number' => 123,
'invoice_date' => '2023-12-25',
'cae' => '<string>'
]
],
'additional_header_info' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'additional_footer_info' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'additional_export_info' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.emify.co/api/companies/{company_id}/invoices"
payload := strings.NewReader("{\n \"branch_office\": 0,\n \"invoice_type\": 33,\n \"invoice_date\": \"2024-03-15\",\n \"recipient\": {\n \"legal_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"internal_code\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"tax_information\": {\n \"tax_condition\": \"<string>\",\n \"start_activities_date\": \"2023-12-25\",\n \"activity\": \"<string>\",\n \"activity_codes\": [\n 123\n ],\n \"resolution_date\": \"<string>\",\n \"resolution_number\": \"<string>\"\n }\n },\n \"currency\": {\n \"code\": \"<string>\",\n \"exchange_rate\": 123\n },\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_price\": 123,\n \"description\": \"<string>\",\n \"code_unit_of_measure\": \"<string>\",\n \"discount_amount\": 123,\n \"code\": {\n \"type\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"amount\": 123,\n \"rate\": 123\n }\n ],\n \"additional_info\": {\n \"customs_number\": \"<string>\"\n }\n }\n ],\n \"totals\": {\n \"sub_total\": 123,\n \"total\": 123,\n \"discount\": 123,\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123\n }\n ]\n },\n \"serie\": \"A\",\n \"payment_due_date\": \"2024-04-15\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"service_indicator\": 1,\n \"concept\": 1,\n \"reason_code\": 1,\n \"cancellation_date\": \"2024-03-20\",\n \"observations\": \"Pago a 30 días\",\n \"external_reference\": \"OC-2024-001\",\n \"export_payment_method_code\": 21,\n \"payment_method\": {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"global_taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"billing_reference\": [\n {\n \"invoice_type\": \"<string>\",\n \"branch_office\": 123,\n \"number\": 123,\n \"invoice_date\": \"2023-12-25\",\n \"cae\": \"<string>\"\n }\n ],\n \"additional_header_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_footer_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_export_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.emify.co/api/companies/{company_id}/invoices")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branch_office\": 0,\n \"invoice_type\": 33,\n \"invoice_date\": \"2024-03-15\",\n \"recipient\": {\n \"legal_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"internal_code\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"tax_information\": {\n \"tax_condition\": \"<string>\",\n \"start_activities_date\": \"2023-12-25\",\n \"activity\": \"<string>\",\n \"activity_codes\": [\n 123\n ],\n \"resolution_date\": \"<string>\",\n \"resolution_number\": \"<string>\"\n }\n },\n \"currency\": {\n \"code\": \"<string>\",\n \"exchange_rate\": 123\n },\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_price\": 123,\n \"description\": \"<string>\",\n \"code_unit_of_measure\": \"<string>\",\n \"discount_amount\": 123,\n \"code\": {\n \"type\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"amount\": 123,\n \"rate\": 123\n }\n ],\n \"additional_info\": {\n \"customs_number\": \"<string>\"\n }\n }\n ],\n \"totals\": {\n \"sub_total\": 123,\n \"total\": 123,\n \"discount\": 123,\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123\n }\n ]\n },\n \"serie\": \"A\",\n \"payment_due_date\": \"2024-04-15\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"service_indicator\": 1,\n \"concept\": 1,\n \"reason_code\": 1,\n \"cancellation_date\": \"2024-03-20\",\n \"observations\": \"Pago a 30 días\",\n \"external_reference\": \"OC-2024-001\",\n \"export_payment_method_code\": 21,\n \"payment_method\": {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"global_taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"billing_reference\": [\n {\n \"invoice_type\": \"<string>\",\n \"branch_office\": 123,\n \"number\": 123,\n \"invoice_date\": \"2023-12-25\",\n \"cae\": \"<string>\"\n }\n ],\n \"additional_header_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_footer_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_export_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emify.co/api/companies/{company_id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branch_office\": 0,\n \"invoice_type\": 33,\n \"invoice_date\": \"2024-03-15\",\n \"recipient\": {\n \"legal_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"internal_code\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"tax_information\": {\n \"tax_condition\": \"<string>\",\n \"start_activities_date\": \"2023-12-25\",\n \"activity\": \"<string>\",\n \"activity_codes\": [\n 123\n ],\n \"resolution_date\": \"<string>\",\n \"resolution_number\": \"<string>\"\n }\n },\n \"currency\": {\n \"code\": \"<string>\",\n \"exchange_rate\": 123\n },\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_price\": 123,\n \"description\": \"<string>\",\n \"code_unit_of_measure\": \"<string>\",\n \"discount_amount\": 123,\n \"code\": {\n \"type\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"amount\": 123,\n \"rate\": 123\n }\n ],\n \"additional_info\": {\n \"customs_number\": \"<string>\"\n }\n }\n ],\n \"totals\": {\n \"sub_total\": 123,\n \"total\": 123,\n \"discount\": 123,\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123\n }\n ]\n },\n \"serie\": \"A\",\n \"payment_due_date\": \"2024-04-15\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"service_indicator\": 1,\n \"concept\": 1,\n \"reason_code\": 1,\n \"cancellation_date\": \"2024-03-20\",\n \"observations\": \"Pago a 30 días\",\n \"external_reference\": \"OC-2024-001\",\n \"export_payment_method_code\": 21,\n \"payment_method\": {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"global_taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"billing_reference\": [\n {\n \"invoice_type\": \"<string>\",\n \"branch_office\": 123,\n \"number\": 123,\n \"invoice_date\": \"2023-12-25\",\n \"cae\": \"<string>\"\n }\n ],\n \"additional_header_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_footer_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_export_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}Authorizations
Path Parameters
ID de la empresa emisora
Query Parameters
Show child attributes
Show child attributes
Body
Código de la sucursal emisora
0
Tipo de documento tributario (ej: 33, 39, 61)
33
Fecha de emisión del documento
"2024-03-15"
Información del receptor del documento
Show child attributes
Show child attributes
Información de la moneda del documento
Show child attributes
Show child attributes
Lista de ítems del documento
Show child attributes
Show child attributes
Totales del documento
Show child attributes
Show child attributes
Serie del documento (si aplica)
"A"
Fecha de vencimiento del pago
"2024-04-15"
Fecha de inicio del período de servicio
"2024-03-01"
Fecha de fin del período de servicio
"2024-03-31"
Indicador de servicio (específico por país)
1
Concepto del documento (específico por país)
1
Código del motivo de anulación (para notas de crédito/débito)
1
Fecha de anulación del documento
"2024-03-20"
Observaciones adicionales del documento
"Pago a 30 días"
Referencia externa del documento en el sistema del cliente
"OC-2024-001"
Información del emisor del documento
Show child attributes
Show child attributes
Código del método de pago de exportación (específico para facturas de exportación)
21
Método de pago del documento
Show child attributes
Show child attributes
Impuestos globales aplicados al documento
Show child attributes
Show child attributes
Referencias a documentos relacionados (ej: factura original para notas de crédito)
Show child attributes
Show child attributes
Información adicional en el encabezado del documento
Show child attributes
Show child attributes
Información adicional en el pie del documento
Show child attributes
Show child attributes
Información adicional de exportación
Show child attributes
Show child attributes
Response
Documento recibido y en procesamiento
ID único del documento creado
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Código de la sucursal emisora
0
Serie del documento
"A"
Número de folio asignado al documento
1234
Tipo de documento tributario
33
Fecha de emisión del documento
"2024-03-15"
Estado del documento (ej: PEN, EMS, RCH)
"PEN"
Código de Autorización Electrónica (Chile, Argentina)
72053234640
Fecha de expiración del CAE
"2024-03-25"
Track ID de seguimiento en el ente tributario
1234567890
curl --request POST \
--url https://api.emify.co/api/companies/{company_id}/invoices \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"branch_office": 0,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"recipient": {
"legal_name": "<string>",
"document_type": "<string>",
"document_number": "<string>",
"internal_code": "<string>",
"address": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"phone": "<string>"
},
"tax_information": {
"tax_condition": "<string>",
"start_activities_date": "2023-12-25",
"activity": "<string>",
"activity_codes": [
123
],
"resolution_date": "<string>",
"resolution_number": "<string>"
}
},
"currency": {
"code": "<string>",
"exchange_rate": 123
},
"items": [
{
"quantity": 123,
"unit_price": 123,
"description": "<string>",
"code_unit_of_measure": "<string>",
"discount_amount": 123,
"code": {
"type": "<string>",
"value": "<string>"
},
"taxes": [
{
"type": "<string>",
"amount": 123,
"rate": 123
}
],
"additional_info": {
"customs_number": "<string>"
}
}
],
"totals": {
"sub_total": 123,
"total": 123,
"discount": 123,
"taxes": [
{
"type": "<string>",
"base_amount": 123,
"rate": 123,
"amount": 123
}
]
},
"serie": "A",
"payment_due_date": "2024-04-15",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"service_indicator": 1,
"concept": 1,
"reason_code": 1,
"cancellation_date": "2024-03-20",
"observations": "Pago a 30 días",
"external_reference": "OC-2024-001",
"export_payment_method_code": 21,
"payment_method": {
"code": "<string>",
"description": "<string>"
},
"global_taxes": [
{
"type": "<string>",
"base_amount": 123,
"rate": 123,
"amount": 123,
"description": "<string>"
}
],
"billing_reference": [
{
"invoice_type": "<string>",
"branch_office": 123,
"number": 123,
"invoice_date": "2023-12-25",
"cae": "<string>"
}
],
"additional_header_info": [
{
"key": "<string>",
"value": "<string>"
}
],
"additional_footer_info": [
{
"key": "<string>",
"value": "<string>"
}
],
"additional_export_info": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.emify.co/api/companies/{company_id}/invoices"
payload = {
"branch_office": 0,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"recipient": {
"legal_name": "<string>",
"document_type": "<string>",
"document_number": "<string>",
"internal_code": "<string>",
"address": {
"address": "<string>",
"city": "<string>",
"region": "<string>",
"country": "<string>",
"phone": "<string>"
},
"tax_information": {
"tax_condition": "<string>",
"start_activities_date": "2023-12-25",
"activity": "<string>",
"activity_codes": [123],
"resolution_date": "<string>",
"resolution_number": "<string>"
}
},
"currency": {
"code": "<string>",
"exchange_rate": 123
},
"items": [
{
"quantity": 123,
"unit_price": 123,
"description": "<string>",
"code_unit_of_measure": "<string>",
"discount_amount": 123,
"code": {
"type": "<string>",
"value": "<string>"
},
"taxes": [
{
"type": "<string>",
"amount": 123,
"rate": 123
}
],
"additional_info": { "customs_number": "<string>" }
}
],
"totals": {
"sub_total": 123,
"total": 123,
"discount": 123,
"taxes": [
{
"type": "<string>",
"base_amount": 123,
"rate": 123,
"amount": 123
}
]
},
"serie": "A",
"payment_due_date": "2024-04-15",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"service_indicator": 1,
"concept": 1,
"reason_code": 1,
"cancellation_date": "2024-03-20",
"observations": "Pago a 30 días",
"external_reference": "OC-2024-001",
"export_payment_method_code": 21,
"payment_method": {
"code": "<string>",
"description": "<string>"
},
"global_taxes": [
{
"type": "<string>",
"base_amount": 123,
"rate": 123,
"amount": 123,
"description": "<string>"
}
],
"billing_reference": [
{
"invoice_type": "<string>",
"branch_office": 123,
"number": 123,
"invoice_date": "2023-12-25",
"cae": "<string>"
}
],
"additional_header_info": [
{
"key": "<string>",
"value": "<string>"
}
],
"additional_footer_info": [
{
"key": "<string>",
"value": "<string>"
}
],
"additional_export_info": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch_office: 0,
invoice_type: 33,
invoice_date: '2024-03-15',
recipient: {
legal_name: '<string>',
document_type: '<string>',
document_number: '<string>',
internal_code: '<string>',
address: {
address: '<string>',
city: '<string>',
region: '<string>',
country: '<string>',
phone: '<string>'
},
tax_information: {
tax_condition: '<string>',
start_activities_date: '2023-12-25',
activity: '<string>',
activity_codes: [123],
resolution_date: '<string>',
resolution_number: '<string>'
}
},
currency: {code: '<string>', exchange_rate: 123},
items: [
{
quantity: 123,
unit_price: 123,
description: '<string>',
code_unit_of_measure: '<string>',
discount_amount: 123,
code: {type: '<string>', value: '<string>'},
taxes: [{type: '<string>', amount: 123, rate: 123}],
additional_info: {customs_number: '<string>'}
}
],
totals: {
sub_total: 123,
total: 123,
discount: 123,
taxes: [{type: '<string>', base_amount: 123, rate: 123, amount: 123}]
},
serie: 'A',
payment_due_date: '2024-04-15',
service_start_date: '2024-03-01',
service_end_date: '2024-03-31',
service_indicator: 1,
concept: 1,
reason_code: 1,
cancellation_date: '2024-03-20',
observations: 'Pago a 30 días',
external_reference: 'OC-2024-001',
export_payment_method_code: 21,
payment_method: {code: '<string>', description: '<string>'},
global_taxes: [
{
type: '<string>',
base_amount: 123,
rate: 123,
amount: 123,
description: '<string>'
}
],
billing_reference: [
{
invoice_type: '<string>',
branch_office: 123,
number: 123,
invoice_date: '2023-12-25',
cae: '<string>'
}
],
additional_header_info: [{key: '<string>', value: '<string>'}],
additional_footer_info: [{key: '<string>', value: '<string>'}],
additional_export_info: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://api.emify.co/api/companies/{company_id}/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.emify.co/api/companies/{company_id}/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'branch_office' => 0,
'invoice_type' => 33,
'invoice_date' => '2024-03-15',
'recipient' => [
'legal_name' => '<string>',
'document_type' => '<string>',
'document_number' => '<string>',
'internal_code' => '<string>',
'address' => [
'address' => '<string>',
'city' => '<string>',
'region' => '<string>',
'country' => '<string>',
'phone' => '<string>'
],
'tax_information' => [
'tax_condition' => '<string>',
'start_activities_date' => '2023-12-25',
'activity' => '<string>',
'activity_codes' => [
123
],
'resolution_date' => '<string>',
'resolution_number' => '<string>'
]
],
'currency' => [
'code' => '<string>',
'exchange_rate' => 123
],
'items' => [
[
'quantity' => 123,
'unit_price' => 123,
'description' => '<string>',
'code_unit_of_measure' => '<string>',
'discount_amount' => 123,
'code' => [
'type' => '<string>',
'value' => '<string>'
],
'taxes' => [
[
'type' => '<string>',
'amount' => 123,
'rate' => 123
]
],
'additional_info' => [
'customs_number' => '<string>'
]
]
],
'totals' => [
'sub_total' => 123,
'total' => 123,
'discount' => 123,
'taxes' => [
[
'type' => '<string>',
'base_amount' => 123,
'rate' => 123,
'amount' => 123
]
]
],
'serie' => 'A',
'payment_due_date' => '2024-04-15',
'service_start_date' => '2024-03-01',
'service_end_date' => '2024-03-31',
'service_indicator' => 1,
'concept' => 1,
'reason_code' => 1,
'cancellation_date' => '2024-03-20',
'observations' => 'Pago a 30 días',
'external_reference' => 'OC-2024-001',
'export_payment_method_code' => 21,
'payment_method' => [
'code' => '<string>',
'description' => '<string>'
],
'global_taxes' => [
[
'type' => '<string>',
'base_amount' => 123,
'rate' => 123,
'amount' => 123,
'description' => '<string>'
]
],
'billing_reference' => [
[
'invoice_type' => '<string>',
'branch_office' => 123,
'number' => 123,
'invoice_date' => '2023-12-25',
'cae' => '<string>'
]
],
'additional_header_info' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'additional_footer_info' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'additional_export_info' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.emify.co/api/companies/{company_id}/invoices"
payload := strings.NewReader("{\n \"branch_office\": 0,\n \"invoice_type\": 33,\n \"invoice_date\": \"2024-03-15\",\n \"recipient\": {\n \"legal_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"internal_code\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"tax_information\": {\n \"tax_condition\": \"<string>\",\n \"start_activities_date\": \"2023-12-25\",\n \"activity\": \"<string>\",\n \"activity_codes\": [\n 123\n ],\n \"resolution_date\": \"<string>\",\n \"resolution_number\": \"<string>\"\n }\n },\n \"currency\": {\n \"code\": \"<string>\",\n \"exchange_rate\": 123\n },\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_price\": 123,\n \"description\": \"<string>\",\n \"code_unit_of_measure\": \"<string>\",\n \"discount_amount\": 123,\n \"code\": {\n \"type\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"amount\": 123,\n \"rate\": 123\n }\n ],\n \"additional_info\": {\n \"customs_number\": \"<string>\"\n }\n }\n ],\n \"totals\": {\n \"sub_total\": 123,\n \"total\": 123,\n \"discount\": 123,\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123\n }\n ]\n },\n \"serie\": \"A\",\n \"payment_due_date\": \"2024-04-15\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"service_indicator\": 1,\n \"concept\": 1,\n \"reason_code\": 1,\n \"cancellation_date\": \"2024-03-20\",\n \"observations\": \"Pago a 30 días\",\n \"external_reference\": \"OC-2024-001\",\n \"export_payment_method_code\": 21,\n \"payment_method\": {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"global_taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"billing_reference\": [\n {\n \"invoice_type\": \"<string>\",\n \"branch_office\": 123,\n \"number\": 123,\n \"invoice_date\": \"2023-12-25\",\n \"cae\": \"<string>\"\n }\n ],\n \"additional_header_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_footer_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_export_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.emify.co/api/companies/{company_id}/invoices")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branch_office\": 0,\n \"invoice_type\": 33,\n \"invoice_date\": \"2024-03-15\",\n \"recipient\": {\n \"legal_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"internal_code\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"tax_information\": {\n \"tax_condition\": \"<string>\",\n \"start_activities_date\": \"2023-12-25\",\n \"activity\": \"<string>\",\n \"activity_codes\": [\n 123\n ],\n \"resolution_date\": \"<string>\",\n \"resolution_number\": \"<string>\"\n }\n },\n \"currency\": {\n \"code\": \"<string>\",\n \"exchange_rate\": 123\n },\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_price\": 123,\n \"description\": \"<string>\",\n \"code_unit_of_measure\": \"<string>\",\n \"discount_amount\": 123,\n \"code\": {\n \"type\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"amount\": 123,\n \"rate\": 123\n }\n ],\n \"additional_info\": {\n \"customs_number\": \"<string>\"\n }\n }\n ],\n \"totals\": {\n \"sub_total\": 123,\n \"total\": 123,\n \"discount\": 123,\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123\n }\n ]\n },\n \"serie\": \"A\",\n \"payment_due_date\": \"2024-04-15\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"service_indicator\": 1,\n \"concept\": 1,\n \"reason_code\": 1,\n \"cancellation_date\": \"2024-03-20\",\n \"observations\": \"Pago a 30 días\",\n \"external_reference\": \"OC-2024-001\",\n \"export_payment_method_code\": 21,\n \"payment_method\": {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"global_taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"billing_reference\": [\n {\n \"invoice_type\": \"<string>\",\n \"branch_office\": 123,\n \"number\": 123,\n \"invoice_date\": \"2023-12-25\",\n \"cae\": \"<string>\"\n }\n ],\n \"additional_header_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_footer_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_export_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emify.co/api/companies/{company_id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branch_office\": 0,\n \"invoice_type\": 33,\n \"invoice_date\": \"2024-03-15\",\n \"recipient\": {\n \"legal_name\": \"<string>\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"internal_code\": \"<string>\",\n \"address\": {\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\"\n },\n \"tax_information\": {\n \"tax_condition\": \"<string>\",\n \"start_activities_date\": \"2023-12-25\",\n \"activity\": \"<string>\",\n \"activity_codes\": [\n 123\n ],\n \"resolution_date\": \"<string>\",\n \"resolution_number\": \"<string>\"\n }\n },\n \"currency\": {\n \"code\": \"<string>\",\n \"exchange_rate\": 123\n },\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_price\": 123,\n \"description\": \"<string>\",\n \"code_unit_of_measure\": \"<string>\",\n \"discount_amount\": 123,\n \"code\": {\n \"type\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"amount\": 123,\n \"rate\": 123\n }\n ],\n \"additional_info\": {\n \"customs_number\": \"<string>\"\n }\n }\n ],\n \"totals\": {\n \"sub_total\": 123,\n \"total\": 123,\n \"discount\": 123,\n \"taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123\n }\n ]\n },\n \"serie\": \"A\",\n \"payment_due_date\": \"2024-04-15\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"service_indicator\": 1,\n \"concept\": 1,\n \"reason_code\": 1,\n \"cancellation_date\": \"2024-03-20\",\n \"observations\": \"Pago a 30 días\",\n \"external_reference\": \"OC-2024-001\",\n \"export_payment_method_code\": 21,\n \"payment_method\": {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"global_taxes\": [\n {\n \"type\": \"<string>\",\n \"base_amount\": 123,\n \"rate\": 123,\n \"amount\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"billing_reference\": [\n {\n \"invoice_type\": \"<string>\",\n \"branch_office\": 123,\n \"number\": 123,\n \"invoice_date\": \"2023-12-25\",\n \"cae\": \"<string>\"\n }\n ],\n \"additional_header_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_footer_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"additional_export_info\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"branch_office": 0,
"serie": "A",
"number": 1234,
"invoice_type": 33,
"invoice_date": "2024-03-15",
"status": "PEN",
"cae": 72053234640,
"cae_expiration_date": "2024-03-25",
"track_id": 1234567890
}