Documentación / Autorización ante la AEAT
Documento de representación - Descargar documento cargado
GET https://{entorno}.verifactu.ws/doc-representante/
Descarga el documento de representación ya cargado (Verifactu, Bizkaia o Gipuzkoa) y firmado también por Verifactu WS. Devuelve el fichero PDF en base 64.
Los métodos GET permiten el envío de los parámetros en el body como payload JSON o mediante query string en la URL como se ve en el ejemplo cURL.
Empresas de Araba: este método no está disponible, porque en Araba la autorización es el registro del certificado de dispositivo (ver instrucciones). Devuelve un error:
{"result": "ERROR", "return": null, "msg": "El documento de representación no está disponible para empresas de Araba. Registra el certificado de dispositivo de Verifactu WS en la sede de la Diputación Foral de Álava."}PARÁMETROS
-- El método no permite enviar parámetros --
GET https://{entorno}.verifactu.ws/doc-representante/
$ curl --request GET \
--url https://api-test.verifactu.ws/doc-representante/ \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Token: xxx' \
--header 'Nif: 00000014Z'
$ composer require ticketbaiws/ticketbaiws-php
<?php
// Instalación: composer require ticketbaiws/ticketbaiws-php
require 'vendor/autoload.php';
$tbai = new \TicketbaiWS\Client('xxx', '00000014Z', ['entorno' => 'test']);
$r = $tbai->descargarDocRepresentante();
if ($r->isError()) {
echo $r->getMessageText();
} else {
file_put_contents('representacion-firmada.pdf', base64_decode($r->getData()));
}
$ python -m pip install requests
import requests
url = "https://api-test.verifactu.ws/doc-representante/"
headers = {"Accept": "application/json", "Token" : "xxx", "Nif" : "00000014Z"}
response = requests.request("GET", url, headers=headers)
print(response.text)
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-test.verifactu.ws/doc-representante/");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api-test.verifactu.ws/doc-representante/")
.get()
.addHeader("Accept", "application/json")
.addHeader("Token", "xxx")
.addHeader("Nif", "00000014Z")
.build();
Response response = client.newCall(request).execute();
{ } Response JSON
HTTP/1.1 200 OK
{
"result": "OK",
"return": "JVBERi0xLjcNJeLjz9MNCjE1OSAwIG9iag08PC9MaW5lYXJpemVkIDEvTCAxMzQ0MTMwL08gMTYx...",
"msg": null
}
Métodos de facturas Verifactu
- POST Nueva factura / subsanación (zuzendu) TicketBAI / Verifactu
- POST Completar factura simplificada
- GET Consulta factura TicketBAI / Verifactu
- GET Listado facturas TicketBAI / Verifactu
- GET Descarga XML TicketBAI / Verifactu
- GET Descarga factura en formato FacturaE
- GET Descarga factura en PDF
- GET Estado sistema
- DEL Anular factura TicketBAI / Verifactu
- PUT Forzar reenvío TicketBAI / Verifactu
- POST Validar NIF en la AEAT
- POST Validar NIF en el VIES
Documento representación
- GET Documento Representación - Descargar modelo
- POST Documento Representación - Enviar documento
- GET Documento Representación - Descargar documento cargado
- DELETE Documento Representación - Revocar documento cargado
Clientes y productos (herramienta de facturación)
- GET Clientes - Buscar / consultar clientes
- POST Clientes - Nuevo cliente
- PUT Clientes - Modificar cliente
- GET Productos - Buscar / consultar productos