Create invoice batch
curl --request POST \
--url https://app.yofacturo.es/api/v1/invoice_batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"invoice_batch": {
"invoices": [
{
"external_invoice_id": "<string>",
"issuer_nif": "<string>",
"number_serie": "<string>",
"issuer_name": "<string>",
"invoice_type": "<string>",
"operation_description": "<string>",
"operation_date": "2023-12-25",
"due_date": "2023-12-25",
"rectified_invoice_id": 123,
"has_unidentified_recipient": true,
"recipient_legal_name": "<string>",
"recipient_document_type": "<string>",
"recipient_document_number": "<string>",
"recipient_billing_address": "<string>",
"recipient_billing_postal_code": "<string>",
"recipient_billing_city": "<string>",
"contact_id": 123,
"invoiceable_serie_id": 123,
"payment_method": "<string>",
"payment_method_info": "<string>",
"operation_type": "<string>",
"recipient_country_code": "<string>",
"footer_note": "<string>",
"total_reimbursable_expenses_amount": 123,
"paid": true,
"lines": [
{
"position": 123,
"concept": "<string>",
"units": 123,
"unit_price": 123,
"discount_percent": 123,
"notes": "<string>",
"tax_type": "<string>",
"tax_regime": "<string>",
"tax_operation_key": "<string>",
"tax_exemption_code": "<string>",
"tax_rate": 123,
"income_tax_withholding_rate": 123
}
]
}
],
"external_batch_id": "<string>"
}
}
'import requests
url = "https://app.yofacturo.es/api/v1/invoice_batches"
payload = { "invoice_batch": {
"invoices": [
{
"external_invoice_id": "<string>",
"issuer_nif": "<string>",
"number_serie": "<string>",
"issuer_name": "<string>",
"invoice_type": "<string>",
"operation_description": "<string>",
"operation_date": "2023-12-25",
"due_date": "2023-12-25",
"rectified_invoice_id": 123,
"has_unidentified_recipient": True,
"recipient_legal_name": "<string>",
"recipient_document_type": "<string>",
"recipient_document_number": "<string>",
"recipient_billing_address": "<string>",
"recipient_billing_postal_code": "<string>",
"recipient_billing_city": "<string>",
"contact_id": 123,
"invoiceable_serie_id": 123,
"payment_method": "<string>",
"payment_method_info": "<string>",
"operation_type": "<string>",
"recipient_country_code": "<string>",
"footer_note": "<string>",
"total_reimbursable_expenses_amount": 123,
"paid": True,
"lines": [
{
"position": 123,
"concept": "<string>",
"units": 123,
"unit_price": 123,
"discount_percent": 123,
"notes": "<string>",
"tax_type": "<string>",
"tax_regime": "<string>",
"tax_operation_key": "<string>",
"tax_exemption_code": "<string>",
"tax_rate": 123,
"income_tax_withholding_rate": 123
}
]
}
],
"external_batch_id": "<string>"
} }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
invoice_batch: {
invoices: [
{
external_invoice_id: '<string>',
issuer_nif: '<string>',
number_serie: '<string>',
issuer_name: '<string>',
invoice_type: '<string>',
operation_description: '<string>',
operation_date: '2023-12-25',
due_date: '2023-12-25',
rectified_invoice_id: 123,
has_unidentified_recipient: true,
recipient_legal_name: '<string>',
recipient_document_type: '<string>',
recipient_document_number: '<string>',
recipient_billing_address: '<string>',
recipient_billing_postal_code: '<string>',
recipient_billing_city: '<string>',
contact_id: 123,
invoiceable_serie_id: 123,
payment_method: '<string>',
payment_method_info: '<string>',
operation_type: '<string>',
recipient_country_code: '<string>',
footer_note: '<string>',
total_reimbursable_expenses_amount: 123,
paid: true,
lines: [
{
position: 123,
concept: '<string>',
units: 123,
unit_price: 123,
discount_percent: 123,
notes: '<string>',
tax_type: '<string>',
tax_regime: '<string>',
tax_operation_key: '<string>',
tax_exemption_code: '<string>',
tax_rate: 123,
income_tax_withholding_rate: 123
}
]
}
],
external_batch_id: '<string>'
}
})
};
fetch('https://app.yofacturo.es/api/v1/invoice_batches', 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://app.yofacturo.es/api/v1/invoice_batches",
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([
'invoice_batch' => [
'invoices' => [
[
'external_invoice_id' => '<string>',
'issuer_nif' => '<string>',
'number_serie' => '<string>',
'issuer_name' => '<string>',
'invoice_type' => '<string>',
'operation_description' => '<string>',
'operation_date' => '2023-12-25',
'due_date' => '2023-12-25',
'rectified_invoice_id' => 123,
'has_unidentified_recipient' => true,
'recipient_legal_name' => '<string>',
'recipient_document_type' => '<string>',
'recipient_document_number' => '<string>',
'recipient_billing_address' => '<string>',
'recipient_billing_postal_code' => '<string>',
'recipient_billing_city' => '<string>',
'contact_id' => 123,
'invoiceable_serie_id' => 123,
'payment_method' => '<string>',
'payment_method_info' => '<string>',
'operation_type' => '<string>',
'recipient_country_code' => '<string>',
'footer_note' => '<string>',
'total_reimbursable_expenses_amount' => 123,
'paid' => true,
'lines' => [
[
'position' => 123,
'concept' => '<string>',
'units' => 123,
'unit_price' => 123,
'discount_percent' => 123,
'notes' => '<string>',
'tax_type' => '<string>',
'tax_regime' => '<string>',
'tax_operation_key' => '<string>',
'tax_exemption_code' => '<string>',
'tax_rate' => 123,
'income_tax_withholding_rate' => 123
]
]
]
],
'external_batch_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://app.yofacturo.es/api/v1/invoice_batches"
payload := strings.NewReader("{\n \"invoice_batch\": {\n \"invoices\": [\n {\n \"external_invoice_id\": \"<string>\",\n \"issuer_nif\": \"<string>\",\n \"number_serie\": \"<string>\",\n \"issuer_name\": \"<string>\",\n \"invoice_type\": \"<string>\",\n \"operation_description\": \"<string>\",\n \"operation_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"rectified_invoice_id\": 123,\n \"has_unidentified_recipient\": true,\n \"recipient_legal_name\": \"<string>\",\n \"recipient_document_type\": \"<string>\",\n \"recipient_document_number\": \"<string>\",\n \"recipient_billing_address\": \"<string>\",\n \"recipient_billing_postal_code\": \"<string>\",\n \"recipient_billing_city\": \"<string>\",\n \"contact_id\": 123,\n \"invoiceable_serie_id\": 123,\n \"payment_method\": \"<string>\",\n \"payment_method_info\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"recipient_country_code\": \"<string>\",\n \"footer_note\": \"<string>\",\n \"total_reimbursable_expenses_amount\": 123,\n \"paid\": true,\n \"lines\": [\n {\n \"position\": 123,\n \"concept\": \"<string>\",\n \"units\": 123,\n \"unit_price\": 123,\n \"discount_percent\": 123,\n \"notes\": \"<string>\",\n \"tax_type\": \"<string>\",\n \"tax_regime\": \"<string>\",\n \"tax_operation_key\": \"<string>\",\n \"tax_exemption_code\": \"<string>\",\n \"tax_rate\": 123,\n \"income_tax_withholding_rate\": 123\n }\n ]\n }\n ],\n \"external_batch_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://app.yofacturo.es/api/v1/invoice_batches")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoice_batch\": {\n \"invoices\": [\n {\n \"external_invoice_id\": \"<string>\",\n \"issuer_nif\": \"<string>\",\n \"number_serie\": \"<string>\",\n \"issuer_name\": \"<string>\",\n \"invoice_type\": \"<string>\",\n \"operation_description\": \"<string>\",\n \"operation_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"rectified_invoice_id\": 123,\n \"has_unidentified_recipient\": true,\n \"recipient_legal_name\": \"<string>\",\n \"recipient_document_type\": \"<string>\",\n \"recipient_document_number\": \"<string>\",\n \"recipient_billing_address\": \"<string>\",\n \"recipient_billing_postal_code\": \"<string>\",\n \"recipient_billing_city\": \"<string>\",\n \"contact_id\": 123,\n \"invoiceable_serie_id\": 123,\n \"payment_method\": \"<string>\",\n \"payment_method_info\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"recipient_country_code\": \"<string>\",\n \"footer_note\": \"<string>\",\n \"total_reimbursable_expenses_amount\": 123,\n \"paid\": true,\n \"lines\": [\n {\n \"position\": 123,\n \"concept\": \"<string>\",\n \"units\": 123,\n \"unit_price\": 123,\n \"discount_percent\": 123,\n \"notes\": \"<string>\",\n \"tax_type\": \"<string>\",\n \"tax_regime\": \"<string>\",\n \"tax_operation_key\": \"<string>\",\n \"tax_exemption_code\": \"<string>\",\n \"tax_rate\": 123,\n \"income_tax_withholding_rate\": 123\n }\n ]\n }\n ],\n \"external_batch_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.yofacturo.es/api/v1/invoice_batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoice_batch\": {\n \"invoices\": [\n {\n \"external_invoice_id\": \"<string>\",\n \"issuer_nif\": \"<string>\",\n \"number_serie\": \"<string>\",\n \"issuer_name\": \"<string>\",\n \"invoice_type\": \"<string>\",\n \"operation_description\": \"<string>\",\n \"operation_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"rectified_invoice_id\": 123,\n \"has_unidentified_recipient\": true,\n \"recipient_legal_name\": \"<string>\",\n \"recipient_document_type\": \"<string>\",\n \"recipient_document_number\": \"<string>\",\n \"recipient_billing_address\": \"<string>\",\n \"recipient_billing_postal_code\": \"<string>\",\n \"recipient_billing_city\": \"<string>\",\n \"contact_id\": 123,\n \"invoiceable_serie_id\": 123,\n \"payment_method\": \"<string>\",\n \"payment_method_info\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"recipient_country_code\": \"<string>\",\n \"footer_note\": \"<string>\",\n \"total_reimbursable_expenses_amount\": 123,\n \"paid\": true,\n \"lines\": [\n {\n \"position\": 123,\n \"concept\": \"<string>\",\n \"units\": 123,\n \"unit_price\": 123,\n \"discount_percent\": 123,\n \"notes\": \"<string>\",\n \"tax_type\": \"<string>\",\n \"tax_regime\": \"<string>\",\n \"tax_operation_key\": \"<string>\",\n \"tax_exemption_code\": \"<string>\",\n \"tax_rate\": 123,\n \"income_tax_withholding_rate\": 123\n }\n ]\n }\n ],\n \"external_batch_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"external_batch_id": "batch-f4ac4fcf-2db2-4dc5-9f6b-9a0f9f38ec10",
"status": "received",
"invoices_count": 1,
"received_at": "2026-03-26T10:30:00Z",
"processed_at": null
}
}Invoice Batches
Create invoice batch
Creates a batch and accepts up to 1000 invoices. Requires bearer auth and Idempotency-Key header (UUID). Successful requests are rate-limited for 60 seconds per organization.
POST
/
api
/
v1
/
invoice_batches
Create invoice batch
curl --request POST \
--url https://app.yofacturo.es/api/v1/invoice_batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"invoice_batch": {
"invoices": [
{
"external_invoice_id": "<string>",
"issuer_nif": "<string>",
"number_serie": "<string>",
"issuer_name": "<string>",
"invoice_type": "<string>",
"operation_description": "<string>",
"operation_date": "2023-12-25",
"due_date": "2023-12-25",
"rectified_invoice_id": 123,
"has_unidentified_recipient": true,
"recipient_legal_name": "<string>",
"recipient_document_type": "<string>",
"recipient_document_number": "<string>",
"recipient_billing_address": "<string>",
"recipient_billing_postal_code": "<string>",
"recipient_billing_city": "<string>",
"contact_id": 123,
"invoiceable_serie_id": 123,
"payment_method": "<string>",
"payment_method_info": "<string>",
"operation_type": "<string>",
"recipient_country_code": "<string>",
"footer_note": "<string>",
"total_reimbursable_expenses_amount": 123,
"paid": true,
"lines": [
{
"position": 123,
"concept": "<string>",
"units": 123,
"unit_price": 123,
"discount_percent": 123,
"notes": "<string>",
"tax_type": "<string>",
"tax_regime": "<string>",
"tax_operation_key": "<string>",
"tax_exemption_code": "<string>",
"tax_rate": 123,
"income_tax_withholding_rate": 123
}
]
}
],
"external_batch_id": "<string>"
}
}
'import requests
url = "https://app.yofacturo.es/api/v1/invoice_batches"
payload = { "invoice_batch": {
"invoices": [
{
"external_invoice_id": "<string>",
"issuer_nif": "<string>",
"number_serie": "<string>",
"issuer_name": "<string>",
"invoice_type": "<string>",
"operation_description": "<string>",
"operation_date": "2023-12-25",
"due_date": "2023-12-25",
"rectified_invoice_id": 123,
"has_unidentified_recipient": True,
"recipient_legal_name": "<string>",
"recipient_document_type": "<string>",
"recipient_document_number": "<string>",
"recipient_billing_address": "<string>",
"recipient_billing_postal_code": "<string>",
"recipient_billing_city": "<string>",
"contact_id": 123,
"invoiceable_serie_id": 123,
"payment_method": "<string>",
"payment_method_info": "<string>",
"operation_type": "<string>",
"recipient_country_code": "<string>",
"footer_note": "<string>",
"total_reimbursable_expenses_amount": 123,
"paid": True,
"lines": [
{
"position": 123,
"concept": "<string>",
"units": 123,
"unit_price": 123,
"discount_percent": 123,
"notes": "<string>",
"tax_type": "<string>",
"tax_regime": "<string>",
"tax_operation_key": "<string>",
"tax_exemption_code": "<string>",
"tax_rate": 123,
"income_tax_withholding_rate": 123
}
]
}
],
"external_batch_id": "<string>"
} }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
invoice_batch: {
invoices: [
{
external_invoice_id: '<string>',
issuer_nif: '<string>',
number_serie: '<string>',
issuer_name: '<string>',
invoice_type: '<string>',
operation_description: '<string>',
operation_date: '2023-12-25',
due_date: '2023-12-25',
rectified_invoice_id: 123,
has_unidentified_recipient: true,
recipient_legal_name: '<string>',
recipient_document_type: '<string>',
recipient_document_number: '<string>',
recipient_billing_address: '<string>',
recipient_billing_postal_code: '<string>',
recipient_billing_city: '<string>',
contact_id: 123,
invoiceable_serie_id: 123,
payment_method: '<string>',
payment_method_info: '<string>',
operation_type: '<string>',
recipient_country_code: '<string>',
footer_note: '<string>',
total_reimbursable_expenses_amount: 123,
paid: true,
lines: [
{
position: 123,
concept: '<string>',
units: 123,
unit_price: 123,
discount_percent: 123,
notes: '<string>',
tax_type: '<string>',
tax_regime: '<string>',
tax_operation_key: '<string>',
tax_exemption_code: '<string>',
tax_rate: 123,
income_tax_withholding_rate: 123
}
]
}
],
external_batch_id: '<string>'
}
})
};
fetch('https://app.yofacturo.es/api/v1/invoice_batches', 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://app.yofacturo.es/api/v1/invoice_batches",
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([
'invoice_batch' => [
'invoices' => [
[
'external_invoice_id' => '<string>',
'issuer_nif' => '<string>',
'number_serie' => '<string>',
'issuer_name' => '<string>',
'invoice_type' => '<string>',
'operation_description' => '<string>',
'operation_date' => '2023-12-25',
'due_date' => '2023-12-25',
'rectified_invoice_id' => 123,
'has_unidentified_recipient' => true,
'recipient_legal_name' => '<string>',
'recipient_document_type' => '<string>',
'recipient_document_number' => '<string>',
'recipient_billing_address' => '<string>',
'recipient_billing_postal_code' => '<string>',
'recipient_billing_city' => '<string>',
'contact_id' => 123,
'invoiceable_serie_id' => 123,
'payment_method' => '<string>',
'payment_method_info' => '<string>',
'operation_type' => '<string>',
'recipient_country_code' => '<string>',
'footer_note' => '<string>',
'total_reimbursable_expenses_amount' => 123,
'paid' => true,
'lines' => [
[
'position' => 123,
'concept' => '<string>',
'units' => 123,
'unit_price' => 123,
'discount_percent' => 123,
'notes' => '<string>',
'tax_type' => '<string>',
'tax_regime' => '<string>',
'tax_operation_key' => '<string>',
'tax_exemption_code' => '<string>',
'tax_rate' => 123,
'income_tax_withholding_rate' => 123
]
]
]
],
'external_batch_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://app.yofacturo.es/api/v1/invoice_batches"
payload := strings.NewReader("{\n \"invoice_batch\": {\n \"invoices\": [\n {\n \"external_invoice_id\": \"<string>\",\n \"issuer_nif\": \"<string>\",\n \"number_serie\": \"<string>\",\n \"issuer_name\": \"<string>\",\n \"invoice_type\": \"<string>\",\n \"operation_description\": \"<string>\",\n \"operation_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"rectified_invoice_id\": 123,\n \"has_unidentified_recipient\": true,\n \"recipient_legal_name\": \"<string>\",\n \"recipient_document_type\": \"<string>\",\n \"recipient_document_number\": \"<string>\",\n \"recipient_billing_address\": \"<string>\",\n \"recipient_billing_postal_code\": \"<string>\",\n \"recipient_billing_city\": \"<string>\",\n \"contact_id\": 123,\n \"invoiceable_serie_id\": 123,\n \"payment_method\": \"<string>\",\n \"payment_method_info\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"recipient_country_code\": \"<string>\",\n \"footer_note\": \"<string>\",\n \"total_reimbursable_expenses_amount\": 123,\n \"paid\": true,\n \"lines\": [\n {\n \"position\": 123,\n \"concept\": \"<string>\",\n \"units\": 123,\n \"unit_price\": 123,\n \"discount_percent\": 123,\n \"notes\": \"<string>\",\n \"tax_type\": \"<string>\",\n \"tax_regime\": \"<string>\",\n \"tax_operation_key\": \"<string>\",\n \"tax_exemption_code\": \"<string>\",\n \"tax_rate\": 123,\n \"income_tax_withholding_rate\": 123\n }\n ]\n }\n ],\n \"external_batch_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://app.yofacturo.es/api/v1/invoice_batches")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoice_batch\": {\n \"invoices\": [\n {\n \"external_invoice_id\": \"<string>\",\n \"issuer_nif\": \"<string>\",\n \"number_serie\": \"<string>\",\n \"issuer_name\": \"<string>\",\n \"invoice_type\": \"<string>\",\n \"operation_description\": \"<string>\",\n \"operation_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"rectified_invoice_id\": 123,\n \"has_unidentified_recipient\": true,\n \"recipient_legal_name\": \"<string>\",\n \"recipient_document_type\": \"<string>\",\n \"recipient_document_number\": \"<string>\",\n \"recipient_billing_address\": \"<string>\",\n \"recipient_billing_postal_code\": \"<string>\",\n \"recipient_billing_city\": \"<string>\",\n \"contact_id\": 123,\n \"invoiceable_serie_id\": 123,\n \"payment_method\": \"<string>\",\n \"payment_method_info\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"recipient_country_code\": \"<string>\",\n \"footer_note\": \"<string>\",\n \"total_reimbursable_expenses_amount\": 123,\n \"paid\": true,\n \"lines\": [\n {\n \"position\": 123,\n \"concept\": \"<string>\",\n \"units\": 123,\n \"unit_price\": 123,\n \"discount_percent\": 123,\n \"notes\": \"<string>\",\n \"tax_type\": \"<string>\",\n \"tax_regime\": \"<string>\",\n \"tax_operation_key\": \"<string>\",\n \"tax_exemption_code\": \"<string>\",\n \"tax_rate\": 123,\n \"income_tax_withholding_rate\": 123\n }\n ]\n }\n ],\n \"external_batch_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.yofacturo.es/api/v1/invoice_batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoice_batch\": {\n \"invoices\": [\n {\n \"external_invoice_id\": \"<string>\",\n \"issuer_nif\": \"<string>\",\n \"number_serie\": \"<string>\",\n \"issuer_name\": \"<string>\",\n \"invoice_type\": \"<string>\",\n \"operation_description\": \"<string>\",\n \"operation_date\": \"2023-12-25\",\n \"due_date\": \"2023-12-25\",\n \"rectified_invoice_id\": 123,\n \"has_unidentified_recipient\": true,\n \"recipient_legal_name\": \"<string>\",\n \"recipient_document_type\": \"<string>\",\n \"recipient_document_number\": \"<string>\",\n \"recipient_billing_address\": \"<string>\",\n \"recipient_billing_postal_code\": \"<string>\",\n \"recipient_billing_city\": \"<string>\",\n \"contact_id\": 123,\n \"invoiceable_serie_id\": 123,\n \"payment_method\": \"<string>\",\n \"payment_method_info\": \"<string>\",\n \"operation_type\": \"<string>\",\n \"recipient_country_code\": \"<string>\",\n \"footer_note\": \"<string>\",\n \"total_reimbursable_expenses_amount\": 123,\n \"paid\": true,\n \"lines\": [\n {\n \"position\": 123,\n \"concept\": \"<string>\",\n \"units\": 123,\n \"unit_price\": 123,\n \"discount_percent\": 123,\n \"notes\": \"<string>\",\n \"tax_type\": \"<string>\",\n \"tax_regime\": \"<string>\",\n \"tax_operation_key\": \"<string>\",\n \"tax_exemption_code\": \"<string>\",\n \"tax_rate\": 123,\n \"income_tax_withholding_rate\": 123\n }\n ]\n }\n ],\n \"external_batch_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"external_batch_id": "batch-f4ac4fcf-2db2-4dc5-9f6b-9a0f9f38ec10",
"status": "received",
"invoices_count": 1,
"received_at": "2026-03-26T10:30:00Z",
"processed_at": null
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
UUID key used to make POST invoice_batches idempotent.
Body
application/json
Show child attributes
Show child attributes
⌘I

