openapi: 3.0.3
servers:
  - url: https://api.verifacti.com/
info:
  title: Documentación de la API SII
  contact:
    email: info@verifacti.com
    name: Contacto
    url: https://www.verifacti.com
  description: |

    &nbsp;

    Aquí encontrarás la documentación técnica de nuestra API para enviar a la Agencia Estatal de Administración Tributaria (AEAT) el libro registro de facturas expedidas
    de acuerdo al Suministro Inmediato de Información (SII).

    &nbsp;

    También disponemos de APIs para cumplir con los requisitos de Verifactu y de TicketBai, el análogo a Verifactu en el País Vasco. Se trata de APIs
    separadas pero con una estructura análoga. Su documentación se puede encontrar <a href="https://www.verifacti.com/docs">aquí</a> y <a href="https://www.verifacti.com/tb-docs">aquí</a>.

    &nbsp;

    Asimismo, hemos creado una API para poder gestionar los diferentes NIFs de manera programática. Para usuarios que solo deben gestionar
    unos pocos NIFs, esto se puede hacer de manera cómoda a través de nuestra interfaz. Sin embargo, en ocasiones esto no es práctico y hace falta tener
    una manera programática de dar de alta y de baja diferentes NIFs. Para ello, se puede utilizar nuestra API de gestión de NIFs, cuya documentación se
    puede consultar <a href="https://www.verifacti.com/nifs-docs">aquí</a>. Esta API está incluida en el precio y se puede usar por cualquier usuario
    con una suscripción activa.

    # Comparativa entre la API de la AEAT y la API de Verifacti

    El servicio web que la Agencia Estatal de Administración Tributaria (AEAT) ha puesto a disposición de los contribuyentes para el SII
    requiere seguir los siguientes pasos:

    &nbsp;

    <ol style="list-style: decimal;">
      <li>Componer un fichero XML con los registros de las facturas, siguiendo los esquemas del SII.</li>
      <li>Agrupar las facturas en envíos de hasta 10.000 registros, ya que la AEAT pide no enviarlas de una en una.</li>
      <li>Enviar dicho fichero XML a la AEAT mediante una llamada autenticada usando un certificado electrónico cualificado reconocido.</li>
      <li>Revisar la respuesta de cada registro y volver a enviar los rechazados, dentro del plazo de 4 días hábiles desde la expedición de la factura.</li>
      <li>Guardar los envíos y sus respuestas.</li>
    </ol>

    &nbsp;

    Usando nuestra API del SII, todos estos pasos se simplifican en un solo paso:

    &nbsp;

    <ol style="list-style: decimal;">
      <li>Hacer una llamada (sin certificado) con los datos de la factura en formato JSON.</li>
    </ol>

    &nbsp;

    Nosotros nos encargamos de los ficheros XML, la agrupación de las facturas en envíos, la llamada autenticada, las respuestas de la AEAT y el
    almacenaje de los envíos.

    &nbsp;

    En cualquier momento puedes comprobar el estado de todos tus envíos y facturas via API. Además, dispondrás de un sencillo dashboard
    para hacerlo de forma más cómoda. Esto puede resultar especialmente útil en el momento de hacer las primeras pruebas e integración. Ahí
    también encontrarás ejemplos de las distintas llamadas e incluso una terminal para que puedas hacer pruebas sin necesidad de usar
    POSTMAN, por ejemplo.

    # Funcionamiento básico

    La AEAT dispone de un entorno de pruebas y de un entorno de producción para el SII.
    La API de Verifacti dispone, de la misma forma, de un entorno de pruebas y de un entorno de producción.
    Por lo tanto, en ambos casos, la API de Verifacti se comunica con la AEAT en el entorno que corresponda para realizar los envíos.

    &nbsp;

    Al registrar un NIF con la hacienda <code>sii</code> en nuestro dashboard, se generará una API key (de test o de producción), que deberás incluir en el header
    <code>Authorization</code> para cualquier llamada. De esa forma, el NIF del titular del libro y el entorno vienen determinados por la API key que se esté usando.

    &nbsp;

    Para registrar una factura, se hace una llamada al endpoint POST <code>/sii/create</code> con los datos de la factura en el cuerpo de la llamada, en formato JSON.
    La respuesta a dicha llamada consiste en un identificador único para poder consultar el estado del registro.
    Para registrar varias facturas en una sola llamada, hasta 500, se usa POST <code>/sii/create_bulk</code>.

    &nbsp;

    Debido a que el SII pide agrupar las facturas, el registro se encola y se envía a la AEAT junto con el resto de registros pendientes del mismo NIF.
    Cada NIF hace como mucho un envío cada 6 minutos: si no ha enviado nada recientemente, el registro sale en el minuto siguiente.
    Cuando la AEAT responde, se actualiza el estado del registro en nuestro sistema, que se puede consultar en cualquier momento o recibir mediante webhooks.

    Los registros de modificación y de anulación siguen el mismo funcionamiento de encolamiento.

    &nbsp;

    Si la AEAT rechaza una factura (estado <code>Incorrecto</code>), la factura no queda registrada: se corrigen los datos y se vuelve a enviar con POST
    <code>/sii/create</code>. Si la acepta con errores (estado <code>Aceptado con errores</code>), se corrige con PUT <code>/sii/modify</code>.

    &nbsp;

    Los datos del entorno de pruebas se guardan un máximo de 90 días.

    # Idempotencia

    Los endpoints de mutación (<code>/create</code>, <code>/modify</code> y <code>/cancel</code>) aceptan una cabecera
    opcional <code>Idempotency-Key</code> para hacer reintentos seguros tras fallos de red. La clave es una cadena
    ASCII imprimible de 1 a 255 caracteres y se recuerda 24 horas por NIF. Los detalles completos y códigos de error (<code>400</code>, <code>409</code>, <code>422</code>) se documentan en
    cada endpoint afectado.

    Cómo se comporta:

    <ul style="list-style: disc;">
      <li><strong>Qué se repite.</strong> Un reintento con la misma clave y exactamente el mismo cuerpo devuelve el código y el cuerpo de la primera respuesta, con la cabecera <code>Idempotent-Replayed: true</code>, sin generar un registro nuevo.</li>
      <li><strong>Qué respuestas se guardan.</strong> Las <code>2xx</code> y las <code>4xx</code>, que son resultados definitivos: un <code>400</code> también se repite, así que si corriges los datos usa una clave nueva. Las <code>5xx</code> no se guardan: el reintento se procesa de nuevo y se vuelven a validar todos los datos, <code>fecha_expedicion</code> incluida.</li>
      <li><strong>Cuánto dura.</strong> 24 horas desde que se guarda la primera respuesta. Los reintentos no alargan el plazo; pasado ese tiempo la clave se olvida y la petición se procesa como nueva.</li>
      <li><strong>A qué está ligada.</strong> Al NIF del titular, no a la API key, así que sobrevive a una rotación de la clave. Una petición rechazada al autenticar (<code>401</code> o <code>403</code>) no llega a usar la clave.</li>
      <li><strong>Si la primera petición sigue en curso</strong>, el reintento recibe <code>409</code>: espera unos segundos y repite.</li>
      <li><strong>Si han pasado más de 24 horas</strong> y no tienes la respuesta, comprueba con <code>POST /sii/list</code> (<code>ejercicio</code> y <code>periodo</code>) si la factura llegó a registrarse antes de volver a enviarla.</li>
    </ul>
paths:
  /sii/health:
    get:
      summary: Estado API
      description: "Devuelve el estado de la API key: sirve para comprobar que la API está activa y a qué NIF, entorno y hacienda corresponde."
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |
            curl 'https://api.verifacti.com/sii/health' \
            --header 'Authorization: Bearer <API_KEY>'
        - lang: Python
          label: Python
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/health'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            response = requests.get(url, headers=headers)
            print(response.json())
        - lang: JavaScript
          label: JavaScript
          source: |
            const url = 'https://api.verifacti.com/sii/health';
            const headers = {
              'Authorization': 'Bearer <API_KEY>'
            };
            fetch(url, { headers })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js
          source: |-
            const axios = require("axios");

            const response = await axios.get("https://api.verifacti.com/sii/health", {
              headers: {
                "Authorization": "Bearer <API_KEY>"
              },
            });

            console.log(response.data);
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/health";

            $headers = [
                "Authorization: Bearer <API_KEY>",
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.verifacti.com/sii/health\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/health"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .GET()
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C#
          source: |-
            using System;
            using System.Net.Http;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var response = await client.GetAsync("https://api.verifacti.com/sii/health");

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/health"

            oHttp.Open "GET", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"

            oHttp.send

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
      responses:
        "200":
          description: Estado de la API
          content:
            application/json:
              schema:
                type: object
                properties:
                  estado:
                    description: Estado de la API.
                    type: string
                    example: OK
                  nif:
                    description: NIF del titular.
                    type: string
                    example: B12345678
                  entorno:
                    description: Entorno de la API key.
                    type: string
                    enum:
                      - test
                      - prod
                    example: test
                  hacienda:
                    description: Hacienda del NIF.
                    type: string
                    example: sii
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/NifInactivo"
  /sii/status:
    get:
      summary: Estado registro
      description: Devuelve el estado de un registro (alta, modificación o anulación) a partir del <code>uuid</code> que devolvió su creación. En el entorno de test los registros se guardan un máximo de 90 días.
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |
            curl 'https://api.verifacti.com/sii/status?uuid=ea6eae92-bac6-48c3-baa4-2bbf6b5ee562' \
            --header 'Authorization: Bearer <API_KEY>'
        - lang: Python
          label: Python
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/status?uuid=ea6eae92-bac6-48c3-baa4-2bbf6b5ee562'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            response = requests.get(url, headers=headers)
            print(response.json())
        - lang: JavaScript
          label: JavaScript
          source: |
            const url = 'https://api.verifacti.com/sii/status?uuid=ea6eae92-bac6-48c3-baa4-2bbf6b5ee562';
            const headers = {
              'Authorization': 'Bearer <API_KEY>'
            };
            fetch(url, { headers })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js
          source: |-
            const axios = require("axios");

            const response = await axios.get("https://api.verifacti.com/sii/status?uuid=ea6eae92-bac6-48c3-baa4-2bbf6b5ee562", {
              headers: {
                "Authorization": "Bearer <API_KEY>"
              },
            });

            console.log(response.data);
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/status?uuid=ea6eae92-bac6-48c3-baa4-2bbf6b5ee562";

            $headers = [
                "Authorization: Bearer <API_KEY>",
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.verifacti.com/sii/status?uuid=ea6eae92-bac6-48c3-baa4-2bbf6b5ee562\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/status?uuid=ea6eae92-bac6-48c3-baa4-2bbf6b5ee562"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .GET()
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C#
          source: |-
            using System;
            using System.Net.Http;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var response = await client.GetAsync("https://api.verifacti.com/sii/status?uuid=ea6eae92-bac6-48c3-baa4-2bbf6b5ee562");

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/status?uuid=ea6eae92-bac6-48c3-baa4-2bbf6b5ee562"

            oHttp.Open "GET", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"

            oHttp.send

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
      parameters:
        - in: query
          name: uuid
          required: true
          description: uuid del registro.
          schema:
            type: string
            example: ea6eae92-bac6-48c3-baa4-2bbf6b5ee562
      responses:
        "200":
          description: Estado del registro
          content:
            application/json:
              schema:
                type: object
                properties:
                  nif:
                    type: string
                    description: NIF del titular.
                    example: B12345678
                  serie:
                    type: string
                    description: Serie de la factura.
                    example: A
                  numero:
                    type: string
                    description: Número de la factura.
                    example: "1"
                  fecha_expedicion:
                    type: string
                    description: Fecha de expedición.
                    example: CURRENT_DATE
                  operacion:
                    type: string
                    enum:
                      - Alta
                      - Modificación
                      - Baja
                    description: Operación del registro.
                    example: Alta
                  estado:
                    type: string
                    enum:
                      - Pendiente
                      - Correcto
                      - Aceptado con errores
                      - Incorrecto
                      - Duplicado
                      - Anulado
                      - Factura inexistente
                      - No registrado
                    description: "Estado del registro:<ul style=\"list-style: disc;\"><li><code>Pendiente</code>: en cola, aún no enviado a la AEAT.</li><li><code>Correcto</code>: la AEAT lo ha registrado.</li><li><code>Aceptado con errores</code>: la AEAT lo ha registrado con errores (ver <code>codigo_error</code> y <code>mensaje_error</code>). Corrígelo con <code>/sii/modify</code>.</li><li><code>Incorrecto</code>: la AEAT lo ha rechazado. No está registrado: corrige los datos y vuelve a enviarlo con <code>/sii/create</code>.</li><li><code>Duplicado</code>: la AEAT ya tenía esa factura (misma serie, número y fecha). Su estado en el libro va en <code>estado_registro_duplicado</code>.</li><li><code>Anulado</code>: anulación registrada por la AEAT.</li><li><code>Factura inexistente</code>: anulación de una factura que la AEAT no tiene registrada.</li><li><code>No registrado</code>: la AEAT rechazó el envío entero sin registrar nada (por ejemplo, por un error en la cabecera). Vuelve a enviarlo con <code>/sii/create</code>.</li></ul>"
                    example: Correcto
                  codigo_error:
                    type: string
                    nullable: true
                    description: Código de error de la AEAT, si lo hay.
                    example: null
                  mensaje_error:
                    type: string
                    nullable: true
                    description: Descripción del error de la AEAT, si la hay.
                    example: null
                  estado_registro_duplicado:
                    type: string
                    nullable: true
                    enum:
                      - Correcta
                      - AceptadaConErrores
                      - Anulada
                      - null
                    description: "Solo en <code>Duplicado</code>: estado de la factura que la AEAT ya tenía."
                    example: null
        "400":
          description: Falta el uuid.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/NifInactivo"
        "404":
          description: No existe un registro con ese uuid para este NIF.
  /sii/create:
    post:
      summary: Crear factura nueva
      description: |-
        Crea el registro de alta (A0) de una factura emitida en el libro registro de facturas expedidas. Respuestas:
        <ul style="list-style: disc;">
          <li><strong>200</strong>: la factura es válida y queda en cola con el estado <code>Pendiente</code>. Se envía a la AEAT en el siguiente envío del NIF. Que la aceptemos no garantiza que la AEAT la acepte: el resultado se consulta con <code>GET /sii/status</code> usando el <code>uuid</code>, o llega a tus webhooks (documentación <a href='https://www.verifacti.com/nifs-docs#tag/Webhooks' target='_blank'>aquí</a>).</li>
          <li><strong>400</strong>: error en el JSON. No se genera el registro ni se envía nada. El mensaje va en <code>error</code> y un identificador estable en <code>codigo</code>. Las validaciones van desde campos obligatorios hasta las reglas de la AEAT y la comprobación de que la contraparte está censada.</li>
          <li><strong>500</strong>: error del servidor. No se genera el registro; reintenta más tarde.</li>
        </ul>

        Las validaciones y errores de la AEAT para el SII se pueden consultar <a href='https://sede.agenciatributaria.gob.es/Sede/iva/suministro-inmediato-informacion/informacion-tecnica/documento-validaciones-errores.html' target='_blank'>aquí</a>.

        &nbsp;

        Este endpoint admite además una cabecera opcional `Idempotency-Key`. Si se incluye, los reintentos de la misma petición lógica con la misma clave replican la respuesta original (incluyendo la cabecera de respuesta `Idempotent-Replayed: true` y el eco de `Idempotency-Key`). Las claves se vinculan al NIF y se recuerdan durante 24 horas. Reusar la misma clave con un cuerpo diferente devuelve 422; un reintento concurrente mientras el primero sigue en curso devuelve 409. Consulta la sección "Idempotencia" al inicio de esta documentación para más detalles.
      x-codeSamples:
        - lang: cURL
          label: cURL — Factura normal
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }'
        - lang: Python
          label: Python — Factura normal
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Factura normal
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Factura normal
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Factura normal
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Factura normal
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura normal\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"200\",\n          \"cuota_repercutida\": \"42\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"242\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Factura normal
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura normal",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "200",
                                      "cuota_repercutida": "42"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "242"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Factura normal
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura normal"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""200"",
                      ""cuota_repercutida"": ""42""
                    }
                  ]
                }
              },
              ""importe_total"": ""242""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Factura normal
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura normal""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""242""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Factura simplificada
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F2",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura simplificada",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }'
        - lang: Python
          label: Python — Factura simplificada
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F2",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura simplificada",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Factura simplificada
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F2",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura simplificada",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Factura simplificada
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F2",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura simplificada",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Factura simplificada
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F2",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura simplificada",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Factura simplificada
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F2\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura simplificada\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"200\",\n          \"cuota_repercutida\": \"42\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"242\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Factura simplificada
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F2",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura simplificada",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "200",
                                      "cuota_repercutida": "42"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "242"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Factura simplificada
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F2"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura simplificada"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""200"",
                      ""cuota_repercutida"": ""42""
                    }
                  ]
                }
              },
              ""importe_total"": ""242""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Factura simplificada
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F2""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura simplificada""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""242""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Múltiples IVAs
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con múltiples IVAs",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    },
                    {
                      "tipo_impositivo": "10",
                      "base_imponible": "100",
                      "cuota_repercutida": "10"
                    },
                    {
                      "tipo_impositivo": "4",
                      "base_imponible": "50",
                      "cuota_repercutida": "2"
                    }
                  ]
                }
              },
              "importe_total": "404"
            }'
        - lang: Python
          label: Python — Múltiples IVAs
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con múltiples IVAs",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    },
                    {
                      "tipo_impositivo": "10",
                      "base_imponible": "100",
                      "cuota_repercutida": "10"
                    },
                    {
                      "tipo_impositivo": "4",
                      "base_imponible": "50",
                      "cuota_repercutida": "2"
                    }
                  ]
                }
              },
              "importe_total": "404"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Múltiples IVAs
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con múltiples IVAs",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    },
                    {
                      "tipo_impositivo": "10",
                      "base_imponible": "100",
                      "cuota_repercutida": "10"
                    },
                    {
                      "tipo_impositivo": "4",
                      "base_imponible": "50",
                      "cuota_repercutida": "2"
                    }
                  ]
                }
              },
              "importe_total": "404"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Múltiples IVAs
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con múltiples IVAs",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    },
                    {
                      "tipo_impositivo": "10",
                      "base_imponible": "100",
                      "cuota_repercutida": "10"
                    },
                    {
                      "tipo_impositivo": "4",
                      "base_imponible": "50",
                      "cuota_repercutida": "2"
                    }
                  ]
                }
              },
              "importe_total": "404"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Múltiples IVAs
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con múltiples IVAs",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    },
                    {
                      "tipo_impositivo": "10",
                      "base_imponible": "100",
                      "cuota_repercutida": "10"
                    },
                    {
                      "tipo_impositivo": "4",
                      "base_imponible": "50",
                      "cuota_repercutida": "2"
                    }
                  ]
                }
              },
              "importe_total": "404"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Múltiples IVAs
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura con múltiples IVAs\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"200\",\n          \"cuota_repercutida\": \"42\"\n        },\n        {\n          \"tipo_impositivo\": \"10\",\n          \"base_imponible\": \"100\",\n          \"cuota_repercutida\": \"10\"\n        },\n        {\n          \"tipo_impositivo\": \"4\",\n          \"base_imponible\": \"50\",\n          \"cuota_repercutida\": \"2\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"404\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Múltiples IVAs
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura con múltiples IVAs",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "200",
                                      "cuota_repercutida": "42"
                                    },
                                    {
                                      "tipo_impositivo": "10",
                                      "base_imponible": "100",
                                      "cuota_repercutida": "10"
                                    },
                                    {
                                      "tipo_impositivo": "4",
                                      "base_imponible": "50",
                                      "cuota_repercutida": "2"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "404"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Múltiples IVAs
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura con múltiples IVAs"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""200"",
                      ""cuota_repercutida"": ""42""
                    },
                    {
                      ""tipo_impositivo"": ""10"",
                      ""base_imponible"": ""100"",
                      ""cuota_repercutida"": ""10""
                    },
                    {
                      ""tipo_impositivo"": ""4"",
                      ""base_imponible"": ""50"",
                      ""cuota_repercutida"": ""2""
                    }
                  ]
                }
              },
              ""importe_total"": ""404""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Múltiples IVAs
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura con múltiples IVAs""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "        }," & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""10""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""100""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""10""" & vbCrLf
            sBody = sBody & "        }," & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""4""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""50""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""2""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""404""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — B2B intracomunitaria - Venta de bienes
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E5",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            }'
        - lang: Python
          label: Python — B2B intracomunitaria - Venta de bienes
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E5",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — B2B intracomunitaria - Venta de bienes
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E5",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — B2B intracomunitaria - Venta de bienes
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E5",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — B2B intracomunitaria - Venta de bienes
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E5",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — B2B intracomunitaria - Venta de bienes
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura B2B intracomunitaria - Venta de bienes\",\n  \"nombre\": \"Nombre destinatario\",\n  \"id_otro\": {\n    \"id_type\": \"02\",\n    \"id\": \"BE0404621642\"\n  },\n  \"desglose\": {\n    \"entrega\": {\n      \"exenta\": [\n        {\n          \"causa_exencion\": \"E5\",\n          \"base_imponible\": \"200\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"200\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — B2B intracomunitaria - Venta de bienes
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
                              "nombre": "Nombre destinatario",
                              "id_otro": {
                                "id_type": "02",
                                "id": "BE0404621642"
                              },
                              "desglose": {
                                "entrega": {
                                  "exenta": [
                                    {
                                      "causa_exencion": "E5",
                                      "base_imponible": "200"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "200"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — B2B intracomunitaria - Venta de bienes
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura B2B intracomunitaria - Venta de bienes"",
              ""nombre"": ""Nombre destinatario"",
              ""id_otro"": {
                ""id_type"": ""02"",
                ""id"": ""BE0404621642""
              },
              ""desglose"": {
                ""entrega"": {
                  ""exenta"": [
                    {
                      ""causa_exencion"": ""E5"",
                      ""base_imponible"": ""200""
                    }
                  ]
                }
              },
              ""importe_total"": ""200""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — B2B intracomunitaria - Venta de bienes
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura B2B intracomunitaria - Venta de bienes""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre destinatario""," & vbCrLf
            sBody = sBody & "  ""id_otro"": {" & vbCrLf
            sBody = sBody & "    ""id_type"": ""02""," & vbCrLf
            sBody = sBody & "    ""id"": ""BE0404621642""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""entrega"": {" & vbCrLf
            sBody = sBody & "      ""exenta"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""causa_exencion"": ""E5""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""200""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — B2B intracomunitaria - Prestación de servicios
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            }'
        - lang: Python
          label: Python — B2B intracomunitaria - Prestación de servicios
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — B2B intracomunitaria - Prestación de servicios
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — B2B intracomunitaria - Prestación de servicios
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — B2B intracomunitaria - Prestación de servicios
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2B intracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "id_type": "02",
                "id": "BE0404621642"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — B2B intracomunitaria - Prestación de servicios
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura B2B intracomunitaria - Prestación de servicios\",\n  \"nombre\": \"Nombre destinatario\",\n  \"id_otro\": {\n    \"id_type\": \"02\",\n    \"id\": \"BE0404621642\"\n  },\n  \"desglose\": {\n    \"prestacion_servicios\": {\n      \"no_sujeta\": {\n        \"importe_tai_reglas_localizacion\": \"200\"\n      }\n    }\n  },\n  \"importe_total\": \"200\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — B2B intracomunitaria - Prestación de servicios
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura B2B intracomunitaria - Prestación de servicios",
                              "nombre": "Nombre destinatario",
                              "id_otro": {
                                "id_type": "02",
                                "id": "BE0404621642"
                              },
                              "desglose": {
                                "prestacion_servicios": {
                                  "no_sujeta": {
                                    "importe_tai_reglas_localizacion": "200"
                                  }
                                }
                              },
                              "importe_total": "200"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — B2B intracomunitaria - Prestación de servicios
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura B2B intracomunitaria - Prestación de servicios"",
              ""nombre"": ""Nombre destinatario"",
              ""id_otro"": {
                ""id_type"": ""02"",
                ""id"": ""BE0404621642""
              },
              ""desglose"": {
                ""prestacion_servicios"": {
                  ""no_sujeta"": {
                    ""importe_tai_reglas_localizacion"": ""200""
                  }
                }
              },
              ""importe_total"": ""200""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — B2B intracomunitaria - Prestación de servicios
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura B2B intracomunitaria - Prestación de servicios""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre destinatario""," & vbCrLf
            sBody = sBody & "  ""id_otro"": {" & vbCrLf
            sBody = sBody & "    ""id_type"": ""02""," & vbCrLf
            sBody = sBody & "    ""id"": ""BE0404621642""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""prestacion_servicios"": {" & vbCrLf
            sBody = sBody & "      ""no_sujeta"": {" & vbCrLf
            sBody = sBody & "        ""importe_tai_reglas_localizacion"": ""200""" & vbCrLf
            sBody = sBody & "      }" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""200""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — B2C intracomunitaria - Por debajo del umbral
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2C intracomunitaria - Por debajo del umbral",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                }
              },
              "importe_total": "242"
            }'
        - lang: Python
          label: Python — B2C intracomunitaria - Por debajo del umbral
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2C intracomunitaria - Por debajo del umbral",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                }
              },
              "importe_total": "242"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — B2C intracomunitaria - Por debajo del umbral
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2C intracomunitaria - Por debajo del umbral",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                }
              },
              "importe_total": "242"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — B2C intracomunitaria - Por debajo del umbral
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2C intracomunitaria - Por debajo del umbral",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                }
              },
              "importe_total": "242"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — B2C intracomunitaria - Por debajo del umbral
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura B2C intracomunitaria - Por debajo del umbral",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                }
              },
              "importe_total": "242"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — B2C intracomunitaria - Por debajo del umbral
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura B2C intracomunitaria - Por debajo del umbral\",\n  \"nombre\": \"Nombre destinatario\",\n  \"id_otro\": {\n    \"codigo_pais\": \"DE\",\n    \"id_type\": \"03\",\n    \"id\": \"F8624KW3J6\"\n  },\n  \"desglose\": {\n    \"entrega\": {\n      \"no_exenta\": {\n        \"tipo_no_exenta\": \"S1\",\n        \"detalle_iva\": [\n          {\n            \"tipo_impositivo\": \"21\",\n            \"base_imponible\": \"200\",\n            \"cuota_repercutida\": \"42\"\n          }\n        ]\n      }\n    }\n  },\n  \"importe_total\": \"242\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — B2C intracomunitaria - Por debajo del umbral
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura B2C intracomunitaria - Por debajo del umbral",
                              "nombre": "Nombre destinatario",
                              "id_otro": {
                                "codigo_pais": "DE",
                                "id_type": "03",
                                "id": "F8624KW3J6"
                              },
                              "desglose": {
                                "entrega": {
                                  "no_exenta": {
                                    "tipo_no_exenta": "S1",
                                    "detalle_iva": [
                                      {
                                        "tipo_impositivo": "21",
                                        "base_imponible": "200",
                                        "cuota_repercutida": "42"
                                      }
                                    ]
                                  }
                                }
                              },
                              "importe_total": "242"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — B2C intracomunitaria - Por debajo del umbral
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura B2C intracomunitaria - Por debajo del umbral"",
              ""nombre"": ""Nombre destinatario"",
              ""id_otro"": {
                ""codigo_pais"": ""DE"",
                ""id_type"": ""03"",
                ""id"": ""F8624KW3J6""
              },
              ""desglose"": {
                ""entrega"": {
                  ""no_exenta"": {
                    ""tipo_no_exenta"": ""S1"",
                    ""detalle_iva"": [
                      {
                        ""tipo_impositivo"": ""21"",
                        ""base_imponible"": ""200"",
                        ""cuota_repercutida"": ""42""
                      }
                    ]
                  }
                }
              },
              ""importe_total"": ""242""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — B2C intracomunitaria - Por debajo del umbral
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura B2C intracomunitaria - Por debajo del umbral""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre destinatario""," & vbCrLf
            sBody = sBody & "  ""id_otro"": {" & vbCrLf
            sBody = sBody & "    ""codigo_pais"": ""DE""," & vbCrLf
            sBody = sBody & "    ""id_type"": ""03""," & vbCrLf
            sBody = sBody & "    ""id"": ""F8624KW3J6""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""entrega"": {" & vbCrLf
            sBody = sBody & "      ""no_exenta"": {" & vbCrLf
            sBody = sBody & "        ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "        ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "          {" & vbCrLf
            sBody = sBody & "            ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "            ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "            ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "          }" & vbCrLf
            sBody = sBody & "        ]" & vbCrLf
            sBody = sBody & "      }" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""242""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — B2C intracomunitaria - OSS
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "17"
              ],
              "descripcion": "Factura B2C intracomunitaria - OSS",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            }'
        - lang: Python
          label: Python — B2C intracomunitaria - OSS
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "17"
              ],
              "descripcion": "Factura B2C intracomunitaria - OSS",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — B2C intracomunitaria - OSS
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "17"
              ],
              "descripcion": "Factura B2C intracomunitaria - OSS",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — B2C intracomunitaria - OSS
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "17"
              ],
              "descripcion": "Factura B2C intracomunitaria - OSS",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — B2C intracomunitaria - OSS
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "17"
              ],
              "descripcion": "Factura B2C intracomunitaria - OSS",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "DE",
                "id_type": "03",
                "id": "F8624KW3J6"
              },
              "desglose": {
                "entrega": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — B2C intracomunitaria - OSS
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"17\"\n  ],\n  \"descripcion\": \"Factura B2C intracomunitaria - OSS\",\n  \"nombre\": \"Nombre destinatario\",\n  \"id_otro\": {\n    \"codigo_pais\": \"DE\",\n    \"id_type\": \"03\",\n    \"id\": \"F8624KW3J6\"\n  },\n  \"desglose\": {\n    \"entrega\": {\n      \"no_sujeta\": {\n        \"importe_tai_reglas_localizacion\": \"200\"\n      }\n    }\n  },\n  \"importe_total\": \"200\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — B2C intracomunitaria - OSS
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "17"
                              ],
                              "descripcion": "Factura B2C intracomunitaria - OSS",
                              "nombre": "Nombre destinatario",
                              "id_otro": {
                                "codigo_pais": "DE",
                                "id_type": "03",
                                "id": "F8624KW3J6"
                              },
                              "desglose": {
                                "entrega": {
                                  "no_sujeta": {
                                    "importe_tai_reglas_localizacion": "200"
                                  }
                                }
                              },
                              "importe_total": "200"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — B2C intracomunitaria - OSS
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""17""
              ],
              ""descripcion"": ""Factura B2C intracomunitaria - OSS"",
              ""nombre"": ""Nombre destinatario"",
              ""id_otro"": {
                ""codigo_pais"": ""DE"",
                ""id_type"": ""03"",
                ""id"": ""F8624KW3J6""
              },
              ""desglose"": {
                ""entrega"": {
                  ""no_sujeta"": {
                    ""importe_tai_reglas_localizacion"": ""200""
                  }
                }
              },
              ""importe_total"": ""200""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — B2C intracomunitaria - OSS
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""17""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura B2C intracomunitaria - OSS""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre destinatario""," & vbCrLf
            sBody = sBody & "  ""id_otro"": {" & vbCrLf
            sBody = sBody & "    ""codigo_pais"": ""DE""," & vbCrLf
            sBody = sBody & "    ""id_type"": ""03""," & vbCrLf
            sBody = sBody & "    ""id"": ""F8624KW3J6""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""entrega"": {" & vbCrLf
            sBody = sBody & "      ""no_sujeta"": {" & vbCrLf
            sBody = sBody & "        ""importe_tai_reglas_localizacion"": ""200""" & vbCrLf
            sBody = sBody & "      }" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""200""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: "cURL — Extracomunitaria: Exportación de bienes"
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "02"
              ],
              "descripcion": "Factura extracomunitaria - Exportación de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E2",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            }'
        - lang: Python
          label: "Python — Extracomunitaria: Exportación de bienes"
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "02"
              ],
              "descripcion": "Factura extracomunitaria - Exportación de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E2",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: "JavaScript — Extracomunitaria: Exportación de bienes"
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "02"
              ],
              "descripcion": "Factura extracomunitaria - Exportación de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E2",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: "Node.js — Extracomunitaria: Exportación de bienes"
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "02"
              ],
              "descripcion": "Factura extracomunitaria - Exportación de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E2",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: "PHP — Extracomunitaria: Exportación de bienes"
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "02"
              ],
              "descripcion": "Factura extracomunitaria - Exportación de bienes",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "entrega": {
                  "exenta": [
                    {
                      "causa_exencion": "E2",
                      "base_imponible": "200"
                    }
                  ]
                }
              },
              "importe_total": "200"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: "Go — Extracomunitaria: Exportación de bienes"
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"02\"\n  ],\n  \"descripcion\": \"Factura extracomunitaria - Exportación de bienes\",\n  \"nombre\": \"Nombre destinatario\",\n  \"id_otro\": {\n    \"codigo_pais\": \"US\",\n    \"id_type\": \"03\",\n    \"id\": \"M76543210\"\n  },\n  \"desglose\": {\n    \"entrega\": {\n      \"exenta\": [\n        {\n          \"causa_exencion\": \"E2\",\n          \"base_imponible\": \"200\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"200\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: "Java — Extracomunitaria: Exportación de bienes"
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "02"
                              ],
                              "descripcion": "Factura extracomunitaria - Exportación de bienes",
                              "nombre": "Nombre destinatario",
                              "id_otro": {
                                "codigo_pais": "US",
                                "id_type": "03",
                                "id": "M76543210"
                              },
                              "desglose": {
                                "entrega": {
                                  "exenta": [
                                    {
                                      "causa_exencion": "E2",
                                      "base_imponible": "200"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "200"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: "C# — Extracomunitaria: Exportación de bienes"
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""02""
              ],
              ""descripcion"": ""Factura extracomunitaria - Exportación de bienes"",
              ""nombre"": ""Nombre destinatario"",
              ""id_otro"": {
                ""codigo_pais"": ""US"",
                ""id_type"": ""03"",
                ""id"": ""M76543210""
              },
              ""desglose"": {
                ""entrega"": {
                  ""exenta"": [
                    {
                      ""causa_exencion"": ""E2"",
                      ""base_imponible"": ""200""
                    }
                  ]
                }
              },
              ""importe_total"": ""200""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: "VB6 — Extracomunitaria: Exportación de bienes"
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""02""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura extracomunitaria - Exportación de bienes""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre destinatario""," & vbCrLf
            sBody = sBody & "  ""id_otro"": {" & vbCrLf
            sBody = sBody & "    ""codigo_pais"": ""US""," & vbCrLf
            sBody = sBody & "    ""id_type"": ""03""," & vbCrLf
            sBody = sBody & "    ""id"": ""M76543210""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""entrega"": {" & vbCrLf
            sBody = sBody & "      ""exenta"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""causa_exencion"": ""E2""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""200""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: "cURL — Extracomunitaria: Prestación de servicios"
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura extracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            }'
        - lang: Python
          label: "Python — Extracomunitaria: Prestación de servicios"
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura extracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: "JavaScript — Extracomunitaria: Prestación de servicios"
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura extracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: "Node.js — Extracomunitaria: Prestación de servicios"
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura extracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: "PHP — Extracomunitaria: Prestación de servicios"
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura extracomunitaria - Prestación de servicios",
              "nombre": "Nombre destinatario",
              "id_otro": {
                "codigo_pais": "US",
                "id_type": "03",
                "id": "M76543210"
              },
              "desglose": {
                "prestacion_servicios": {
                  "no_sujeta": {
                    "importe_tai_reglas_localizacion": "200"
                  }
                }
              },
              "importe_total": "200"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: "Go — Extracomunitaria: Prestación de servicios"
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura extracomunitaria - Prestación de servicios\",\n  \"nombre\": \"Nombre destinatario\",\n  \"id_otro\": {\n    \"codigo_pais\": \"US\",\n    \"id_type\": \"03\",\n    \"id\": \"M76543210\"\n  },\n  \"desglose\": {\n    \"prestacion_servicios\": {\n      \"no_sujeta\": {\n        \"importe_tai_reglas_localizacion\": \"200\"\n      }\n    }\n  },\n  \"importe_total\": \"200\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: "Java — Extracomunitaria: Prestación de servicios"
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura extracomunitaria - Prestación de servicios",
                              "nombre": "Nombre destinatario",
                              "id_otro": {
                                "codigo_pais": "US",
                                "id_type": "03",
                                "id": "M76543210"
                              },
                              "desglose": {
                                "prestacion_servicios": {
                                  "no_sujeta": {
                                    "importe_tai_reglas_localizacion": "200"
                                  }
                                }
                              },
                              "importe_total": "200"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: "C# — Extracomunitaria: Prestación de servicios"
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura extracomunitaria - Prestación de servicios"",
              ""nombre"": ""Nombre destinatario"",
              ""id_otro"": {
                ""codigo_pais"": ""US"",
                ""id_type"": ""03"",
                ""id"": ""M76543210""
              },
              ""desglose"": {
                ""prestacion_servicios"": {
                  ""no_sujeta"": {
                    ""importe_tai_reglas_localizacion"": ""200""
                  }
                }
              },
              ""importe_total"": ""200""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: "VB6 — Extracomunitaria: Prestación de servicios"
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura extracomunitaria - Prestación de servicios""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre destinatario""," & vbCrLf
            sBody = sBody & "  ""id_otro"": {" & vbCrLf
            sBody = sBody & "    ""codigo_pais"": ""US""," & vbCrLf
            sBody = sBody & "    ""id_type"": ""03""," & vbCrLf
            sBody = sBody & "    ""id"": ""M76543210""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""prestacion_servicios"": {" & vbCrLf
            sBody = sBody & "      ""no_sujeta"": {" & vbCrLf
            sBody = sBody & "        ""importe_tai_reglas_localizacion"": ""200""" & vbCrLf
            sBody = sBody & "      }" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""200""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Exenta de IVA
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura exenta de IVA",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "exenta": [
                  {
                    "causa_exencion": "E1",
                    "base_imponible": "200"
                  }
                ]
              },
              "importe_total": "200"
            }'
        - lang: Python
          label: Python — Exenta de IVA
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura exenta de IVA",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "exenta": [
                  {
                    "causa_exencion": "E1",
                    "base_imponible": "200"
                  }
                ]
              },
              "importe_total": "200"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Exenta de IVA
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura exenta de IVA",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "exenta": [
                  {
                    "causa_exencion": "E1",
                    "base_imponible": "200"
                  }
                ]
              },
              "importe_total": "200"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Exenta de IVA
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura exenta de IVA",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "exenta": [
                  {
                    "causa_exencion": "E1",
                    "base_imponible": "200"
                  }
                ]
              },
              "importe_total": "200"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Exenta de IVA
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura exenta de IVA",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "exenta": [
                  {
                    "causa_exencion": "E1",
                    "base_imponible": "200"
                  }
                ]
              },
              "importe_total": "200"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Exenta de IVA
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura exenta de IVA\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"exenta\": [\n      {\n        \"causa_exencion\": \"E1\",\n        \"base_imponible\": \"200\"\n      }\n    ]\n  },\n  \"importe_total\": \"200\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Exenta de IVA
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura exenta de IVA",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "exenta": [
                                  {
                                    "causa_exencion": "E1",
                                    "base_imponible": "200"
                                  }
                                ]
                              },
                              "importe_total": "200"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Exenta de IVA
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura exenta de IVA"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""exenta"": [
                  {
                    ""causa_exencion"": ""E1"",
                    ""base_imponible"": ""200""
                  }
                ]
              },
              ""importe_total"": ""200""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Exenta de IVA
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura exenta de IVA""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""exenta"": [" & vbCrLf
            sBody = sBody & "      {" & vbCrLf
            sBody = sBody & "        ""causa_exencion"": ""E1""," & vbCrLf
            sBody = sBody & "        ""base_imponible"": ""200""" & vbCrLf
            sBody = sBody & "      }" & vbCrLf
            sBody = sBody & "    ]" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""200""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Operación no sujeta
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Operación no sujeta",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_por_articulos_7_14_otros": "200"
                }
              },
              "importe_total": "200"
            }'
        - lang: Python
          label: Python — Operación no sujeta
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Operación no sujeta",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_por_articulos_7_14_otros": "200"
                }
              },
              "importe_total": "200"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Operación no sujeta
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Operación no sujeta",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_por_articulos_7_14_otros": "200"
                }
              },
              "importe_total": "200"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Operación no sujeta
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Operación no sujeta",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_por_articulos_7_14_otros": "200"
                }
              },
              "importe_total": "200"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Operación no sujeta
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Operación no sujeta",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_por_articulos_7_14_otros": "200"
                }
              },
              "importe_total": "200"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Operación no sujeta
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Operación no sujeta\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_sujeta\": {\n      \"importe_por_articulos_7_14_otros\": \"200\"\n    }\n  },\n  \"importe_total\": \"200\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Operación no sujeta
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Operación no sujeta",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_sujeta": {
                                  "importe_por_articulos_7_14_otros": "200"
                                }
                              },
                              "importe_total": "200"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Operación no sujeta
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Operación no sujeta"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_sujeta"": {
                  ""importe_por_articulos_7_14_otros"": ""200""
                }
              },
              ""importe_total"": ""200""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Operación no sujeta
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Operación no sujeta""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_sujeta"": {" & vbCrLf
            sBody = sBody & "      ""importe_por_articulos_7_14_otros"": ""200""" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""200""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Operación sujeta a IGIC o IPSI
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "08"
              ],
              "descripcion": "Operación sujeta a IGIC (Canarias)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_tai_reglas_localizacion": "200"
                }
              },
              "importe_total": "200"
            }'
        - lang: Python
          label: Python — Operación sujeta a IGIC o IPSI
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "08"
              ],
              "descripcion": "Operación sujeta a IGIC (Canarias)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_tai_reglas_localizacion": "200"
                }
              },
              "importe_total": "200"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Operación sujeta a IGIC o IPSI
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "08"
              ],
              "descripcion": "Operación sujeta a IGIC (Canarias)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_tai_reglas_localizacion": "200"
                }
              },
              "importe_total": "200"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Operación sujeta a IGIC o IPSI
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "08"
              ],
              "descripcion": "Operación sujeta a IGIC (Canarias)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_tai_reglas_localizacion": "200"
                }
              },
              "importe_total": "200"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Operación sujeta a IGIC o IPSI
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "08"
              ],
              "descripcion": "Operación sujeta a IGIC (Canarias)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_sujeta": {
                  "importe_tai_reglas_localizacion": "200"
                }
              },
              "importe_total": "200"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Operación sujeta a IGIC o IPSI
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"08\"\n  ],\n  \"descripcion\": \"Operación sujeta a IGIC (Canarias)\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_sujeta\": {\n      \"importe_tai_reglas_localizacion\": \"200\"\n    }\n  },\n  \"importe_total\": \"200\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Operación sujeta a IGIC o IPSI
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "08"
                              ],
                              "descripcion": "Operación sujeta a IGIC (Canarias)",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_sujeta": {
                                  "importe_tai_reglas_localizacion": "200"
                                }
                              },
                              "importe_total": "200"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Operación sujeta a IGIC o IPSI
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""08""
              ],
              ""descripcion"": ""Operación sujeta a IGIC (Canarias)"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_sujeta"": {
                  ""importe_tai_reglas_localizacion"": ""200""
                }
              },
              ""importe_total"": ""200""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Operación sujeta a IGIC o IPSI
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""08""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Operación sujeta a IGIC (Canarias)""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_sujeta"": {" & vbCrLf
            sBody = sBody & "      ""importe_tai_reglas_localizacion"": ""200""" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""200""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Factura de abono
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de abono",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-200",
                      "cuota_repercutida": "-42"
                    }
                  ]
                }
              },
              "importe_total": "-242"
            }'
        - lang: Python
          label: Python — Factura de abono
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de abono",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-200",
                      "cuota_repercutida": "-42"
                    }
                  ]
                }
              },
              "importe_total": "-242"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Factura de abono
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de abono",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-200",
                      "cuota_repercutida": "-42"
                    }
                  ]
                }
              },
              "importe_total": "-242"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Factura de abono
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de abono",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-200",
                      "cuota_repercutida": "-42"
                    }
                  ]
                }
              },
              "importe_total": "-242"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Factura de abono
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de abono",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-200",
                      "cuota_repercutida": "-42"
                    }
                  ]
                }
              },
              "importe_total": "-242"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Factura de abono
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura de abono\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"-200\",\n          \"cuota_repercutida\": \"-42\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"-242\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Factura de abono
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura de abono",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "-200",
                                      "cuota_repercutida": "-42"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "-242"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Factura de abono
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura de abono"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""-200"",
                      ""cuota_repercutida"": ""-42""
                    }
                  ]
                }
              },
              ""importe_total"": ""-242""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Factura de abono
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura de abono""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""-200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""-42""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""-242""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Factura de canje
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F3",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de canje de simplificadas",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_sustituidas": [
                {
                  "serie": "SIMPLE",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }'
        - lang: Python
          label: Python — Factura de canje
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F3",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de canje de simplificadas",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_sustituidas": [
                {
                  "serie": "SIMPLE",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Factura de canje
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F3",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de canje de simplificadas",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_sustituidas": [
                {
                  "serie": "SIMPLE",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Factura de canje
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F3",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de canje de simplificadas",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_sustituidas": [
                {
                  "serie": "SIMPLE",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Factura de canje
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F3",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura de canje de simplificadas",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_sustituidas": [
                {
                  "serie": "SIMPLE",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Factura de canje
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F3\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura de canje de simplificadas\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"facturas_sustituidas\": [\n    {\n      \"serie\": \"SIMPLE\",\n      \"numero\": \"1\",\n      \"fecha_expedicion\": \"CURRENT_DATE\"\n    }\n  ],\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"200\",\n          \"cuota_repercutida\": \"42\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"242\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Factura de canje
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F3",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura de canje de simplificadas",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "facturas_sustituidas": [
                                {
                                  "serie": "SIMPLE",
                                  "numero": "1",
                                  "fecha_expedicion": "CURRENT_DATE"
                                }
                              ],
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "200",
                                      "cuota_repercutida": "42"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "242"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Factura de canje
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F3"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura de canje de simplificadas"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""facturas_sustituidas"": [
                {
                  ""serie"": ""SIMPLE"",
                  ""numero"": ""1"",
                  ""fecha_expedicion"": ""CURRENT_DATE""
                }
              ],
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""200"",
                      ""cuota_repercutida"": ""42""
                    }
                  ]
                }
              },
              ""importe_total"": ""242""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Factura de canje
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F3""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura de canje de simplificadas""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""facturas_sustituidas"": [" & vbCrLf
            sBody = sBody & "    {" & vbCrLf
            sBody = sBody & "      ""serie"": ""SIMPLE""," & vbCrLf
            sBody = sBody & "      ""numero"": ""1""," & vbCrLf
            sBody = sBody & "      ""fecha_expedicion"": ""CURRENT_DATE""" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""242""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Rectificativa por sustitución
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "S",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por sustitución",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "importe_rectificativa": {
                "base_rectificada": "200",
                "cuota_rectificada": "42"
              },
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "150",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "181.5"
            }'
        - lang: Python
          label: Python — Rectificativa por sustitución
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "S",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por sustitución",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "importe_rectificativa": {
                "base_rectificada": "200",
                "cuota_rectificada": "42"
              },
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "150",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "181.5"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Rectificativa por sustitución
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "S",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por sustitución",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "importe_rectificativa": {
                "base_rectificada": "200",
                "cuota_rectificada": "42"
              },
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "150",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "181.5"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Rectificativa por sustitución
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "S",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por sustitución",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "importe_rectificativa": {
                "base_rectificada": "200",
                "cuota_rectificada": "42"
              },
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "150",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "181.5"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Rectificativa por sustitución
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "S",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por sustitución",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "importe_rectificativa": {
                "base_rectificada": "200",
                "cuota_rectificada": "42"
              },
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "150",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "181.5"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Rectificativa por sustitución
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"R\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"R1\",\n  \"tipo_rectificativa\": \"S\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Rectificativa por sustitución\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"facturas_rectificadas\": [\n    {\n      \"serie\": \"A\",\n      \"numero\": \"1\",\n      \"fecha_expedicion\": \"CURRENT_DATE\"\n    }\n  ],\n  \"importe_rectificativa\": {\n    \"base_rectificada\": \"200\",\n    \"cuota_rectificada\": \"42\"\n  },\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"150\",\n          \"cuota_repercutida\": \"31.5\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"181.5\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Rectificativa por sustitución
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "R",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "R1",
                              "tipo_rectificativa": "S",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Rectificativa por sustitución",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "facturas_rectificadas": [
                                {
                                  "serie": "A",
                                  "numero": "1",
                                  "fecha_expedicion": "CURRENT_DATE"
                                }
                              ],
                              "importe_rectificativa": {
                                "base_rectificada": "200",
                                "cuota_rectificada": "42"
                              },
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "150",
                                      "cuota_repercutida": "31.5"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "181.5"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Rectificativa por sustitución
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""R"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""R1"",
              ""tipo_rectificativa"": ""S"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Rectificativa por sustitución"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""facturas_rectificadas"": [
                {
                  ""serie"": ""A"",
                  ""numero"": ""1"",
                  ""fecha_expedicion"": ""CURRENT_DATE""
                }
              ],
              ""importe_rectificativa"": {
                ""base_rectificada"": ""200"",
                ""cuota_rectificada"": ""42""
              },
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""150"",
                      ""cuota_repercutida"": ""31.5""
                    }
                  ]
                }
              },
              ""importe_total"": ""181.5""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Rectificativa por sustitución
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""R""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""R1""," & vbCrLf
            sBody = sBody & "  ""tipo_rectificativa"": ""S""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Rectificativa por sustitución""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""facturas_rectificadas"": [" & vbCrLf
            sBody = sBody & "    {" & vbCrLf
            sBody = sBody & "      ""serie"": ""A""," & vbCrLf
            sBody = sBody & "      ""numero"": ""1""," & vbCrLf
            sBody = sBody & "      ""fecha_expedicion"": ""CURRENT_DATE""" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""importe_rectificativa"": {" & vbCrLf
            sBody = sBody & "    ""base_rectificada"": ""200""," & vbCrLf
            sBody = sBody & "    ""cuota_rectificada"": ""42""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""150""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""31.5""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""181.5""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Rectificativa por diferencias
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "I",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por diferencias",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-50",
                      "cuota_repercutida": "-10.5"
                    }
                  ]
                }
              },
              "importe_total": "-60.5"
            }'
        - lang: Python
          label: Python — Rectificativa por diferencias
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "I",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por diferencias",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-50",
                      "cuota_repercutida": "-10.5"
                    }
                  ]
                }
              },
              "importe_total": "-60.5"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Rectificativa por diferencias
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "I",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por diferencias",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-50",
                      "cuota_repercutida": "-10.5"
                    }
                  ]
                }
              },
              "importe_total": "-60.5"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Rectificativa por diferencias
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "I",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por diferencias",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-50",
                      "cuota_repercutida": "-10.5"
                    }
                  ]
                }
              },
              "importe_total": "-60.5"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Rectificativa por diferencias
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "R",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "R1",
              "tipo_rectificativa": "I",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Rectificativa por diferencias",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "facturas_rectificadas": [
                {
                  "serie": "A",
                  "numero": "1",
                  "fecha_expedicion": "CURRENT_DATE"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "-50",
                      "cuota_repercutida": "-10.5"
                    }
                  ]
                }
              },
              "importe_total": "-60.5"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Rectificativa por diferencias
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"R\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"R1\",\n  \"tipo_rectificativa\": \"I\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Rectificativa por diferencias\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"facturas_rectificadas\": [\n    {\n      \"serie\": \"A\",\n      \"numero\": \"1\",\n      \"fecha_expedicion\": \"CURRENT_DATE\"\n    }\n  ],\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"-50\",\n          \"cuota_repercutida\": \"-10.5\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"-60.5\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Rectificativa por diferencias
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "R",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "R1",
                              "tipo_rectificativa": "I",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Rectificativa por diferencias",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "facturas_rectificadas": [
                                {
                                  "serie": "A",
                                  "numero": "1",
                                  "fecha_expedicion": "CURRENT_DATE"
                                }
                              ],
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "-50",
                                      "cuota_repercutida": "-10.5"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "-60.5"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Rectificativa por diferencias
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""R"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""R1"",
              ""tipo_rectificativa"": ""I"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Rectificativa por diferencias"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""facturas_rectificadas"": [
                {
                  ""serie"": ""A"",
                  ""numero"": ""1"",
                  ""fecha_expedicion"": ""CURRENT_DATE""
                }
              ],
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""-50"",
                      ""cuota_repercutida"": ""-10.5""
                    }
                  ]
                }
              },
              ""importe_total"": ""-60.5""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Rectificativa por diferencias
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""R""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""R1""," & vbCrLf
            sBody = sBody & "  ""tipo_rectificativa"": ""I""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Rectificativa por diferencias""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""facturas_rectificadas"": [" & vbCrLf
            sBody = sBody & "    {" & vbCrLf
            sBody = sBody & "      ""serie"": ""A""," & vbCrLf
            sBody = sBody & "      ""numero"": ""1""," & vbCrLf
            sBody = sBody & "      ""fecha_expedicion"": ""CURRENT_DATE""" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""-50""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""-10.5""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""-60.5""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Recargo de equivalencia
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con recargo de equivalencia",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42",
                      "tipo_recargo_equivalencia": "5.2",
                      "cuota_recargo_equivalencia": "10.4"
                    }
                  ]
                }
              },
              "importe_total": "252.4"
            }'
        - lang: Python
          label: Python — Recargo de equivalencia
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con recargo de equivalencia",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42",
                      "tipo_recargo_equivalencia": "5.2",
                      "cuota_recargo_equivalencia": "10.4"
                    }
                  ]
                }
              },
              "importe_total": "252.4"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Recargo de equivalencia
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con recargo de equivalencia",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42",
                      "tipo_recargo_equivalencia": "5.2",
                      "cuota_recargo_equivalencia": "10.4"
                    }
                  ]
                }
              },
              "importe_total": "252.4"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Recargo de equivalencia
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con recargo de equivalencia",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42",
                      "tipo_recargo_equivalencia": "5.2",
                      "cuota_recargo_equivalencia": "10.4"
                    }
                  ]
                }
              },
              "importe_total": "252.4"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Recargo de equivalencia
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura con recargo de equivalencia",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42",
                      "tipo_recargo_equivalencia": "5.2",
                      "cuota_recargo_equivalencia": "10.4"
                    }
                  ]
                }
              },
              "importe_total": "252.4"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Recargo de equivalencia
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura con recargo de equivalencia\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"200\",\n          \"cuota_repercutida\": \"42\",\n          \"tipo_recargo_equivalencia\": \"5.2\",\n          \"cuota_recargo_equivalencia\": \"10.4\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"252.4\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Recargo de equivalencia
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura con recargo de equivalencia",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "200",
                                      "cuota_repercutida": "42",
                                      "tipo_recargo_equivalencia": "5.2",
                                      "cuota_recargo_equivalencia": "10.4"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "252.4"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Recargo de equivalencia
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura con recargo de equivalencia"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""200"",
                      ""cuota_repercutida"": ""42"",
                      ""tipo_recargo_equivalencia"": ""5.2"",
                      ""cuota_recargo_equivalencia"": ""10.4""
                    }
                  ]
                }
              },
              ""importe_total"": ""252.4""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Recargo de equivalencia
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura con recargo de equivalencia""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""42""," & vbCrLf
            sBody = sBody & "          ""tipo_recargo_equivalencia"": ""5.2""," & vbCrLf
            sBody = sBody & "          ""cuota_recargo_equivalencia"": ""10.4""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""252.4""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Emitida por terceros o por el destinatario
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura emitida por terceros",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "especial": {
                "emitida_por_tercero_o_destinatario": "S"
              },
              "importe_total": "242"
            }'
        - lang: Python
          label: Python — Emitida por terceros o por el destinatario
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura emitida por terceros",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "especial": {
                "emitida_por_tercero_o_destinatario": "S"
              },
              "importe_total": "242"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Emitida por terceros o por el destinatario
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura emitida por terceros",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "especial": {
                "emitida_por_tercero_o_destinatario": "S"
              },
              "importe_total": "242"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Emitida por terceros o por el destinatario
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura emitida por terceros",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "especial": {
                "emitida_por_tercero_o_destinatario": "S"
              },
              "importe_total": "242"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Emitida por terceros o por el destinatario
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura emitida por terceros",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "especial": {
                "emitida_por_tercero_o_destinatario": "S"
              },
              "importe_total": "242"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Emitida por terceros o por el destinatario
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura emitida por terceros\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"200\",\n          \"cuota_repercutida\": \"42\"\n        }\n      ]\n    }\n  },\n  \"especial\": {\n    \"emitida_por_tercero_o_destinatario\": \"S\"\n  },\n  \"importe_total\": \"242\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Emitida por terceros o por el destinatario
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura emitida por terceros",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "200",
                                      "cuota_repercutida": "42"
                                    }
                                  ]
                                }
                              },
                              "especial": {
                                "emitida_por_tercero_o_destinatario": "S"
                              },
                              "importe_total": "242"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Emitida por terceros o por el destinatario
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura emitida por terceros"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""200"",
                      ""cuota_repercutida"": ""42""
                    }
                  ]
                }
              },
              ""especial"": {
                ""emitida_por_tercero_o_destinatario"": ""S""
              },
              ""importe_total"": ""242""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Emitida por terceros o por el destinatario
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura emitida por terceros""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""especial"": {" & vbCrLf
            sBody = sBody & "    ""emitida_por_tercero_o_destinatario"": ""S""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""242""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Régimen de bienes usados
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "03"
              ],
              "descripcion": "Factura en régimen especial de bienes usados (REBU)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "826.45",
                      "cuota_repercutida": "173.55"
                    }
                  ]
                }
              },
              "importe_total": "3000"
            }'
        - lang: Python
          label: Python — Régimen de bienes usados
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "03"
              ],
              "descripcion": "Factura en régimen especial de bienes usados (REBU)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "826.45",
                      "cuota_repercutida": "173.55"
                    }
                  ]
                }
              },
              "importe_total": "3000"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Régimen de bienes usados
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "03"
              ],
              "descripcion": "Factura en régimen especial de bienes usados (REBU)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "826.45",
                      "cuota_repercutida": "173.55"
                    }
                  ]
                }
              },
              "importe_total": "3000"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Régimen de bienes usados
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "03"
              ],
              "descripcion": "Factura en régimen especial de bienes usados (REBU)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "826.45",
                      "cuota_repercutida": "173.55"
                    }
                  ]
                }
              },
              "importe_total": "3000"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Régimen de bienes usados
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "03"
              ],
              "descripcion": "Factura en régimen especial de bienes usados (REBU)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "826.45",
                      "cuota_repercutida": "173.55"
                    }
                  ]
                }
              },
              "importe_total": "3000"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Régimen de bienes usados
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"03\"\n  ],\n  \"descripcion\": \"Factura en régimen especial de bienes usados (REBU)\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"826.45\",\n          \"cuota_repercutida\": \"173.55\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"3000\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Régimen de bienes usados
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "03"
                              ],
                              "descripcion": "Factura en régimen especial de bienes usados (REBU)",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "826.45",
                                      "cuota_repercutida": "173.55"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "3000"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Régimen de bienes usados
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""03""
              ],
              ""descripcion"": ""Factura en régimen especial de bienes usados (REBU)"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""826.45"",
                      ""cuota_repercutida"": ""173.55""
                    }
                  ]
                }
              },
              ""importe_total"": ""3000""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Régimen de bienes usados
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""03""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura en régimen especial de bienes usados (REBU)""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""826.45""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""173.55""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""3000""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Inversión del sujeto pasivo
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Inversión del sujeto pasivo",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S2",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "0",
                      "base_imponible": "1000",
                      "cuota_repercutida": "0"
                    }
                  ]
                }
              },
              "importe_total": "1000"
            }'
        - lang: Python
          label: Python — Inversión del sujeto pasivo
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Inversión del sujeto pasivo",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S2",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "0",
                      "base_imponible": "1000",
                      "cuota_repercutida": "0"
                    }
                  ]
                }
              },
              "importe_total": "1000"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Inversión del sujeto pasivo
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Inversión del sujeto pasivo",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S2",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "0",
                      "base_imponible": "1000",
                      "cuota_repercutida": "0"
                    }
                  ]
                }
              },
              "importe_total": "1000"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Inversión del sujeto pasivo
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Inversión del sujeto pasivo",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S2",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "0",
                      "base_imponible": "1000",
                      "cuota_repercutida": "0"
                    }
                  ]
                }
              },
              "importe_total": "1000"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Inversión del sujeto pasivo
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Inversión del sujeto pasivo",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S2",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "0",
                      "base_imponible": "1000",
                      "cuota_repercutida": "0"
                    }
                  ]
                }
              },
              "importe_total": "1000"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Inversión del sujeto pasivo
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Inversión del sujeto pasivo\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S2\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"0\",\n          \"base_imponible\": \"1000\",\n          \"cuota_repercutida\": \"0\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"1000\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Inversión del sujeto pasivo
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Inversión del sujeto pasivo",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S2",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "0",
                                      "base_imponible": "1000",
                                      "cuota_repercutida": "0"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "1000"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Inversión del sujeto pasivo
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Inversión del sujeto pasivo"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S2"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""0"",
                      ""base_imponible"": ""1000"",
                      ""cuota_repercutida"": ""0""
                    }
                  ]
                }
              },
              ""importe_total"": ""1000""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Inversión del sujeto pasivo
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Inversión del sujeto pasivo""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S2""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""0""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""1000""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""0""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""1000""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Asiento resumen
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "T",
              "numero": "1",
              "numero_fin": "50",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F4",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Asiento resumen de los tickets del día",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "4000",
                      "cuota_repercutida": "840"
                    }
                  ]
                }
              },
              "importe_total": "4840"
            }'
        - lang: Python
          label: Python — Asiento resumen
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "T",
              "numero": "1",
              "numero_fin": "50",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F4",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Asiento resumen de los tickets del día",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "4000",
                      "cuota_repercutida": "840"
                    }
                  ]
                }
              },
              "importe_total": "4840"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Asiento resumen
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "T",
              "numero": "1",
              "numero_fin": "50",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F4",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Asiento resumen de los tickets del día",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "4000",
                      "cuota_repercutida": "840"
                    }
                  ]
                }
              },
              "importe_total": "4840"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Asiento resumen
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "T",
              "numero": "1",
              "numero_fin": "50",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F4",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Asiento resumen de los tickets del día",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "4000",
                      "cuota_repercutida": "840"
                    }
                  ]
                }
              },
              "importe_total": "4840"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Asiento resumen
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "T",
              "numero": "1",
              "numero_fin": "50",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F4",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Asiento resumen de los tickets del día",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "4000",
                      "cuota_repercutida": "840"
                    }
                  ]
                }
              },
              "importe_total": "4840"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Asiento resumen
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"T\",\n  \"numero\": \"1\",\n  \"numero_fin\": \"50\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F4\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Asiento resumen de los tickets del día\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"4000\",\n          \"cuota_repercutida\": \"840\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"4840\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Asiento resumen
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "T",
                              "numero": "1",
                              "numero_fin": "50",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F4",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Asiento resumen de los tickets del día",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "4000",
                                      "cuota_repercutida": "840"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "4840"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Asiento resumen
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""T"",
              ""numero"": ""1"",
              ""numero_fin"": ""50"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F4"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Asiento resumen de los tickets del día"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""4000"",
                      ""cuota_repercutida"": ""840""
                    }
                  ]
                }
              },
              ""importe_total"": ""4840""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Asiento resumen
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""T""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""numero_fin"": ""50""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F4""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Asiento resumen de los tickets del día""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""4000""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""840""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""4840""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Régimen especial del criterio de caja
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "07"
              ],
              "descripcion": "Factura en régimen especial del criterio de caja",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }'
        - lang: Python
          label: Python — Régimen especial del criterio de caja
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "07"
              ],
              "descripcion": "Factura en régimen especial del criterio de caja",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Régimen especial del criterio de caja
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "07"
              ],
              "descripcion": "Factura en régimen especial del criterio de caja",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Régimen especial del criterio de caja
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "07"
              ],
              "descripcion": "Factura en régimen especial del criterio de caja",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Régimen especial del criterio de caja
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "07"
              ],
              "descripcion": "Factura en régimen especial del criterio de caja",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Régimen especial del criterio de caja
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"07\"\n  ],\n  \"descripcion\": \"Factura en régimen especial del criterio de caja\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"200\",\n          \"cuota_repercutida\": \"42\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"242\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Régimen especial del criterio de caja
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "07"
                              ],
                              "descripcion": "Factura en régimen especial del criterio de caja",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "200",
                                      "cuota_repercutida": "42"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "242"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Régimen especial del criterio de caja
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""07""
              ],
              ""descripcion"": ""Factura en régimen especial del criterio de caja"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""200"",
                      ""cuota_repercutida"": ""42""
                    }
                  ]
                }
              },
              ""importe_total"": ""242""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Régimen especial del criterio de caja
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""07""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura en régimen especial del criterio de caja""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""242""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Arrendamiento de local de negocio
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "12"
              ],
              "descripcion": "Alquiler del local de negocio",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "inmuebles": [
                {
                  "situacion": "1",
                  "referencia_catastral": "9872023VH5797S0001WX"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "1000",
                      "cuota_repercutida": "210"
                    }
                  ]
                }
              },
              "importe_total": "1210"
            }'
        - lang: Python
          label: Python — Arrendamiento de local de negocio
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "12"
              ],
              "descripcion": "Alquiler del local de negocio",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "inmuebles": [
                {
                  "situacion": "1",
                  "referencia_catastral": "9872023VH5797S0001WX"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "1000",
                      "cuota_repercutida": "210"
                    }
                  ]
                }
              },
              "importe_total": "1210"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Arrendamiento de local de negocio
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "12"
              ],
              "descripcion": "Alquiler del local de negocio",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "inmuebles": [
                {
                  "situacion": "1",
                  "referencia_catastral": "9872023VH5797S0001WX"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "1000",
                      "cuota_repercutida": "210"
                    }
                  ]
                }
              },
              "importe_total": "1210"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Arrendamiento de local de negocio
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "12"
              ],
              "descripcion": "Alquiler del local de negocio",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "inmuebles": [
                {
                  "situacion": "1",
                  "referencia_catastral": "9872023VH5797S0001WX"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "1000",
                      "cuota_repercutida": "210"
                    }
                  ]
                }
              },
              "importe_total": "1210"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Arrendamiento de local de negocio
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "12"
              ],
              "descripcion": "Alquiler del local de negocio",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "inmuebles": [
                {
                  "situacion": "1",
                  "referencia_catastral": "9872023VH5797S0001WX"
                }
              ],
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "1000",
                      "cuota_repercutida": "210"
                    }
                  ]
                }
              },
              "importe_total": "1210"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Arrendamiento de local de negocio
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"12\"\n  ],\n  \"descripcion\": \"Alquiler del local de negocio\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"inmuebles\": [\n    {\n      \"situacion\": \"1\",\n      \"referencia_catastral\": \"9872023VH5797S0001WX\"\n    }\n  ],\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"1000\",\n          \"cuota_repercutida\": \"210\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"1210\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Arrendamiento de local de negocio
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "12"
                              ],
                              "descripcion": "Alquiler del local de negocio",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "inmuebles": [
                                {
                                  "situacion": "1",
                                  "referencia_catastral": "9872023VH5797S0001WX"
                                }
                              ],
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "1000",
                                      "cuota_repercutida": "210"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "1210"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Arrendamiento de local de negocio
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""12""
              ],
              ""descripcion"": ""Alquiler del local de negocio"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""inmuebles"": [
                {
                  ""situacion"": ""1"",
                  ""referencia_catastral"": ""9872023VH5797S0001WX""
                }
              ],
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""1000"",
                      ""cuota_repercutida"": ""210""
                    }
                  ]
                }
              },
              ""importe_total"": ""1210""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Arrendamiento de local de negocio
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""12""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Alquiler del local de negocio""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""inmuebles"": [" & vbCrLf
            sBody = sBody & "    {" & vbCrLf
            sBody = sBody & "      ""situacion"": ""1""," & vbCrLf
            sBody = sBody & "      ""referencia_catastral"": ""9872023VH5797S0001WX""" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""1000""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""210""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""1210""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
        - lang: cURL
          label: cURL — Grupo de entidades
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "06"
              ],
              "descripcion": "Operación dentro del grupo de entidades (nivel avanzado)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "base_imponible_a_coste": "150",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "231.5"
            }'
        - lang: Python
          label: Python — Grupo de entidades
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "06"
              ],
              "descripcion": "Operación dentro del grupo de entidades (nivel avanzado)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "base_imponible_a_coste": "150",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "231.5"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript — Grupo de entidades
          source: |
            const url = 'https://api.verifacti.com/sii/create';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "06"
              ],
              "descripcion": "Operación dentro del grupo de entidades (nivel avanzado)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "base_imponible_a_coste": "150",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "231.5"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js — Grupo de entidades
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "06"
              ],
              "descripcion": "Operación dentro del grupo de entidades (nivel avanzado)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "base_imponible_a_coste": "150",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "231.5"
            };

            const response = await axios.post("https://api.verifacti.com/sii/create", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP — Grupo de entidades
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "06"
              ],
              "descripcion": "Operación dentro del grupo de entidades (nivel avanzado)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "base_imponible_a_coste": "150",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "31.5"
                    }
                  ]
                }
              },
              "importe_total": "231.5"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go — Grupo de entidades
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"06\"\n  ],\n  \"descripcion\": \"Operación dentro del grupo de entidades (nivel avanzado)\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"base_imponible_a_coste\": \"150\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"200\",\n          \"cuota_repercutida\": \"31.5\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"231.5\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java — Grupo de entidades
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "06"
                              ],
                              "descripcion": "Operación dentro del grupo de entidades (nivel avanzado)",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "base_imponible_a_coste": "150",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "200",
                                      "cuota_repercutida": "31.5"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "231.5"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C# — Grupo de entidades
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""06""
              ],
              ""descripcion"": ""Operación dentro del grupo de entidades (nivel avanzado)"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""base_imponible_a_coste"": ""150"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""200"",
                      ""cuota_repercutida"": ""31.5""
                    }
                  ]
                }
              },
              ""importe_total"": ""231.5""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6 — Grupo de entidades
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""06""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Operación dentro del grupo de entidades (nivel avanzado)""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""base_imponible_a_coste"": ""150""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""31.5""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""231.5""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          description: Clave única opcional para garantizar que reintentos de la misma petición no creen duplicados. Cadena ASCII imprimible de 1 a 255 caracteres. Se recuerda durante 24 horas por NIF.
          schema:
            type: string
            pattern: ^[\x20-\x7E]{1,255}$
            minLength: 1
            maxLength: 255
            example: 8e1b9c2a-3f4d-4a6b-9c2e-1d2f3e4a5b6c
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Factura"
            examples:
              factura_normal:
                summary: Factura normal
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura normal
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "200"
                          cuota_repercutida: "42"
                  importe_total: "242"
              factura_simplificada:
                summary: Factura simplificada
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F2
                  clave_regimen:
                    - "01"
                  descripcion: Factura simplificada
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "200"
                          cuota_repercutida: "42"
                  importe_total: "242"
              multiples_ivas:
                summary: Múltiples IVAs
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura con múltiples IVAs
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "200"
                          cuota_repercutida: "42"
                        - tipo_impositivo: "10"
                          base_imponible: "100"
                          cuota_repercutida: "10"
                        - tipo_impositivo: "4"
                          base_imponible: "50"
                          cuota_repercutida: "2"
                  importe_total: "404"
              b2b_intracomunitaria_bienes:
                summary: B2B intracomunitaria - Venta de bienes
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura B2B intracomunitaria - Venta de bienes
                  nombre: Nombre destinatario
                  id_otro:
                    id_type: "02"
                    id: BE0404621642
                  desglose:
                    entrega:
                      exenta:
                        - causa_exencion: E5
                          base_imponible: "200"
                  importe_total: "200"
              b2b_intracomunitaria_servicios:
                summary: B2B intracomunitaria - Prestación de servicios
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura B2B intracomunitaria - Prestación de servicios
                  nombre: Nombre destinatario
                  id_otro:
                    id_type: "02"
                    id: BE0404621642
                  desglose:
                    prestacion_servicios:
                      no_sujeta:
                        importe_tai_reglas_localizacion: "200"
                  importe_total: "200"
              b2c_intracomunitaria_umbral:
                summary: B2C intracomunitaria - Por debajo del umbral
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura B2C intracomunitaria - Por debajo del umbral
                  nombre: Nombre destinatario
                  id_otro:
                    codigo_pais: DE
                    id_type: "03"
                    id: F8624KW3J6
                  desglose:
                    entrega:
                      no_exenta:
                        tipo_no_exenta: S1
                        detalle_iva:
                          - tipo_impositivo: "21"
                            base_imponible: "200"
                            cuota_repercutida: "42"
                  importe_total: "242"
              b2c_intracomunitaria_oss:
                summary: B2C intracomunitaria - OSS
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "17"
                  descripcion: Factura B2C intracomunitaria - OSS
                  nombre: Nombre destinatario
                  id_otro:
                    codigo_pais: DE
                    id_type: "03"
                    id: F8624KW3J6
                  desglose:
                    entrega:
                      no_sujeta:
                        importe_tai_reglas_localizacion: "200"
                  importe_total: "200"
              exportacion_bienes:
                summary: "Extracomunitaria: Exportación de bienes"
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "02"
                  descripcion: Factura extracomunitaria - Exportación de bienes
                  nombre: Nombre destinatario
                  id_otro:
                    codigo_pais: US
                    id_type: "03"
                    id: M76543210
                  desglose:
                    entrega:
                      exenta:
                        - causa_exencion: E2
                          base_imponible: "200"
                  importe_total: "200"
              extracomunitaria_servicios:
                summary: "Extracomunitaria: Prestación de servicios"
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura extracomunitaria - Prestación de servicios
                  nombre: Nombre destinatario
                  id_otro:
                    codigo_pais: US
                    id_type: "03"
                    id: M76543210
                  desglose:
                    prestacion_servicios:
                      no_sujeta:
                        importe_tai_reglas_localizacion: "200"
                  importe_total: "200"
              exenta:
                summary: Exenta de IVA
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura exenta de IVA
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    exenta:
                      - causa_exencion: E1
                        base_imponible: "200"
                  importe_total: "200"
              no_sujeta:
                summary: Operación no sujeta
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Operación no sujeta
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_sujeta:
                      importe_por_articulos_7_14_otros: "200"
                  importe_total: "200"
              igic_ipsi:
                summary: Operación sujeta a IGIC o IPSI
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "08"
                  descripcion: Operación sujeta a IGIC (Canarias)
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_sujeta:
                      importe_tai_reglas_localizacion: "200"
                  importe_total: "200"
              abono:
                summary: Factura de abono
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura de abono
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "-200"
                          cuota_repercutida: "-42"
                  importe_total: "-242"
              canje:
                summary: Factura de canje
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F3
                  clave_regimen:
                    - "01"
                  descripcion: Factura de canje de simplificadas
                  nombre: Nombre cliente
                  nif: A15022510
                  facturas_sustituidas:
                    - serie: SIMPLE
                      numero: "1"
                      fecha_expedicion: CURRENT_DATE
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "200"
                          cuota_repercutida: "42"
                  importe_total: "242"
              rectificativa_sustitucion:
                summary: Rectificativa por sustitución
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: R
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: R1
                  tipo_rectificativa: S
                  clave_regimen:
                    - "01"
                  descripcion: Rectificativa por sustitución
                  nombre: Nombre cliente
                  nif: A15022510
                  facturas_rectificadas:
                    - serie: A
                      numero: "1"
                      fecha_expedicion: CURRENT_DATE
                  importe_rectificativa:
                    base_rectificada: "200"
                    cuota_rectificada: "42"
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "150"
                          cuota_repercutida: "31.5"
                  importe_total: "181.5"
              rectificativa_diferencias:
                summary: Rectificativa por diferencias
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: R
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: R1
                  tipo_rectificativa: I
                  clave_regimen:
                    - "01"
                  descripcion: Rectificativa por diferencias
                  nombre: Nombre cliente
                  nif: A15022510
                  facturas_rectificadas:
                    - serie: A
                      numero: "1"
                      fecha_expedicion: CURRENT_DATE
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "-50"
                          cuota_repercutida: "-10.5"
                  importe_total: "-60.5"
              recargo_equivalencia:
                summary: Recargo de equivalencia
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura con recargo de equivalencia
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "200"
                          cuota_repercutida: "42"
                          tipo_recargo_equivalencia: "5.2"
                          cuota_recargo_equivalencia: "10.4"
                  importe_total: "252.4"
              emitida_por_terceros:
                summary: Emitida por terceros o por el destinatario
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura emitida por terceros
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "200"
                          cuota_repercutida: "42"
                  especial:
                    emitida_por_tercero_o_destinatario: S
                  importe_total: "242"
              rebu:
                summary: Régimen de bienes usados
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "03"
                  descripcion: Factura en régimen especial de bienes usados (REBU)
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "826.45"
                          cuota_repercutida: "173.55"
                  importe_total: "3000"
              inversion_sujeto_pasivo:
                summary: Inversión del sujeto pasivo
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Inversión del sujeto pasivo
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S2
                      detalle_iva:
                        - tipo_impositivo: "0"
                          base_imponible: "1000"
                          cuota_repercutida: "0"
                  importe_total: "1000"
              asiento_resumen:
                summary: Asiento resumen
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: T
                  numero: "1"
                  numero_fin: "50"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F4
                  clave_regimen:
                    - "01"
                  descripcion: Asiento resumen de los tickets del día
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "4000"
                          cuota_repercutida: "840"
                  importe_total: "4840"
              criterio_de_caja:
                summary: Régimen especial del criterio de caja
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "07"
                  descripcion: Factura en régimen especial del criterio de caja
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "200"
                          cuota_repercutida: "42"
                  importe_total: "242"
              arrendamiento_local:
                summary: Arrendamiento de local de negocio
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "12"
                  descripcion: Alquiler del local de negocio
                  nombre: Nombre cliente
                  nif: A15022510
                  inmuebles:
                    - situacion: "1"
                      referencia_catastral: 9872023VH5797S0001WX
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "1000"
                          cuota_repercutida: "210"
                  importe_total: "1210"
              grupo_de_entidades:
                summary: Grupo de entidades
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "06"
                  descripcion: Operación dentro del grupo de entidades (nivel avanzado)
                  nombre: Nombre cliente
                  nif: A15022510
                  base_imponible_a_coste: "150"
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "200"
                          cuota_repercutida: "31.5"
                  importe_total: "231.5"
      responses:
        "200":
          description: Factura válida y en cola
          content:
            application/json:
              schema:
                type: object
                properties:
                  uuid:
                    description: Identificador único del registro, para consultar su estado.
                    type: string
                    example: ea6eae92-bac6-48c3-baa4-2bbf6b5ee562
                  estado:
                    description: "Siempre <code>Pendiente</code>: el registro queda en cola."
                    type: string
                    example: Pendiente
        "400":
          description: Error en los datos de la petición. El registro no se genera y no se envía nada a la AEAT.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    description: Descripción del error.
                    type: string
                    example: La cuota_repercutida debe ser base_imponible (o base_imponible_a_coste con la clave 06) por tipo_impositivo / 100, con un margen de 10 euros.
                  codigo:
                    description: Identificador estable del error. Catálogo completo <a href="https://www.verifacti.com/openapi/codigos-sii.yaml" target="_blank">aquí</a>.
                    type: string
                    example: vf-sii-cuota_repercutida_calculo
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/NifInactivo"
        "500":
          description: Error de servidor. El registro no se genera; reintenta más tarde.
  /sii/create_bulk:
    post:
      summary: Crear facturas en lote
      description: |-
        Mediante este endpoint se crean hasta 500 registros de alta (A0) en una sola llamada. El cuerpo de la llamada es un array de facturas, tal y como se envían en el endpoint <code>/sii/create</code>. De la misma forma, la respuesta es un array con el <code>uuid</code> y el estado de cada registro, en el mismo orden que las facturas.

        &nbsp;

        Se validan todas las facturas antes de guardar ninguna, incluida la comprobación de las contrapartes en el censo de la AEAT y en VIES, que se hace para todo el lote a la vez. Si alguna tiene un error, se devuelve un 400 con el error de la primera que falla (<code>Error en factura N: …</code>) y su <code>codigo</code>. En ese caso no se genera ningún registro y no se envía nada a la AEAT. También se rechaza el lote si dos facturas tienen la misma serie, número y fecha de expedición (<code>vf-sii-factura_duplicada_lote</code>).

        &nbsp;

        Los registros del lote se envían a la AEAT junto con el resto de registros pendientes del NIF, y cada uno se consulta con <code>GET /sii/status</code> o llega a tus webhooks. Las modificaciones y anulaciones se siguen enviando factura a factura, con <code>/sii/modify</code> y <code>/sii/cancel</code>.

        &nbsp;

        Este endpoint admite además una cabecera opcional <code>Idempotency-Key</code>. Si se incluye, los reintentos del mismo lote con la misma clave replican la respuesta original (incluyendo la cabecera de respuesta <code>Idempotent-Replayed: true</code> y el eco de <code>Idempotency-Key</code>). La clave cubre el lote completo: el mismo array de facturas devuelve el mismo array de resultados. Las claves se vinculan al NIF y se recuerdan durante 24 horas. Reusar la misma clave con un cuerpo diferente devuelve 422; un reintento concurrente mientras el primero sigue en curso devuelve 409.
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |
            curl --request POST 'https://api.verifacti.com/sii/create_bulk' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '[
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "1",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura normal",
                "nombre": "Nombre cliente",
                "nif": "A15022510",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "2",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F2",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura simplificada",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "3",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
                "nombre": "Nombre destinatario",
                "id_otro": {
                  "id_type": "02",
                  "id": "BE0404621642"
                },
                "desglose": {
                  "entrega": {
                    "exenta": [
                      {
                        "causa_exencion": "E5",
                        "base_imponible": "200"
                      }
                    ]
                  }
                },
                "importe_total": "200"
              }
            ]'
        - lang: Python
          label: Python
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/create_bulk'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = [
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "1",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura normal",
                "nombre": "Nombre cliente",
                "nif": "A15022510",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "2",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F2",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura simplificada",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "3",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
                "nombre": "Nombre destinatario",
                "id_otro": {
                  "id_type": "02",
                  "id": "BE0404621642"
                },
                "desglose": {
                  "entrega": {
                    "exenta": [
                      {
                        "causa_exencion": "E5",
                        "base_imponible": "200"
                      }
                    ]
                  }
                },
                "importe_total": "200"
              }
            ]
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript
          source: |
            const url = 'https://api.verifacti.com/sii/create_bulk';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = [
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "1",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura normal",
                "nombre": "Nombre cliente",
                "nif": "A15022510",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "2",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F2",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura simplificada",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "3",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
                "nombre": "Nombre destinatario",
                "id_otro": {
                  "id_type": "02",
                  "id": "BE0404621642"
                },
                "desglose": {
                  "entrega": {
                    "exenta": [
                      {
                        "causa_exencion": "E5",
                        "base_imponible": "200"
                      }
                    ]
                  }
                },
                "importe_total": "200"
              }
            ];
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js
          source: |-
            const axios = require("axios");

            const data = [
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "1",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura normal",
                "nombre": "Nombre cliente",
                "nif": "A15022510",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "2",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F2",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura simplificada",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "3",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
                "nombre": "Nombre destinatario",
                "id_otro": {
                  "id_type": "02",
                  "id": "BE0404621642"
                },
                "desglose": {
                  "entrega": {
                    "exenta": [
                      {
                        "causa_exencion": "E5",
                        "base_imponible": "200"
                      }
                    ]
                  }
                },
                "importe_total": "200"
              }
            ];

            const response = await axios.post("https://api.verifacti.com/sii/create_bulk", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/create_bulk";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            [
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "1",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura normal",
                "nombre": "Nombre cliente",
                "nif": "A15022510",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "2",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F2",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura simplificada",
                "desglose": {
                  "no_exenta": {
                    "tipo_no_exenta": "S1",
                    "detalle_iva": [
                      {
                        "tipo_impositivo": "21",
                        "base_imponible": "200",
                        "cuota_repercutida": "42"
                      }
                    ]
                  }
                },
                "importe_total": "242"
              },
              {
                "ejercicio": "CURRENT_YEAR",
                "periodo": "CURRENT_MONTH",
                "serie": "A",
                "numero": "3",
                "fecha_expedicion": "CURRENT_DATE",
                "tipo_factura": "F1",
                "clave_regimen": [
                  "01"
                ],
                "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
                "nombre": "Nombre destinatario",
                "id_otro": {
                  "id_type": "02",
                  "id": "BE0404621642"
                },
                "desglose": {
                  "entrega": {
                    "exenta": [
                      {
                        "causa_exencion": "E5",
                        "base_imponible": "200"
                      }
                    ]
                  }
                },
                "importe_total": "200"
              }
            ]
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n[\n  {\n    \"ejercicio\": \"CURRENT_YEAR\",\n    \"periodo\": \"CURRENT_MONTH\",\n    \"serie\": \"A\",\n    \"numero\": \"1\",\n    \"fecha_expedicion\": \"CURRENT_DATE\",\n    \"tipo_factura\": \"F1\",\n    \"clave_regimen\": [\n      \"01\"\n    ],\n    \"descripcion\": \"Factura normal\",\n    \"nombre\": \"Nombre cliente\",\n    \"nif\": \"A15022510\",\n    \"desglose\": {\n      \"no_exenta\": {\n        \"tipo_no_exenta\": \"S1\",\n        \"detalle_iva\": [\n          {\n            \"tipo_impositivo\": \"21\",\n            \"base_imponible\": \"200\",\n            \"cuota_repercutida\": \"42\"\n          }\n        ]\n      }\n    },\n    \"importe_total\": \"242\"\n  },\n  {\n    \"ejercicio\": \"CURRENT_YEAR\",\n    \"periodo\": \"CURRENT_MONTH\",\n    \"serie\": \"A\",\n    \"numero\": \"2\",\n    \"fecha_expedicion\": \"CURRENT_DATE\",\n    \"tipo_factura\": \"F2\",\n    \"clave_regimen\": [\n      \"01\"\n    ],\n    \"descripcion\": \"Factura simplificada\",\n    \"desglose\": {\n      \"no_exenta\": {\n        \"tipo_no_exenta\": \"S1\",\n        \"detalle_iva\": [\n          {\n            \"tipo_impositivo\": \"21\",\n            \"base_imponible\": \"200\",\n            \"cuota_repercutida\": \"42\"\n          }\n        ]\n      }\n    },\n    \"importe_total\": \"242\"\n  },\n  {\n    \"ejercicio\": \"CURRENT_YEAR\",\n    \"periodo\": \"CURRENT_MONTH\",\n    \"serie\": \"A\",\n    \"numero\": \"3\",\n    \"fecha_expedicion\": \"CURRENT_DATE\",\n    \"tipo_factura\": \"F1\",\n    \"clave_regimen\": [\n      \"01\"\n    ],\n    \"descripcion\": \"Factura B2B intracomunitaria - Venta de bienes\",\n    \"nombre\": \"Nombre destinatario\",\n    \"id_otro\": {\n      \"id_type\": \"02\",\n      \"id\": \"BE0404621642\"\n    },\n    \"desglose\": {\n      \"entrega\": {\n        \"exenta\": [\n          {\n            \"causa_exencion\": \"E5\",\n            \"base_imponible\": \"200\"\n          }\n        ]\n      }\n    },\n    \"importe_total\": \"200\"\n  }\n]\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/create_bulk\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            [
                              {
                                "ejercicio": "CURRENT_YEAR",
                                "periodo": "CURRENT_MONTH",
                                "serie": "A",
                                "numero": "1",
                                "fecha_expedicion": "CURRENT_DATE",
                                "tipo_factura": "F1",
                                "clave_regimen": [
                                  "01"
                                ],
                                "descripcion": "Factura normal",
                                "nombre": "Nombre cliente",
                                "nif": "A15022510",
                                "desglose": {
                                  "no_exenta": {
                                    "tipo_no_exenta": "S1",
                                    "detalle_iva": [
                                      {
                                        "tipo_impositivo": "21",
                                        "base_imponible": "200",
                                        "cuota_repercutida": "42"
                                      }
                                    ]
                                  }
                                },
                                "importe_total": "242"
                              },
                              {
                                "ejercicio": "CURRENT_YEAR",
                                "periodo": "CURRENT_MONTH",
                                "serie": "A",
                                "numero": "2",
                                "fecha_expedicion": "CURRENT_DATE",
                                "tipo_factura": "F2",
                                "clave_regimen": [
                                  "01"
                                ],
                                "descripcion": "Factura simplificada",
                                "desglose": {
                                  "no_exenta": {
                                    "tipo_no_exenta": "S1",
                                    "detalle_iva": [
                                      {
                                        "tipo_impositivo": "21",
                                        "base_imponible": "200",
                                        "cuota_repercutida": "42"
                                      }
                                    ]
                                  }
                                },
                                "importe_total": "242"
                              },
                              {
                                "ejercicio": "CURRENT_YEAR",
                                "periodo": "CURRENT_MONTH",
                                "serie": "A",
                                "numero": "3",
                                "fecha_expedicion": "CURRENT_DATE",
                                "tipo_factura": "F1",
                                "clave_regimen": [
                                  "01"
                                ],
                                "descripcion": "Factura B2B intracomunitaria - Venta de bienes",
                                "nombre": "Nombre destinatario",
                                "id_otro": {
                                  "id_type": "02",
                                  "id": "BE0404621642"
                                },
                                "desglose": {
                                  "entrega": {
                                    "exenta": [
                                      {
                                        "causa_exencion": "E5",
                                        "base_imponible": "200"
                                      }
                                    ]
                                  }
                                },
                                "importe_total": "200"
                              }
                            ]
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/create_bulk"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C#
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            [
              {
                ""ejercicio"": ""CURRENT_YEAR"",
                ""periodo"": ""CURRENT_MONTH"",
                ""serie"": ""A"",
                ""numero"": ""1"",
                ""fecha_expedicion"": ""CURRENT_DATE"",
                ""tipo_factura"": ""F1"",
                ""clave_regimen"": [
                  ""01""
                ],
                ""descripcion"": ""Factura normal"",
                ""nombre"": ""Nombre cliente"",
                ""nif"": ""A15022510"",
                ""desglose"": {
                  ""no_exenta"": {
                    ""tipo_no_exenta"": ""S1"",
                    ""detalle_iva"": [
                      {
                        ""tipo_impositivo"": ""21"",
                        ""base_imponible"": ""200"",
                        ""cuota_repercutida"": ""42""
                      }
                    ]
                  }
                },
                ""importe_total"": ""242""
              },
              {
                ""ejercicio"": ""CURRENT_YEAR"",
                ""periodo"": ""CURRENT_MONTH"",
                ""serie"": ""A"",
                ""numero"": ""2"",
                ""fecha_expedicion"": ""CURRENT_DATE"",
                ""tipo_factura"": ""F2"",
                ""clave_regimen"": [
                  ""01""
                ],
                ""descripcion"": ""Factura simplificada"",
                ""desglose"": {
                  ""no_exenta"": {
                    ""tipo_no_exenta"": ""S1"",
                    ""detalle_iva"": [
                      {
                        ""tipo_impositivo"": ""21"",
                        ""base_imponible"": ""200"",
                        ""cuota_repercutida"": ""42""
                      }
                    ]
                  }
                },
                ""importe_total"": ""242""
              },
              {
                ""ejercicio"": ""CURRENT_YEAR"",
                ""periodo"": ""CURRENT_MONTH"",
                ""serie"": ""A"",
                ""numero"": ""3"",
                ""fecha_expedicion"": ""CURRENT_DATE"",
                ""tipo_factura"": ""F1"",
                ""clave_regimen"": [
                  ""01""
                ],
                ""descripcion"": ""Factura B2B intracomunitaria - Venta de bienes"",
                ""nombre"": ""Nombre destinatario"",
                ""id_otro"": {
                  ""id_type"": ""02"",
                  ""id"": ""BE0404621642""
                },
                ""desglose"": {
                  ""entrega"": {
                    ""exenta"": [
                      {
                        ""causa_exencion"": ""E5"",
                        ""base_imponible"": ""200""
                      }
                    ]
                  }
                },
                ""importe_total"": ""200""
              }
            ]
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/create_bulk", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/create_bulk"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "[" & vbCrLf
            sBody = sBody & "  {" & vbCrLf
            sBody = sBody & "    ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "    ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "    ""serie"": ""A""," & vbCrLf
            sBody = sBody & "    ""numero"": ""1""," & vbCrLf
            sBody = sBody & "    ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "    ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "    ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "      ""01""" & vbCrLf
            sBody = sBody & "    ]," & vbCrLf
            sBody = sBody & "    ""descripcion"": ""Factura normal""," & vbCrLf
            sBody = sBody & "    ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "    ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "    ""desglose"": {" & vbCrLf
            sBody = sBody & "      ""no_exenta"": {" & vbCrLf
            sBody = sBody & "        ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "        ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "          {" & vbCrLf
            sBody = sBody & "            ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "            ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "            ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "          }" & vbCrLf
            sBody = sBody & "        ]" & vbCrLf
            sBody = sBody & "      }" & vbCrLf
            sBody = sBody & "    }," & vbCrLf
            sBody = sBody & "    ""importe_total"": ""242""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  {" & vbCrLf
            sBody = sBody & "    ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "    ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "    ""serie"": ""A""," & vbCrLf
            sBody = sBody & "    ""numero"": ""2""," & vbCrLf
            sBody = sBody & "    ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "    ""tipo_factura"": ""F2""," & vbCrLf
            sBody = sBody & "    ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "      ""01""" & vbCrLf
            sBody = sBody & "    ]," & vbCrLf
            sBody = sBody & "    ""descripcion"": ""Factura simplificada""," & vbCrLf
            sBody = sBody & "    ""desglose"": {" & vbCrLf
            sBody = sBody & "      ""no_exenta"": {" & vbCrLf
            sBody = sBody & "        ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "        ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "          {" & vbCrLf
            sBody = sBody & "            ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "            ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "            ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "          }" & vbCrLf
            sBody = sBody & "        ]" & vbCrLf
            sBody = sBody & "      }" & vbCrLf
            sBody = sBody & "    }," & vbCrLf
            sBody = sBody & "    ""importe_total"": ""242""" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  {" & vbCrLf
            sBody = sBody & "    ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "    ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "    ""serie"": ""A""," & vbCrLf
            sBody = sBody & "    ""numero"": ""3""," & vbCrLf
            sBody = sBody & "    ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "    ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "    ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "      ""01""" & vbCrLf
            sBody = sBody & "    ]," & vbCrLf
            sBody = sBody & "    ""descripcion"": ""Factura B2B intracomunitaria - Venta de bienes""," & vbCrLf
            sBody = sBody & "    ""nombre"": ""Nombre destinatario""," & vbCrLf
            sBody = sBody & "    ""id_otro"": {" & vbCrLf
            sBody = sBody & "      ""id_type"": ""02""," & vbCrLf
            sBody = sBody & "      ""id"": ""BE0404621642""" & vbCrLf
            sBody = sBody & "    }," & vbCrLf
            sBody = sBody & "    ""desglose"": {" & vbCrLf
            sBody = sBody & "      ""entrega"": {" & vbCrLf
            sBody = sBody & "        ""exenta"": [" & vbCrLf
            sBody = sBody & "          {" & vbCrLf
            sBody = sBody & "            ""causa_exencion"": ""E5""," & vbCrLf
            sBody = sBody & "            ""base_imponible"": ""200""" & vbCrLf
            sBody = sBody & "          }" & vbCrLf
            sBody = sBody & "        ]" & vbCrLf
            sBody = sBody & "      }" & vbCrLf
            sBody = sBody & "    }," & vbCrLf
            sBody = sBody & "    ""importe_total"": ""200""" & vbCrLf
            sBody = sBody & "  }" & vbCrLf
            sBody = sBody & "]" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          description: Clave única opcional para garantizar que reintentos de la misma petición no creen duplicados. Cadena ASCII imprimible de 1 a 255 caracteres. Se recuerda durante 24 horas por NIF.
          schema:
            type: string
            pattern: ^[\x20-\x7E]{1,255}$
            minLength: 1
            maxLength: 255
            example: 8e1b9c2a-3f4d-4a6b-9c2e-1d2f3e4a5b6c
      requestBody:
        content:
          application/json:
            schema:
              type: array
              minItems: 1
              maxItems: 500
              description: Array de facturas, cada una con el formato de <code>/sii/create</code>.
              items:
                $ref: "#/components/schemas/Factura"
            example:
              - ejercicio: CURRENT_YEAR
                periodo: CURRENT_MONTH
                serie: A
                numero: "1"
                fecha_expedicion: CURRENT_DATE
                tipo_factura: F1
                clave_regimen:
                  - "01"
                descripcion: Factura normal
                nombre: Nombre cliente
                nif: A15022510
                desglose:
                  no_exenta:
                    tipo_no_exenta: S1
                    detalle_iva:
                      - tipo_impositivo: "21"
                        base_imponible: "200"
                        cuota_repercutida: "42"
                importe_total: "242"
              - ejercicio: CURRENT_YEAR
                periodo: CURRENT_MONTH
                serie: A
                numero: "2"
                fecha_expedicion: CURRENT_DATE
                tipo_factura: F2
                clave_regimen:
                  - "01"
                descripcion: Factura simplificada
                desglose:
                  no_exenta:
                    tipo_no_exenta: S1
                    detalle_iva:
                      - tipo_impositivo: "21"
                        base_imponible: "200"
                        cuota_repercutida: "42"
                importe_total: "242"
              - ejercicio: CURRENT_YEAR
                periodo: CURRENT_MONTH
                serie: A
                numero: "3"
                fecha_expedicion: CURRENT_DATE
                tipo_factura: F1
                clave_regimen:
                  - "01"
                descripcion: Factura B2B intracomunitaria - Venta de bienes
                nombre: Nombre destinatario
                id_otro:
                  id_type: "02"
                  id: BE0404621642
                desglose:
                  entrega:
                    exenta:
                      - causa_exencion: E5
                        base_imponible: "200"
                importe_total: "200"
      responses:
        "200":
          description: Facturas válidas y en cola
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    uuid:
                      description: Identificador único del registro, para consultar su estado.
                      type: string
                    estado:
                      description: "Siempre <code>Pendiente</code>: el registro queda en cola."
                      type: string
              example:
                - uuid: ea6eae92-bac6-48c3-baa4-2bbf6b5ee562
                  estado: Pendiente
                - uuid: 3b1f0c7e-5d2a-4c8e-9f6b-7a2d1e4c9b05
                  estado: Pendiente
                - uuid: c9d84a1b-2e6f-4b3a-8d7c-0f5e9a1b2c3d
                  estado: Pendiente
        "400":
          description: "Error en los datos de la petición: el body no es un array, tiene más de 500 facturas o alguna factura tiene un error. No se genera ningún registro y no se envía nada a la AEAT."
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    description: Descripción del error.
                    type: string
                    example: "Error en factura 2: Factura con misma serie, numero y fecha_expedicion duplicada en el lote."
                  codigo:
                    description: Identificador estable del error. Catálogo completo <a href="https://www.verifacti.com/openapi/codigos-sii.yaml" target="_blank">aquí</a>.
                    type: string
                    example: vf-sii-factura_duplicada_lote
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/NifInactivo"
        "500":
          description: Error de servidor. El registro no se genera; reintenta más tarde.
  /sii/modify:
    put:
      summary: Modificar factura
      description: |-
        Crea un registro de modificación (A1), que sustituye entero el registro que la AEAT tiene de la factura. La factura se identifica por <code>serie</code>, <code>numero</code> y <code>fecha_expedicion</code>, y el cuerpo es el mismo que el de <code>/sii/create</code>.
        <ul style="list-style: disc;">
          <li>Solo vale para facturas que la AEAT tiene registradas (<code>Correcto</code>, <code>Aceptado con errores</code> o <code>Duplicado</code>). Una factura <code>Incorrecto</code> o <code>No registrado</code> se vuelve a enviar con <code>/sii/create</code>.</li>
          <li>Puede cambiar cualquier dato de la factura, también el periodo de liquidación.</li>
          <li>Sobre una factura anulada, la vuelve a registrar.</li>
        </ul>

        Este endpoint admite además una cabecera opcional `Idempotency-Key`. Si se incluye, los reintentos de la misma petición lógica con la misma clave replican la respuesta original (incluyendo la cabecera de respuesta `Idempotent-Replayed: true` y el eco de `Idempotency-Key`). Las claves se vinculan al NIF y se recuerdan durante 24 horas. Reusar la misma clave con un cuerpo diferente devuelve 422; un reintento concurrente mientras el primero sigue en curso devuelve 409. Consulta la sección "Idempotencia" al inicio de esta documentación para más detalles.
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |
            curl --request PUT 'https://api.verifacti.com/sii/modify' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal (descripción corregida)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }'
        - lang: Python
          label: Python
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/modify'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal (descripción corregida)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            response = requests.put(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript
          source: |
            const url = 'https://api.verifacti.com/sii/modify';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal (descripción corregida)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };
            fetch(url, { headers, method: 'PUT', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal (descripción corregida)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            };

            const response = await axios.put("https://api.verifacti.com/sii/modify", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/modify";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE",
              "tipo_factura": "F1",
              "clave_regimen": [
                "01"
              ],
              "descripcion": "Factura normal (descripción corregida)",
              "nombre": "Nombre cliente",
              "nif": "A15022510",
              "desglose": {
                "no_exenta": {
                  "tipo_no_exenta": "S1",
                  "detalle_iva": [
                    {
                      "tipo_impositivo": "21",
                      "base_imponible": "200",
                      "cuota_repercutida": "42"
                    }
                  ]
                }
              },
              "importe_total": "242"
            }
            JSON;

            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\",\n  \"tipo_factura\": \"F1\",\n  \"clave_regimen\": [\n    \"01\"\n  ],\n  \"descripcion\": \"Factura normal (descripción corregida)\",\n  \"nombre\": \"Nombre cliente\",\n  \"nif\": \"A15022510\",\n  \"desglose\": {\n    \"no_exenta\": {\n      \"tipo_no_exenta\": \"S1\",\n      \"detalle_iva\": [\n        {\n          \"tipo_impositivo\": \"21\",\n          \"base_imponible\": \"200\",\n          \"cuota_repercutida\": \"42\"\n        }\n      ]\n    }\n  },\n  \"importe_total\": \"242\"\n}\n`\n\n\treq, err := http.NewRequest(\"PUT\", \"https://api.verifacti.com/sii/modify\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE",
                              "tipo_factura": "F1",
                              "clave_regimen": [
                                "01"
                              ],
                              "descripcion": "Factura normal (descripción corregida)",
                              "nombre": "Nombre cliente",
                              "nif": "A15022510",
                              "desglose": {
                                "no_exenta": {
                                  "tipo_no_exenta": "S1",
                                  "detalle_iva": [
                                    {
                                      "tipo_impositivo": "21",
                                      "base_imponible": "200",
                                      "cuota_repercutida": "42"
                                    }
                                  ]
                                }
                              },
                              "importe_total": "242"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/modify"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .method("PUT", HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C#
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE"",
              ""tipo_factura"": ""F1"",
              ""clave_regimen"": [
                ""01""
              ],
              ""descripcion"": ""Factura normal (descripción corregida)"",
              ""nombre"": ""Nombre cliente"",
              ""nif"": ""A15022510"",
              ""desglose"": {
                ""no_exenta"": {
                  ""tipo_no_exenta"": ""S1"",
                  ""detalle_iva"": [
                    {
                      ""tipo_impositivo"": ""21"",
                      ""base_imponible"": ""200"",
                      ""cuota_repercutida"": ""42""
                    }
                  ]
                }
              },
              ""importe_total"": ""242""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PutAsync("https://api.verifacti.com/sii/modify", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/modify"

            oHttp.Open "PUT", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""," & vbCrLf
            sBody = sBody & "  ""tipo_factura"": ""F1""," & vbCrLf
            sBody = sBody & "  ""clave_regimen"": [" & vbCrLf
            sBody = sBody & "    ""01""" & vbCrLf
            sBody = sBody & "  ]," & vbCrLf
            sBody = sBody & "  ""descripcion"": ""Factura normal (descripción corregida)""," & vbCrLf
            sBody = sBody & "  ""nombre"": ""Nombre cliente""," & vbCrLf
            sBody = sBody & "  ""nif"": ""A15022510""," & vbCrLf
            sBody = sBody & "  ""desglose"": {" & vbCrLf
            sBody = sBody & "    ""no_exenta"": {" & vbCrLf
            sBody = sBody & "      ""tipo_no_exenta"": ""S1""," & vbCrLf
            sBody = sBody & "      ""detalle_iva"": [" & vbCrLf
            sBody = sBody & "        {" & vbCrLf
            sBody = sBody & "          ""tipo_impositivo"": ""21""," & vbCrLf
            sBody = sBody & "          ""base_imponible"": ""200""," & vbCrLf
            sBody = sBody & "          ""cuota_repercutida"": ""42""" & vbCrLf
            sBody = sBody & "        }" & vbCrLf
            sBody = sBody & "      ]" & vbCrLf
            sBody = sBody & "    }" & vbCrLf
            sBody = sBody & "  }," & vbCrLf
            sBody = sBody & "  ""importe_total"": ""242""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          description: Clave única opcional para garantizar que reintentos de la misma petición no creen duplicados. Cadena ASCII imprimible de 1 a 255 caracteres. Se recuerda durante 24 horas por NIF.
          schema:
            type: string
            pattern: ^[\x20-\x7E]{1,255}$
            minLength: 1
            maxLength: 255
            example: 8e1b9c2a-3f4d-4a6b-9c2e-1d2f3e4a5b6c
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Factura"
            examples:
              modificar:
                summary: Modificar una factura
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  serie: A
                  numero: "1"
                  fecha_expedicion: CURRENT_DATE
                  tipo_factura: F1
                  clave_regimen:
                    - "01"
                  descripcion: Factura normal (descripción corregida)
                  nombre: Nombre cliente
                  nif: A15022510
                  desglose:
                    no_exenta:
                      tipo_no_exenta: S1
                      detalle_iva:
                        - tipo_impositivo: "21"
                          base_imponible: "200"
                          cuota_repercutida: "42"
                  importe_total: "242"
      responses:
        "200":
          description: Modificación válida y en cola
          content:
            application/json:
              schema:
                type: object
                properties:
                  uuid:
                    description: Identificador único del registro, para consultar su estado.
                    type: string
                    example: ea6eae92-bac6-48c3-baa4-2bbf6b5ee562
                  estado:
                    description: "Siempre <code>Pendiente</code>: el registro queda en cola."
                    type: string
                    example: Pendiente
        "400":
          description: Error en los datos de la petición. El registro no se genera y no se envía nada a la AEAT.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    description: Descripción del error.
                    type: string
                    example: La cuota_repercutida debe ser base_imponible (o base_imponible_a_coste con la clave 06) por tipo_impositivo / 100, con un margen de 10 euros.
                  codigo:
                    description: Identificador estable del error. Catálogo completo <a href="https://www.verifacti.com/openapi/codigos-sii.yaml" target="_blank">aquí</a>.
                    type: string
                    example: vf-sii-cuota_repercutida_calculo
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/NifInactivo"
        "500":
          description: Error de servidor. El registro no se genera; reintenta más tarde.
  /sii/cancel:
    post:
      summary: Anular factura
      description: |-
        Anula una factura que la AEAT tiene registrada, mediante un registro de baja del SII. <code>ejercicio</code> y <code>periodo</code> deben ser los del alta, o los de la última modificación si la hubo. El resultado será <code>Anulado</code>, o <code>Factura inexistente</code> si la AEAT no tiene la factura.

        Este endpoint admite además una cabecera opcional `Idempotency-Key`. Si se incluye, los reintentos de la misma petición lógica con la misma clave replican la respuesta original (incluyendo la cabecera de respuesta `Idempotent-Replayed: true` y el eco de `Idempotency-Key`). Las claves se vinculan al NIF y se recuerdan durante 24 horas. Reusar la misma clave con un cuerpo diferente devuelve 422; un reintento concurrente mientras el primero sigue en curso devuelve 409. Consulta la sección "Idempotencia" al inicio de esta documentación para más detalles.
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |
            curl --request POST 'https://api.verifacti.com/sii/cancel' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE"
            }'
        - lang: Python
          label: Python
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/cancel'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript
          source: |
            const url = 'https://api.verifacti.com/sii/cancel';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE"
            };

            const response = await axios.post("https://api.verifacti.com/sii/cancel", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/cancel";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH",
              "serie": "A",
              "numero": "1",
              "fecha_expedicion": "CURRENT_DATE"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\",\n  \"serie\": \"A\",\n  \"numero\": \"1\",\n  \"fecha_expedicion\": \"CURRENT_DATE\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/cancel\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH",
                              "serie": "A",
                              "numero": "1",
                              "fecha_expedicion": "CURRENT_DATE"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/cancel"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C#
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH"",
              ""serie"": ""A"",
              ""numero"": ""1"",
              ""fecha_expedicion"": ""CURRENT_DATE""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/cancel", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/cancel"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""," & vbCrLf
            sBody = sBody & "  ""serie"": ""A""," & vbCrLf
            sBody = sBody & "  ""numero"": ""1""," & vbCrLf
            sBody = sBody & "  ""fecha_expedicion"": ""CURRENT_DATE""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          description: Clave única opcional para garantizar que reintentos de la misma petición no creen duplicados. Cadena ASCII imprimible de 1 a 255 caracteres. Se recuerda durante 24 horas por NIF.
          schema:
            type: string
            pattern: ^[\x20-\x7E]{1,255}$
            minLength: 1
            maxLength: 255
            example: 8e1b9c2a-3f4d-4a6b-9c2e-1d2f3e4a5b6c
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - ejercicio
                - periodo
                - serie
                - numero
                - fecha_expedicion
              properties:
                ejercicio:
                  type: string
                  description: Ejercicio del periodo de liquidación del alta (o de la última modificación).
                  example: CURRENT_YEAR
                periodo:
                  type: string
                  enum:
                    - "01"
                    - "02"
                    - "03"
                    - "04"
                    - "05"
                    - "06"
                    - "07"
                    - "08"
                    - "09"
                    - "10"
                    - "11"
                    - "12"
                    - 1T
                    - 2T
                    - 3T
                    - 4T
                  description: Periodo de liquidación del alta (o de la última modificación). No puede ser posterior al periodo actual.
                  example: CURRENT_MONTH
                serie:
                  type: string
                  description: Serie de la factura. Puede ser vacía. Junto con el número, como mucho 60 caracteres.
                  example: A
                numero:
                  type: string
                  description: Número de la factura. En un asiento resumen (F4), el primero del rango.
                  example: "1"
                fecha_expedicion:
                  type: string
                  description: Fecha de expedición de la factura. Formato DD-MM-AAAA.
                  example: CURRENT_DATE
            example:
              ejercicio: CURRENT_YEAR
              periodo: CURRENT_MONTH
              serie: A
              numero: "1"
              fecha_expedicion: CURRENT_DATE
      responses:
        "200":
          description: Anulación válida y en cola
          content:
            application/json:
              schema:
                type: object
                properties:
                  uuid:
                    description: Identificador único del registro, para consultar su estado.
                    type: string
                    example: ea6eae92-bac6-48c3-baa4-2bbf6b5ee562
                  estado:
                    description: "Siempre <code>Pendiente</code>: el registro queda en cola."
                    type: string
                    example: Pendiente
        "400":
          description: Error en los datos de la petición. El registro no se genera y no se envía nada a la AEAT.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    description: Descripción del error.
                    type: string
                    example: El ejercicio y el periodo de la baja no pueden ser posteriores al periodo actual.
                  codigo:
                    description: Identificador estable del error. Catálogo completo <a href="https://www.verifacti.com/openapi/codigos-sii.yaml" target="_blank">aquí</a>.
                    type: string
                    example: vf-sii-baja_periodo_futuro
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/NifInactivo"
        "500":
          description: Error de servidor. El registro no se genera; reintenta más tarde.
  /sii/list:
    post:
      summary: Listar facturas
      description: |-
        Consulta a la AEAT las facturas del libro de un periodo de liquidación y devuelve las que se enviaron desde este NIF de Verifacti.
        <ul style="list-style: disc;">
          <li>Cada factura se devuelve con los nombres de <code>/sii/create</code>, salvo <code>num_serie</code>: la AEAT devuelve la serie y el número juntos.</li>
          <li>El <code>uuid</code> es el del último registro enviado para esa factura (alta, modificación o anulación).</li>
          <li>Los importes llegan como los guarda la AEAT, sin ceros finales (<code>242</code> en lugar de <code>242.00</code>).</li>
          <li>La AEAT devuelve hasta 10.000 facturas por página. Si <code>paginacion</code> es <code>S</code>, pide la siguiente página con el mismo <code>ejercicio</code> y <code>periodo</code> y el <code>token</code> recibido.</li>
        </ul>
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |
            curl --request POST 'https://api.verifacti.com/sii/list' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            }'
        - lang: Python
          label: Python
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/list'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript
          source: |
            const url = 'https://api.verifacti.com/sii/list';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            };

            const response = await axios.post("https://api.verifacti.com/sii/list", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/list";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/list\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/list"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C#
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/list", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/list"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - ejercicio
                - periodo
              properties:
                ejercicio:
                  type: string
                  description: Ejercicio del periodo de liquidación en el que se declara la factura (4 cifras).
                  example: CURRENT_YEAR
                periodo:
                  type: string
                  enum:
                    - "01"
                    - "02"
                    - "03"
                    - "04"
                    - "05"
                    - "06"
                    - "07"
                    - "08"
                    - "09"
                    - "10"
                    - "11"
                    - "12"
                    - 1T
                    - 2T
                    - 3T
                    - 4T
                  description: "Periodo de liquidación: 01 a 12 o 1T a 4T."
                  example: CURRENT_MONTH
                token:
                  type: string
                  description: Token de la página anterior, para pedir la siguiente.
            examples:
              listar:
                summary: Primera página
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
              listar_siguiente:
                summary: Página siguiente
                value:
                  ejercicio: CURRENT_YEAR
                  periodo: CURRENT_MONTH
                  token: TOKEN_DE_LA_PAGINA_ANTERIOR
      responses:
        "200":
          description: Facturas del periodo
          content:
            application/json:
              schema:
                type: object
                properties:
                  paginacion:
                    type: string
                    enum:
                      - S
                      - "N"
                    description: S si hay más páginas.
                    example: "N"
                  token:
                    type: string
                    nullable: true
                    description: Token para pedir la página siguiente, o null.
                    example: null
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/RegistroLibro"
        "400":
          description: Error en los datos de la petición. El registro no se genera y no se envía nada a la AEAT.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    description: Descripción del error.
                    type: string
                    example: ejercicio (4 digitos) y periodo (01-12, 1T-4T o 0A) son requeridos
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/NifInactivo"
        "502":
          description: La consulta a la AEAT no se ha podido completar. Vuelve a intentarlo en unos minutos.
  /sii/export:
    post:
      summary: Exportar XMLs
      description: Devuelve URLs firmadas para descargar los XML enviados a la AEAT en un mes de presentación (cada envío con su respuesta, <code>_req.xml</code> y <code>_res.xml</code>). Las URLs caducan a los 15 minutos. Se devuelven 500 por página; si <code>token</code> no es null, pide la siguiente con él. <code>ejercicio</code> y <code>periodo</code> son el año y el mes de presentación, no el periodo de liquidación.
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |
            curl --request POST 'https://api.verifacti.com/sii/export' \
            --header 'Authorization: Bearer <API_KEY>' \
            --header 'Content-Type: application/json' \
            --data '{
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            }'
        - lang: Python
          label: Python
          source: |
            import requests
            url = 'https://api.verifacti.com/sii/export'
            headers = {
              'Authorization': 'Bearer <API_KEY>'
            }
            data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            }
            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: JavaScript
          label: JavaScript
          source: |
            const url = 'https://api.verifacti.com/sii/export';
            const headers = {
              'Authorization': 'Bearer <API_KEY>',
              'Content-Type': 'application/json'
            };
            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            };
            fetch(url, { headers, method: 'POST', body: JSON.stringify(data) })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: Node.js
          label: Node.js
          source: |-
            const axios = require("axios");

            const data = {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            };

            const response = await axios.post("https://api.verifacti.com/sii/export", data, {
              headers: {
                "Authorization": "Bearer <API_KEY>",
                "Content-Type": "application/json"
              }
            });

            console.log(response.data);
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $url = "https://api.verifacti.com/sii/export";

            $headers = [
                "Authorization: Bearer <API_KEY>",
                "Content-Type: application/json"
            ];

            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $body = <<<'JSON'
            {
              "ejercicio": "CURRENT_YEAR",
              "periodo": "CURRENT_MONTH"
            }
            JSON;

            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

            $response = curl_exec($ch);
            $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);

            echo "HTTP Status: " . $httpCode . "\n";
            echo $response;
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc main() {\n\tbody := `\n{\n  \"ejercicio\": \"CURRENT_YEAR\",\n  \"periodo\": \"CURRENT_MONTH\"\n}\n`\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.verifacti.com/sii/export\", strings.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treq.Header.Set(\"Authorization\", \"Bearer <API_KEY>\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(\"Status:\", resp.StatusCode)\n\tfmt.Println(string(respBody))\n}"
        - lang: Java
          label: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            public class Main {
                public static void main(String[] args) throws Exception {
                    HttpClient client = HttpClient.newHttpClient();

                    String body = """
                            {
                              "ejercicio": "CURRENT_YEAR",
                              "periodo": "CURRENT_MONTH"
                            }
                            """;

                    HttpRequest request = HttpRequest.newBuilder()
                        .uri(URI.create("https://api.verifacti.com/sii/export"))
                        .header("Authorization", "Bearer <API_KEY>")
                        .header("Content-Type", "application/json")
                        .POST(HttpRequest.BodyPublishers.ofString(body))
                        .build();

                    HttpResponse<String> response = client.send(request,
                        HttpResponse.BodyHandlers.ofString());

                    System.out.println(response.statusCode());
                    System.out.println(response.body());
                }
            }
        - lang: C#
          label: C#
          source: |-
            using System;
            using System.Net.Http;
            using System.Text;
            using System.Threading.Tasks;

            class Program
            {
                static async Task Main()
                {
                    using var client = new HttpClient();
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer <API_KEY>");

                    var body = @"
            {
              ""ejercicio"": ""CURRENT_YEAR"",
              ""periodo"": ""CURRENT_MONTH""
            }
            ";

                    var content = new StringContent(body, Encoding.UTF8, "application/json");

                    var response = await client.PostAsync("https://api.verifacti.com/sii/export", content);

                    var responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine($"Status: {response.StatusCode}");
                    Console.WriteLine(responseBody);
                }
            }
        - lang: VB6
          label: VB6
          source: |-
            Dim oHttp As Object
            Dim sUrl As String
            Dim sResponse As String
            Dim sBody As String

            Set oHttp = CreateObject("MSXML2.XMLHTTP.6.0")

            sUrl = "https://api.verifacti.com/sii/export"

            oHttp.Open "POST", sUrl, False
            oHttp.setRequestHeader "Authorization", "Bearer <API_KEY>"
            oHttp.setRequestHeader "Content-Type", "application/json"

            sBody = ""
            sBody = sBody & "{" & vbCrLf
            sBody = sBody & "  ""ejercicio"": ""CURRENT_YEAR""," & vbCrLf
            sBody = sBody & "  ""periodo"": ""CURRENT_MONTH""" & vbCrLf
            sBody = sBody & "}" & vbCrLf

            oHttp.send sBody

            sResponse = oHttp.responseText
            Debug.Print "Status: " & oHttp.Status
            Debug.Print sResponse

            Set oHttp = Nothing
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - ejercicio
                - periodo
              properties:
                ejercicio:
                  type: string
                  description: Año de presentación.
                  example: CURRENT_YEAR
                periodo:
                  type: string
                  description: Mes de presentación, de 1 a 12.
                  example: CURRENT_MONTH
                token:
                  type: string
                  description: Token de la página anterior.
            example:
              ejercicio: CURRENT_YEAR
              periodo: CURRENT_MONTH
      responses:
        "200":
          description: URLs de descarga
          content:
            application/json:
              schema:
                type: object
                properties:
                  urls:
                    type: array
                    items:
                      type: string
                    description: URLs firmadas de los XML.
                  token:
                    type: string
                    nullable: true
                    description: Token para la página siguiente, o null.
                    example: null
        "400":
          description: Faltan ejercicio o periodo, o el periodo no es un mes.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/NifInactivo"
components:
  responses:
    Unauthorized:
      description: API key ausente o no válida.
    NifInactivo:
      description: El NIF asociado a la API key está desactivado. La petición no se procesa.
  schemas:
    Factura:
      type: object
      required:
        - ejercicio
        - periodo
        - serie
        - numero
        - fecha_expedicion
        - tipo_factura
        - clave_regimen
        - descripcion
        - desglose
      properties:
        ejercicio:
          type: string
          description: Ejercicio del periodo de liquidación en el que se declara la factura (4 cifras).
          example: CURRENT_YEAR
        periodo:
          type: string
          enum:
            - "01"
            - "02"
            - "03"
            - "04"
            - "05"
            - "06"
            - "07"
            - "08"
            - "09"
            - "10"
            - "11"
            - "12"
            - 1T
            - 2T
            - 3T
            - 4T
          description: "Periodo de liquidación: un mes (01 a 12) o, para quien liquida por trimestres, un trimestre (1T a 4T). Lo indicas tú: no se calcula a partir de las fechas. No puede ser posterior al periodo actual, salvo con las claves 14 y 15."
          example: CURRENT_MONTH
        serie:
          type: string
          description: Serie de la factura. Puede ser vacía. Junto con el número, como mucho 60 caracteres.
          example: A
        numero:
          type: string
          description: Número de la factura.
          example: "1"
        numero_fin:
          type: string
          description: "Solo en asientos resumen (F4), y obligatorio en ellos: número de la última factura del rango, de la misma serie."
          example: "50"
        fecha_expedicion:
          type: string
          description: Fecha de expedición. No puede ser posterior a hoy ni anterior a hace 20 años. Formato DD-MM-AAAA.
          example: CURRENT_DATE
        tipo_factura:
          type: string
          enum:
            - F1
            - F2
            - F3
            - F4
            - R1
            - R2
            - R3
            - R4
            - R5
          description: "Tipo de factura:<ul style=\"list-style: disc;\"><li>F1: factura completa</li><li>F2: factura simplificada</li><li>F3: factura emitida en sustitución de facturas simplificadas</li><li>F4: asiento resumen de facturas</li><li>R1: rectificativa (error fundado en derecho y art. 80 Uno, Dos y Seis LIVA)</li><li>R2: rectificativa (art. 80.3)</li><li>R3: rectificativa (art. 80.4)</li><li>R4: rectificativa (resto)</li><li>R5: rectificativa de facturas simplificadas</li></ul>"
          example: F1
        tipo_rectificativa:
          type: string
          enum:
            - S
            - I
          description: "Obligatorio en las rectificativas (R1 a R5), y solo en ellas: S por sustitución, I por diferencias."
        facturas_rectificadas:
          type: array
          description: Facturas que se rectifican. Solo en rectificativas (R1 a R5) y asientos resumen (F4).
          items:
            type: object
            required:
              - serie
              - numero
              - fecha_expedicion
            properties:
              serie:
                type: string
                description: Serie de la factura (puede ser vacía).
              numero:
                type: string
                description: Número de la factura.
              fecha_expedicion:
                type: string
                description: Fecha de expedición. Formato DD-MM-AAAA.
                example: CURRENT_DATE
        facturas_sustituidas:
          type: array
          description: Facturas simplificadas que sustituye esta factura. Solo en F3.
          items:
            type: object
            required:
              - serie
              - numero
              - fecha_expedicion
            properties:
              serie:
                type: string
                description: Serie de la factura (puede ser vacía).
              numero:
                type: string
                description: Número de la factura.
              fecha_expedicion:
                type: string
                description: Fecha de expedición. Formato DD-MM-AAAA.
                example: CURRENT_DATE
        importe_rectificativa:
          type: object
          required:
            - base_rectificada
            - cuota_rectificada
          description: Importes de la factura rectificada. Obligatorio con <code>tipo_rectificativa</code> S; también se admite en F4.
          properties:
            base_rectificada:
              type: string
              description: Base imponible rectificada. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
              example: "200"
            cuota_rectificada:
              type: string
              description: Cuota rectificada. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
              example: "42"
            cuota_recargo_rectificada:
              type: string
              description: Cuota de recargo de equivalencia rectificada. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
              example: "10.4"
        fecha_operacion:
          type: string
          description: Fecha de la operación, si es distinta de la de expedición. Solo puede ser posterior a la de expedición (o a hoy) con las claves 14 y 15. Formato DD-MM-AAAA.
          example: CURRENT_DATE
        clave_regimen:
          type: array
          minItems: 1
          maxItems: 3
          description: "Claves de régimen especial o trascendencia de la factura, de 1 a 3: la primera es la principal. No todas las combinaciones son válidas (por ejemplo, la 01 solo admite la 02 como adicional). Valores:<ul style=\"list-style: disc;\"><li>01: Operación de régimen general</li><li>02: Exportación</li><li>03: Régimen especial de bienes usados, objetos de arte, antigüedades y objetos de colección (REBU)</li><li>04: Régimen especial del oro de inversión</li><li>05: Régimen especial de las agencias de viajes</li><li>06: Régimen especial grupo de entidades en IVA (nivel avanzado)</li><li>07: Régimen especial del criterio de caja</li><li>08: Operaciones sujetas al IPSI o al IGIC</li><li>09: Prestaciones de servicios de agencias de viaje que actúan como mediadoras en nombre y por cuenta ajena</li><li>10: Cobros por cuenta de terceros</li><li>11: Arrendamiento de local de negocio sujeto a retención</li><li>12: Arrendamiento de local de negocio no sujeto a retención</li><li>13: Arrendamiento de local de negocio sujeto y no sujeto a retención</li><li>14: Factura con IVA pendiente de devengo en certificaciones de obra cuyo destinatario sea una Administración Pública</li><li>15: Factura con IVA pendiente de devengo en operaciones de tracto sucesivo</li><li>16: Primer semestre de 2017 y facturas anteriores a la inclusión en el SII</li><li>17: Operación acogida a alguno de los regímenes previstos en el Capítulo XI del Título IX (OSS e IOSS)</li></ul>"
          items:
            type: string
            enum:
              - "01"
              - "02"
              - "03"
              - "04"
              - "05"
              - "06"
              - "07"
              - "08"
              - "09"
              - "10"
              - "11"
              - "12"
              - "13"
              - "14"
              - "15"
              - "16"
              - "17"
          example:
            - "01"
        importe_total:
          type: string
          description: Importe total de la factura. Obligatorio con las claves 03, 05 y 09, y en F2, F4 y R5 con una sola línea de base 0. Si lo indicas, la AEAT lo compara con el desglose (margen de 10 €). Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
          example: "242"
        base_imponible_a_coste:
          type: string
          description: Base imponible a coste. Obligatoria con la clave 06, y solo con ella. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
          example: "150"
        descripcion:
          type: string
          maxLength: 500
          description: Descripción de la operación (hasta 500 caracteres).
          example: Factura normal
        importe_transmision_inmuebles_sujeto_iva:
          type: string
          description: Importe de la transmisión de inmuebles sujeta a IVA. Requiere identificar la contraparte. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
          example: "1000"
        inmuebles:
          type: array
          maxItems: 15
          description: Inmuebles arrendados, de 1 a 15. Obligatorio con las claves 12 y 13, y solo con ellas.
          items:
            type: object
            required:
              - situacion
            properties:
              situacion:
                type: string
                enum:
                  - "1"
                  - "2"
                  - "3"
                  - "4"
                description: "1: con referencia catastral en España salvo País Vasco y Navarra. 2: en País Vasco o Navarra. 3: sin referencia catastral, en cualquiera de los anteriores. 4: en el extranjero."
              referencia_catastral:
                type: string
                maxLength: 25
                description: Referencia catastral. Obligatoria salvo con situación 3 o 4.
                example: 9872023VH5797S0001WX
        nombre:
          type: string
          maxLength: 120
          description: Nombre o razón social de la contraparte. La contraparte es obligatoria en F1, F3 y R1 a R4, y no se admite en F2, F4 y R5.
          example: Nombre cliente
        nif:
          type: string
          description: NIF español de la contraparte. Se indica <code>nif</code> o <code>id_otro</code>, no los dos.
          example: A15022510
        id_otro:
          type: object
          required:
            - id_type
            - id
          description: Identificación de una contraparte sin NIF español.
          properties:
            codigo_pais:
              type: string
              description: Código ISO 3166-1 alfa-2 del país. Obligatorio salvo con <code>id_type</code> 02; con 07 debe ser ES.
              example: US
            id_type:
              type: string
              enum:
                - "02"
                - "03"
                - "04"
                - "05"
                - "06"
                - "07"
              description: "02: NIF-IVA. 03: pasaporte. 04: documento oficial de identificación del país de residencia. 05: certificado de residencia. 06: otro documento probatorio. 07: no censado (persona física con NIF español no censada; el país debe ser ES)."
            id:
              type: string
              maxLength: 20
              description: Número de identificación (hasta 20 caracteres). Con 02, el NIF-IVA completo con el prefijo del país.
              example: BE0404621642
        nif_representante:
          type: string
          description: NIF del representante de la contraparte, si lo tiene.
        validar_destinatario:
          type: boolean
          default: true
          description: Si se incluye <code>nif</code>, validamos por defecto que la contraparte está censada en la AEAT, y con <code>id_otro</code> de tipo 02 que el NIF-IVA está en el censo VIES, porque si no la AEAT rechaza la factura. Esto requiere una llamada adicional por nuestro lado. Puedes desactivar estas validaciones en el entorno de test poniendo este campo a <code>false</code>; en producción se hacen siempre.
        especial:
          type: object
          description: Indicadores de casos especiales.
          properties:
            cupon:
              type: string
              enum:
                - S
                - "N"
              description: Cupón. Solo en R1, R5 y F4 (en otros tipos no se admite, ni siquiera con N).
            factura_simplificada_art_7273:
              type: string
              enum:
                - S
                - "N"
              description: Factura simplificada cualificada (arts. 7.2 y 7.3 del Reglamento de facturación). S solo en F1, F3 y R1 a R4.
            factura_sin_identif_destinatario_art_61d:
              type: string
              enum:
                - S
                - "N"
              description: Factura sin identificación del destinatario (art. 6.1.d). S solo en F2, F4 y R5.
            macrodato:
              type: string
              enum:
                - S
                - "N"
              description: Obligatorio con S si el importe total es igual o superior a ±100.000.000 €, y solo en ese caso.
            emitida_por_tercero_o_destinatario:
              type: string
              enum:
                - S
                - "N"
              description: S si la factura la emite realmente un tercero o el propio destinatario. No puede ser S a la vez que <code>facturacion_mercado_organizado_gas</code>.
            varios_destinatarios:
              type: string
              enum:
                - S
                - "N"
              description: "S si la factura tiene varios destinatarios: el SII admite una sola contraparte, así que se identifica a uno de ellos."
            num_registro_acuerdo_facturacion:
              type: string
              maxLength: 15
              description: Número de registro del acuerdo de facturación (hasta 15 caracteres).
            entidad_sucedida:
              type: object
              required:
                - nombre
                - nif
              description: Entidad sucedida, tras una operación de reestructuración.
              properties:
                nombre:
                  type: string
                  maxLength: 120
                  description: Nombre o razón social.
                nif:
                  type: string
                  description: NIF.
            reg_previo_ggee_redeme_competencia:
              type: string
              enum:
                - S
                - "N"
              description: Registro previo en el grupo de entidades, el REDEME o competencia.
            facturacion_mercado_organizado_gas:
              type: string
              enum:
                - S
                - "N"
              description: Facturación de la disposición adicional tercera y sexta y del mercado organizado del gas.
            hidrocarburos_extraidos_deposito:
              type: string
              enum:
                - S
                - "N"
              description: Hidrocarburos extraídos de un depósito fiscal.
        desglose:
          $ref: "#/components/schemas/Desglose"
    Desglose:
      type: object
      description: "Desglose de la factura, con la estructura del SII. Tiene dos formas, que se distinguen por sus claves:<ul style=\"list-style: disc;\"><li><strong>Plana</strong>: <code>exenta</code>, <code>no_exenta</code> y/o <code>no_sujeta</code> directamente en <code>desglose</code>.</li><li><strong>Por tipo de operación</strong>: <code>entrega</code> (entrega de bienes) y/o <code>prestacion_servicios</code>, cada una con sus propios <code>exenta</code>, <code>no_exenta</code> y <code>no_sujeta</code>.</li></ul>La forma por tipo de operación es obligatoria cuando la contraparte se identifica con <code>id_otro</code> o con un NIF que empieza por N, salvo en F2 y F4. En el resto de casos se admite cualquiera de las dos. No se pueden mezclar las dos formas."
      properties:
        exenta:
          type: array
          maxItems: 7
          description: Parte sujeta y exenta, de 1 a 7 detalles.
          items:
            type: object
            required:
              - base_imponible
            properties:
              causa_exencion:
                type: string
                enum:
                  - E1
                  - E2
                  - E3
                  - E4
                  - E5
                  - E6
                description: "Causa de exención: E1 (art. 20 LIVA), E2 (art. 21, exportaciones), E3 (art. 22), E4 (arts. 23 y 24), E5 (art. 25, entregas intracomunitarias), E6 (otros)."
              base_imponible:
                type: string
                description: Base imponible exenta. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
                example: "200"
        no_exenta:
          type: object
          required:
            - tipo_no_exenta
            - detalle_iva
          description: Parte sujeta y no exenta.
          properties:
            tipo_no_exenta:
              type: string
              enum:
                - S1
                - S2
                - S3
              description: "S1: sin inversión del sujeto pasivo. S2: con inversión del sujeto pasivo (tipo y cuota 0). S3: con y sin inversión del sujeto pasivo (al menos una línea con tipo 0)."
            detalle_iva:
              type: array
              minItems: 1
              maxItems: 12
              description: De 1 a 12 líneas, una por tipo impositivo.
              items:
                $ref: "#/components/schemas/DetalleIVA"
        no_sujeta:
          type: object
          description: Parte no sujeta. Al menos uno de los dos importes.
          properties:
            importe_por_articulos_7_14_otros:
              type: string
              description: Importe no sujeto por los artículos 7 y 14 de la LIVA y otros. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
              example: "200"
            importe_tai_reglas_localizacion:
              type: string
              description: Importe no sujeto por las reglas de localización (operaciones que tributan fuera del territorio de aplicación del impuesto). Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
              example: "200"
        entrega:
          $ref: "#/components/schemas/BloqueDesglose"
        prestacion_servicios:
          $ref: "#/components/schemas/BloqueDesglose"
    BloqueDesglose:
      type: object
      description: Al menos uno de <code>exenta</code>, <code>no_exenta</code> o <code>no_sujeta</code>.
      properties:
        exenta:
          type: array
          maxItems: 7
          description: Parte sujeta y exenta, de 1 a 7 detalles.
          items:
            type: object
            required:
              - base_imponible
            properties:
              causa_exencion:
                type: string
                enum:
                  - E1
                  - E2
                  - E3
                  - E4
                  - E5
                  - E6
                description: "Causa de exención: E1 (art. 20 LIVA), E2 (art. 21, exportaciones), E3 (art. 22), E4 (arts. 23 y 24), E5 (art. 25, entregas intracomunitarias), E6 (otros)."
              base_imponible:
                type: string
                description: Base imponible exenta. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
                example: "200"
        no_exenta:
          type: object
          required:
            - tipo_no_exenta
            - detalle_iva
          description: Parte sujeta y no exenta.
          properties:
            tipo_no_exenta:
              type: string
              enum:
                - S1
                - S2
                - S3
              description: "S1: sin inversión del sujeto pasivo. S2: con inversión del sujeto pasivo (tipo y cuota 0). S3: con y sin inversión del sujeto pasivo (al menos una línea con tipo 0)."
            detalle_iva:
              type: array
              minItems: 1
              maxItems: 12
              description: De 1 a 12 líneas, una por tipo impositivo.
              items:
                $ref: "#/components/schemas/DetalleIVA"
        no_sujeta:
          type: object
          description: Parte no sujeta. Al menos uno de los dos importes.
          properties:
            importe_por_articulos_7_14_otros:
              type: string
              description: Importe no sujeto por los artículos 7 y 14 de la LIVA y otros. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
              example: "200"
            importe_tai_reglas_localizacion:
              type: string
              description: Importe no sujeto por las reglas de localización (operaciones que tributan fuera del territorio de aplicación del impuesto). Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
              example: "200"
    DetalleIVA:
      type: object
      required:
        - base_imponible
      properties:
        tipo_impositivo:
          type: string
          description: "Tipo impositivo en %: 0, 4, 10 o 21 (5, 2 y 7,5 solo en las fechas y casos en que estuvieron vigentes; 7, 8, 16 y 18 para operaciones hasta 2012)."
          example: "21"
        base_imponible:
          type: string
          description: Base imponible. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
          example: "200"
        cuota_repercutida:
          type: string
          description: "Cuota repercutida: base imponible × tipo / 100, con un margen de 10 €. Obligatoria si el tipo es distinto de 0 (salvo en F4 y R5). Número con hasta 12 cifras enteras y 2 decimales, separados por un punto."
          example: "42"
        tipo_recargo_equivalencia:
          type: string
          description: "Tipo del recargo de equivalencia en %. Va con el tipo impositivo: 21 → 5,2 o 1,75; 10 → 1,4; 4 → 0,5. No se admite en <code>prestacion_servicios</code>."
          example: "5.2"
        cuota_recargo_equivalencia:
          type: string
          description: Cuota del recargo de equivalencia. No se admite en <code>prestacion_servicios</code>. Número con hasta 12 cifras enteras y 2 decimales, separados por un punto.
          example: "10.4"
    RegistroLibro:
      type: object
      description: Un registro del libro, con los nombres de <code>/sii/create</code>.
      properties:
        uuid:
          type: string
          description: uuid del último registro que Verifacti envió para esta factura (alta, modificación o anulación).
        num_serie:
          type: string
          description: Serie y número juntos, como los devuelve la AEAT.
        num_serie_fin:
          type: string
          description: En asientos resumen (F4), serie y número de la última factura.
        fecha_expedicion:
          type: string
        tipo_factura:
          type: string
        clave_regimen:
          type: array
          items:
            type: string
        importe_total:
          type: string
        descripcion:
          type: string
        nombre:
          type: string
        nif:
          type: string
        id_otro:
          type: object
        especial:
          type: object
        desglose:
          type: object
        estado:
          type: string
          enum:
            - Correcta
            - AceptadaConErrores
            - Anulada
          description: Estado de la factura en el libro de la AEAT.
        codigo_error:
          type: string
        mensaje_error:
          type: string
        estado_cuadre:
          type: string
          description: Estado del cuadre con la información de la contraparte, de 1 a 5, si la AEAT lo indica.
        fecha_presentacion:
          type: string
          description: Fecha y hora de presentación (DD-MM-AAAA hh:mm:ss).
        ultima_modificacion:
          type: string
          description: Fecha y hora de la última modificación en el libro.
      example:
        uuid: ea6eae92-bac6-48c3-baa4-2bbf6b5ee562
        num_serie: A1
        fecha_expedicion: CURRENT_DATE
        tipo_factura: F1
        clave_regimen:
          - "01"
        importe_total: "242"
        descripcion: Factura normal
        nombre: Nombre cliente
        nif: A15022510
        especial:
          emitida_por_tercero_o_destinatario: "N"
          varios_destinatarios: "N"
        desglose:
          no_exenta:
            tipo_no_exenta: S1
            detalle_iva:
              - tipo_impositivo: "21"
                base_imponible: "200"
                cuota_repercutida: "42"
        estado: Correcta
        fecha_presentacion: CURRENT_DATE 10:04:07
        ultima_modificacion: CURRENT_DATE 10:04:07
