Sibill Document API
The Document API from Sibill — 5 operation(s) for document.
The Document API from Sibill — 5 operation(s) for document.
openapi: 3.0.0
info:
title: Sibill Integration Account Document API
version: 1.0.0
x-logo:
altText: Sibill logo
backgroundColor: '#FFFFFF'
url: https://sibill.com/wp-content/uploads/2022/12/logo-sibill.svg
servers:
- url: http://integration.app.svc.cluster.local:4000
variables: {}
security: []
tags:
- name: Document
paths:
/api/v1/companies/{company_id}/documents:
get:
callbacks: {}
description: 'The return value is paginated. By default the response contains 25 elements per page but can be instructed to return more elements per page.
A cursor is needed to traverse the results.
'
operationId: SibillWeb.Integration.V1.DocumentsController.index
parameters:
- description: The company the documents belong to
in: path
name: company_id
required: true
schema:
type: string
- description: The page size
in: query
name: page_size
required: false
schema:
type: integer
- description: 'The pagination cursor. A cursor is used to paginate through a large set of data.
It is a unique identifier that represents a specific position in the dataset.
'
in: query
name: cursor
required: false
schema:
type: string
- description: 'Fields that will be expanded. Expandable fields: `category`, `counterpart`, `flows`, `subcategory`'
in: query
name: expand
required: false
schema:
type: string
- description: 'List of filters on the resource. Currently the fields that allow to be filtered are: `creation_date`, `delivery_date`, `direction`, `status`, `type`, `number`,`counterpart_company_name`, `notes`, `progressive`, `sectional_id`, `source_id`'
in: query
name: filter
required: false
schema:
type: object
- description: 'Fields for which we can order the results. Sortable fields: `created_at`, `creation_date`, `delivery_date`, `number`, `progressive`'
in: query
name: sort
required: false
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentList'
description: Ok
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Bad request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Forbidden
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Too Many Requests
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Internal Server Error
security:
- authorization: []
summary: List all the company's documents
tags:
- Document
x-codeSamples:
- label: ⚡ cURL
lang: Shell
source: "base_url=\"http://example.com\" # Replace with the correct Sibill integration API host\n\ncurl --request GET \\\n --url ${base_url}/api/v1/companies/:company_id/documents \\\n --header \"Authorization: Bearer ${authorization_token}\"\n"
- label: 🌐 HTTP
lang: HTTP
source: 'GET /api/v1/companies/:company_id/documents HTTP/1.1
Host: example.com # Replace with the correct Sibill integration API host
Authorization: Bearer ${authorization_token}
'
- label: 💜 Elixir
lang: Elixir
source: 'Mix.install([:req])
base_url = "http://example.com" # Replace with the correct Sibill integration API host
url = base_url <> "/api/v1/companies/:company_id/documents"
headers = [{"Authorization", "Bearer ${authorization_token}"}]
Req.get(url, headers: headers)
'
- label: 🐍 Python
lang: Python
source: 'import requests
base_url = "http://example.com" # Replace with the correct Sibill integration API host
url = base_url + "/api/v1/companies/:company_id/documents"
headers = {"Authorization": "Bearer ${authorization_token}"}
response = requests.get(url, headers=headers)
print(response.text)
'
- label: ☕ Java
lang: Java
source: "import java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.URI;\n\nString base_url = \"http://example.com\"; // Replace with the correct Sibill integration API host\nString url = base_url + \"/api/v1/companies/:company_id/documents\";\n\nHttpClient client = HttpClient.newHttpClient();\nHttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(url))\n .header(\"Authorization\", \"Bearer ${authorization_token}\")\n .GET()\n .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n"
- label: 🐘 PHP
lang: PHP
source: "<?php\n\n$url = \"http://example.com/api/v1/companies/:company_id/documents\"; // Replace with the correct Sibill integration API host\n\n$ch = curl_init($url);\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n \"Authorization: Bearer ${authorization_token}\"\n]);\n\n$response = curl_exec($ch);\n\nif (curl_errno($ch)) {\n echo 'Curl error: ' . curl_error($ch);\n} else {\n echo 'Response:' . PHP_EOL;\n echo $response;\n}\n\ncurl_close($ch);\n"
/api/v1/companies/{company_id}/documents/invoice:
post:
callbacks: {}
description: 'Create an invoice. By default will be created as draft and not issued.
The request body (that could be <b>application/xml</b> or <b>application/json</b>) represent the <a href=''https://www.fatturapa.gov.it/it/norme-e-regole/documentazione-fattura-elettronica/formato-fatturapa/'' target=''_blank''>Italian Electronic invoice format</a>.
For example, if the XML content comes from another system — perhaps as a file — the request body will contain the file''s content.
The content should represent only one invoice; content with multiple invoices is not supported yet.
The invoice `numero` is under customer control (i.e. customer must choose it), while the `file name` and the `progressivo invio` are automatically generated by the system.
'
operationId: SibillWeb.Integration.V1.DocumentsActionsController.create_invoice
parameters:
- description: The company where to execute the operation
in: path
name: company_id
required: true
schema:
type: string
- description: Issue the invoice after creating it. If true, the invoice is issued. Default value is false. In this case, the invoice is created as a draft and not issued.
in: query
name: issue
required: false
schema:
type: boolean
- description: A unique identifier used to match an invoice with its corresponding transaction. This can be, for example, an ID coming from your collection system (ex. Transaction ID on Stripe or Paypal) that you want to pass when issuing the invoice to be able to reconcile the movement and the invoice automatically
in: query
name: reconciliation_identifier
required: false
schema:
type: string
- description: The sectional identifier to associate with the document
in: query
name: sectional_id
required: false
schema:
type: string
- description: Automatically populate/override invoice number with the next number of `sectional_id`. If `sectional_id` is null, it generates a number without sectional
in: query
name: automatic_number
required: false
schema:
type: boolean
- description: Indicate the original mime type of the resource. It could be <b>application/xml</b> or <b>application/json</b>
in: header
name: content-type
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Invoice'
application/xml:
example: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FatturaElettronica xmlns=\"http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2\"\n xsi:schemaLocation=\"http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 schema.xsd\"\n versione=\"FPA12\"\n SistemaEmittente=\"{L}LapLI{s\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <FatturaElettronicaHeader xmlns=\"\">\n <DatiTrasmissione>\n <IdTrasmittente>\n <IdPaese>KO</IdPaese>\n <IdCodice>string</IdCodice>\n </IdTrasmittente>\n <ProgressivoInvio>IIs{{s</ProgressivoInvio>\n <FormatoTrasmissione>FPA12</FormatoTrasmissione>\n <CodiceDestinatario>EM1A07</CodiceDestinatario>\n <ContattiTrasmittente />\n <PECDestinatario>%+R--}--.#V!=@+?=?yUK?*3A?yj++?+--.Z.*!-=fmuh</PECDestinatario>\n </DatiTrasmissione>\n <CedentePrestatore>\n <DatiAnagrafici>\n <IdFiscaleIVA>\n <IdPaese>WX</IdPaese>\n <IdCodice>string</IdCodice>\n </IdFiscaleIVA>\n <Anagrafica>\n <Nome>BBpuIutaaIScBBII</Nome>\n <Cognome>a</Cognome>\n </Anagrafica>\n <RegimeFiscale>RF01</RegimeFiscale>\n </DatiAnagrafici>\n <Sede>\n <Indirizzo>ea</Indirizzo>\n <CAP>37675</CAP>\n <Comune>Lue</Comune>\n <Nazione>IT</Nazione>\n </Sede>\n <StabileOrganizzazione>\n <Indirizzo>aiu</Indirizzo>\n <CAP>66435</CAP>\n <Comune>{ceSaBpiBmep</Comune>\n <Nazione>IT</Nazione>\n </StabileOrganizzazione>\n <IscrizioneREA>\n <Ufficio>FT</Ufficio>\n <NumeroREA>tLIa}pp{}apsan]c{]a]</NumeroREA>\n <StatoLiquidazione>LN</StatoLiquidazione>\n </IscrizioneREA>\n <Contatti />\n <RiferimentoAmministrazione>ns{IiicpaaIip}IiaLa{</RiferimentoAmministrazione>\n </CedentePrestatore>\n <RappresentanteFiscale>\n <DatiAnagrafici>\n <IdFiscaleIVA>\n <IdPaese>MK</IdPaese>\n <IdCodice>string</IdCodice>\n </IdFiscaleIVA>\n <Anagrafica>\n <Denominazione>I{BipIs{a}ap{LucBiu</Denominazione>\n </Anagrafica>\n </DatiAnagrafici>\n </RappresentanteFiscale>\n <CessionarioCommittente>\n <DatiAnagrafici>\n <Anagrafica>\n <Denominazione>em</Denominazione>\n </Anagrafica>\n </DatiAnagrafici>\n <Sede>\n <Indirizzo>BmeiSp{eu}eLSL</Indirizzo>\n <CAP>65255</CAP>\n <Comune>ippea}ntBSLIu{IBplSce}{SmB}{{{LL</Comune>\n <Nazione>IT</Nazione>\n </Sede>\n <StabileOrganizzazione>\n <Indirizzo>{B{}eaeniLp{aBlpaa{p{LBLincpLI}{SBc{SeS}}}ae{e</Indirizzo>\n <CAP>48679</CAP>\n <Comune>lLtBpa</Comune>\n <Nazione>IT</Nazione>\n </StabileOrganizzazione>\n <RappresentanteFiscale>\n <IdFiscaleIVA>\n <IdPaese>ZO</IdPaese>\n <IdCodice>string</IdCodice>\n </IdFiscaleIVA>\n <Denominazione>LBcc}e}aLBcsSLS{BI}aeapcce}n</Denominazione>\n </RappresentanteFiscale>\n </CessionarioCommittente>\n <TerzoIntermediarioOSoggettoEmittente>\n <DatiAnagrafici>\n <Anagrafica>\n <Nome>t}iaScccpa{ieLnSLp}BncieSci{uI{i{pce}cScSSaLBBcpIlSa}Bnpcac</Nome>\n <Cognome>aaSm}{LI{BBc}i}a{nncms}eelSeBpuiBapi}ciLpLeaci{n}</Cognome>\n </Anagrafica>\n </DatiAnagrafici>\n </TerzoIntermediarioOSoggettoEmittente>\n <SoggettoEmittente>CC</SoggettoEmittente>\n </FatturaElettronicaHeader>\n <FatturaElettronicaBody xmlns=\"\">\n <DatiGenerali>\n <DatiGeneraliDocumento>\n <TipoDocumento>TD16</TipoDocumento>\n <Divisa>TUL</Divisa>\n <Data>2017-10-03</Data>\n <Numero>iniaaB</Numero>\n </DatiGeneraliDocumento>\n <DatiOrdineAcquisto>\n <IdDocumento>Li]ci{pc}iII]</IdDocumento>\n </DatiOrdineAcquisto>\n <DatiContratto>\n <IdDocumento>tp{t}IBippn{}B]</IdDocumento>\n </DatiContratto>\n <DatiConvenzione>\n <IdDocumento>ap]L}BniaLa{pcn</IdDocumento>\n </DatiConvenzione>\n <DatiRicezione>\n <IdDocumento>ccILstLB</IdDocumento>\n </DatiRicezione>\n <DatiFattureCollegate>\n <IdDocumento>I}Ip{tpa]]ac]IL}pBsn</IdDocumento>\n </DatiFattureCollegate>\n <DatiSAL>\n <RiferimentoFase>361</RiferimentoFase>\n </DatiSAL>\n <DatiDDT>\n <NumeroDDT>sBi}nat</NumeroDDT>\n <DataDDT>1972-12-17</DataDDT>\n </DatiDDT>\n <DatiTrasporto />\n <FatturaPrincipale>\n <NumeroFatturaPrincipale>{]nppLpiB</NumeroFatturaPrincipale>\n <DataFatturaPrincipale>1970-08-14</DataFatturaPrincipale>\n </FatturaPrincipale>\n </DatiGenerali>\n <DatiBeniServizi>\n <DettaglioLinee>\n <NumeroLinea>8284</NumeroLinea>\n <Descrizione>n</Descrizione>\n <PrezzoUnitario>1369450.2349058</PrezzoUnitario>\n <PrezzoTotale>-805869.765094196</PrezzoTotale>\n <AliquotaIVA>4402260</AliquotaIVA>\n </DettaglioLinee>\n <DatiRiepilogo>\n <AliquotaIVA>3148340</AliquotaIVA>\n <ImponibileImporto>4413100.2349058</ImponibileImporto>\n <Imposta>3371250.2349058</Imposta>\n </DatiRiepilogo>\n </DatiBeniServizi>\n <DatiVeicoli>\n <Data>2012-11-25</Data>\n <TotalePercorso>}BtL{L</TotalePercorso>\n </DatiVeicoli>\n <DatiPagamento>\n <CondizioniPagamento>TP01</CondizioniPagamento>\n <DettaglioPagamento>\n <ModalitaPagamento>MP17</ModalitaPagamento>\n <ImportoPagamento>-3583049.7650942</ImportoPagamento>\n </DettaglioPagamento>\n </DatiPagamento>\n <Allegati>\n <NomeAttachment>pel</NomeAttachment>\n <AlgoritmoCompressione>pctaaL}LIa</AlgoritmoCompressione>\n <FormatoAttachment>{cIsIpaIIi</FormatoAttachment>\n <DescrizioneAttachment>SsLcp</DescrizioneAttachment>\n <Attachment>YTM0NZomIzI2OTsmIzM0NTueYQ==</Attachment>\n </Allegati>\n </FatturaElettronicaBody>\n <FatturaElettronicaBody xmlns=\"\">\n <DatiGenerali>\n <DatiGeneraliDocumento>\n <TipoDocumento>TD05</TipoDocumento>\n <Divisa>MWH</Divisa>\n <Data>1996-10-28</Data>\n <Numero>aBt{i}{tiIptpnac]</Numero>\n </DatiGeneraliDocumento>\n <DatiOrdineAcquisto>\n <IdDocumento>{cnIpc}i]Is]c</IdDocumento>\n </DatiOrdineAcquisto>\n <DatiContratto>\n <IdDocumento>n]i}</IdDocumento>\n </DatiContratto>\n <DatiConvenzione>\n <IdDocumento>]a}I}}c}aa</IdDocumento>\n </DatiConvenzione>\n <DatiRicezione>\n <IdDocumento>a{}s}</IdDocumento>\n </DatiRicezione>\n <DatiFattureCollegate>\n <IdDocumento>ct}LI</IdDocumento>\n </DatiFattureCollegate>\n <DatiSAL>\n <RiferimentoFase>369</RiferimentoFase>\n </DatiSAL>\n <DatiDDT>\n <NumeroDDT>Ban</NumeroDDT>\n <DataDDT>1972-11-14</DataDDT>\n </DatiDDT>\n <DatiTrasporto />\n <FatturaPrincipale>\n <NumeroFatturaPrincipale>t}{i}napBic</NumeroFatturaPrincipale>\n <DataFatturaPrincipale>2016-12-16</DataFatturaPrincipale>\n </FatturaPrincipale>\n </DatiGenerali>\n <DatiBeniServizi>\n <DettaglioLinee>\n <NumeroLinea>2867</NumeroLinea>\n <Descrizione>pL</Descrizione>\n <PrezzoUnitario>-2058329.7650942</PrezzoUnitario>\n <PrezzoTotale>3961400.2349058</PrezzoTotale>\n <AliquotaIVA>-1219789.7650942</AliquotaIVA>\n </DettaglioLinee>\n <DatiRiepilogo>\n <AliquotaIVA>2690430</AliquotaIVA>\n <ImponibileImporto>-4257529.7650942</ImponibileImporto>\n <Imposta>2794280.2349058</Imposta>\n </DatiRiepilogo>\n </DatiBeniServizi>\n <DatiVeicoli>\n <Data>1996-12-06</Data>\n <TotalePercorso>aBcpcBLtc{tBi}s</TotalePercorso>\n </DatiVeicoli>\n <DatiPagamento>\n <CondizioniPagamento>TP03</CondizioniPagamento>\n <DettaglioPagamento>\n <ModalitaPagamento>MP18</ModalitaPagamento>\n <ImportoPagamento>-4401059.7650942</ImportoPagamento>\n </DettaglioPagamento>\n </DatiPagamento>\n <Allegati>\n <NomeAttachment>t}ae</NomeAttachment>\n <AlgoritmoCompressione>snn}Bt}n{</AlgoritmoCompressione>\n <FormatoAttachment>iLBnsnLanc</FormatoAttachment>\n <DescrizioneAttachment>}spLLILSeSaBlSLiiiinSIc}ptBI{SccasstI</DescrizioneAttachment>\n <Attachment>YTM0NZomIzI2OTsmIzM0NTueYQ==</Attachment>\n </Allegati>\n </FatturaElettronicaBody>\n <FatturaElettronicaBody xmlns=\"\">\n <DatiGenerali>\n <DatiGeneraliDocumento>\n <TipoDocumento>TD18</TipoDocumento>\n <Divisa>FAB</Divisa>\n <Data>1970-08-27</Data>\n <Numero>snpan{acB]aantB</Numero>\n </DatiGeneraliDocumento>\n <DatiOrdineAcquisto>\n <IdDocumento>s</IdDocumento>\n </DatiOrdineAcquisto>\n <DatiContratto>\n <IdDocumento>B</IdDocumento>\n </DatiContratto>\n <DatiConvenzione>\n <IdDocumento>InIasi]p]a</IdDocumento>\n </DatiConvenzione>\n <DatiRicezione>\n <IdDocumento>{capBc</IdDocumento>\n </DatiRicezione>\n <DatiFattureCollegate>\n <IdDocumento>pIL]}tLL}n]B}n]iBtLc</IdDocumento>\n </DatiFattureCollegate>\n <DatiSAL>\n <RiferimentoFase>519</RiferimentoFase>\n </DatiSAL>\n <DatiDDT>\n <NumeroDDT>BnLc{ni</NumeroDDT>\n <DataDDT>1973-11-05</DataDDT>\n </DatiDDT>\n <DatiTrasporto />\n <FatturaPrincipale>\n <NumeroFatturaPrincipale>L</NumeroFatturaPrincipale>\n <DataFatturaPrincipale>1991-11-06</DataFatturaPrincipale>\n </FatturaPrincipale>\n </DatiGenerali>\n <DatiBeniServizi>\n <DettaglioLinee>\n <NumeroLinea>8217</NumeroLinea>\n <Descrizione>I{SlLceItci</Descrizione>\n <PrezzoUnitario>-3196579.7650942</PrezzoUnitario>\n <PrezzoTotale>-2138439.7650942</PrezzoTotale>\n <AliquotaIVA>-869189.765094196</AliquotaIVA>\n </DettaglioLinee>\n <DatiRiepilogo>\n <AliquotaIVA>1031150</AliquotaIVA>\n <ImponibileImporto>-3900039.7650942</ImponibileImporto>\n <Imposta>1213930.2349058</Imposta>\n </DatiRiepilogo>\n </DatiBeniServizi>\n <DatiVeicoli>\n <Data>1981-10-23</Data>\n <TotalePercorso>I}pptsL}{I</TotalePercorso>\n </DatiVeicoli>\n <DatiPagamento>\n <CondizioniPagamento>TP02</CondizioniPagamento>\n <DettaglioPagamento>\n <ModalitaPagamento>MP08</ModalitaPagamento>\n <ImportoPagamento>1109440.2349058</ImportoPagamento>\n </DettaglioPagamento>\n </DatiPagamento>\n <Allegati>\n <NomeAttachment>Bpl{BeL{tmIaeIStaic{pe}Bec{Ic}</NomeAttachment>\n <AlgoritmoCompressione>IB</AlgoritmoCompressione>\n <FormatoAttachment>nnn}}IBic}</FormatoAttachment>\n <DescrizioneAttachment>}e</DescrizioneAttachment>\n <Attachment>YTM0NZomIzI2OTsmIzM0NTueYQ==</Attachment>\n </Allegati>\n </FatturaElettronicaBody>\n</FatturaElettronica>"
schema:
$ref: '#/components/schemas/Invoice'
description: The user attributes
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DocumentIssuedList'
description: Ok
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Bad request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Not found
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Unprocessable Entity
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Too Many Requests
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Internal Server Error
security:
- authorization: []
summary: Create an invoice and issue it
tags:
- Document
x-codeSamples:
- label: ⚡ cURL
lang: Shell
source: "base_url=\"http://example.com\" # Replace with the correct Sibill integration API host\n\ncurl --request POST \\\n --url ${base_url}/api/v1/companies/:company_id/documents/invoice?issue=:issue \\\n --header \"Authorization: Bearer ${authorization_token}\" \\\n --header \"Content-Type: application/xml\" \\\n --data '${your payload here}'\n"
- label: 🌐 HTTP
lang: HTTP
source: 'POST /api/v1/companies/:company_id/documents/invoice?issue=:issue HTTP/1.1
Host: example.com # Replace with the correct Sibill integration API host
Authorization: Bearer ${authorization_token}
Content-Type: application/xml
${your payload here}
'
- label: 💜 Elixir
lang: Elixir
source: 'Mix.install([:req])
base_url = "http://example.com" # Replace with the correct Sibill integration API host
url = base_url <> "/api/v1/companies/:company_id/documents/invoice?issue=:issue"
headers = [{"Authorization", "Bearer ${authorization_token}"}, {"Content-Type", "application/xml"}]
payload = ${your payload here}
Req.post(url, headers: headers, body: payload)
'
- label: 🐍 Python
lang: Python
source: 'import requests
base_url = "http://example.com" # Replace with the correct Sibill integration API host
url = base_url + "/api/v1/companies/:company_id/documents/invoice?issue=:issue"
headers = {"Authorization": "Bearer ${authorization_token}", "Content-Type": "application/xml"}
payload = ${your payload here}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
'
- label: ☕ Java
lang: Java
source: "import java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.URI;\n\nString base_url = \"http://example.com\"; // Replace with the correct Sibill integration API host\nString url = base_url + \"/api/v1/companies/:company_id/documents/invoice?issue=:issue\";\n\nHttpClient client = HttpClient.newHttpClient();\nHttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(url))\n .header(\"Authorization\", \"Bearer ${authorization_token}\")\n .header(\"Content-Type\", \"application/xml\")\n .POST(HttpRequest.BodyPublishers.ofString(${your payload here}))\n .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n"
- label: 🐘 PHP
lang: PHP
source: "<?php\n\n$url = \"http://example.com/api/v1/companies/:company_id/documents/invoice?issue=:issue\"; // Replace with the correct Sibill integration API host\n\n$ch = curl_init($url);\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n \"Authorization: Bearer ${authorization_token}\",\n \"Content-Type: application/xml\"\n]);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, <<<BODY\n${your payload here}\nBODY\n);\n\n$response = curl_exec($ch);\n\nif (curl_errno($ch)) {\n echo 'Curl error: ' . curl_error($ch);\n} else {\n echo 'Response:' . PHP_EOL;\n echo $response;\n}\n\ncurl_close($ch);\n"
/api/v1/companies/{company_id}/documents/{document_id}/invoice:
get:
callbacks: {}
description: 'Retrieve a specific document invoice along with a signed url to the xml representation of the invoice.
The signed url provides a secure and temporary access to the xml data.
'
operationId: SibillWeb.Integration.V1.DocumentsActionsController.get_invoice
parameters:
- description: The company the document invoice belongs to
in: path
name: company_id
required: true
schema:
type: string
- description: The document identifier
in: path
name: document_id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/InvoiceData'
description: Document invoice response
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Bad request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Not found
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Too Many Requests
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Internal Server Error
security:
- authorization: []
summary: Get a document invoice by its identifier
tags:
- Document
x-codeSamples:
- label: ⚡ cURL
lang: Shell
source: "base_url=\"http://example.com\" # Replace with the correct Sibill integration API host\n\ncurl --request GET \\\n --url ${base_url}/api/v1/companies/:company_id/documents/:document_id/invoice \\\n --header \"Authorization: Bearer ${authorization_token}\" \\\n --header \"Content-Type: application/json\"\n"
- label: 🌐 HTTP
lang: HTTP
source: 'GET /api/v1/companies/:company_id/documents/:document_id/invoice HTTP/1.1
Host: example.com # Replace with the correct Sibill integration API host
Authorization: Bearer ${authorization_token}
Content-Type: application/json
'
- label: 💜 Elixir
lang: Elixir
source: 'Mix.install([:req])
base_url = "http://example.com" # Replace with the correct Sibill integration API host
url = base_url <> "/api/v1/companies/:company_id/documents/:document_id/invoice"
headers = [{"Authorization", "Bearer ${authorization_token}"}, {"Content-Type", "application/json"}]
Req.get(url, headers: headers)
'
- label: 🐍 Python
lang: Python
source: 'import requests
base_url = "http://example.com" # Replace with the correct Sibill integration API host
url = base_url + "/api/v1/companies/:company_id/documents/:document_id/invoice"
headers = {"Authorization": "Bearer ${authorization_token}", "Content-Type": "application/json"}
response = requests.get(url, headers=headers)
print(response.text)
'
- label: ☕ Java
lang: Java
source: "import java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.URI;\n\nString base_url = \"http://example.com\"; // Replace with the correct Sibill integration API host\nString url = base_url + \"/api/v1/companies/:company_id/documents/:document_id/invoice\";\n\nHttpClient client = HttpClient.newHttpClient();\nHttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(url))\n .header(\"Authorization\", \"Bearer ${authorization_token}\")\n .header(\"Content-Type\", \"application/json\")\n .GET()\n .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n"
- label: 🐘 PHP
lang: PHP
source: "<?php\n\n$url = \"http://example.com/api/v1/companies/:company_id/documents/:document_id/invoice\"; // Replace with the correct Sibill integration API host\n\n$ch = curl_init($url);\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n \"Authorization: Bearer ${authorization_token}\",\n \"Content-Type: application/json\"\n]);\n\n$response = curl_exec($ch);\n\nif (curl_errno($ch)) {\n echo 'Curl error: ' . curl_error($ch);\n} else {\n echo 'Response:' . PHP_EOL;\n echo $response;\n}\n\ncurl_close($ch);\n"
/api/v1/companies/{company_id}/documents/{document_id}/share-invoice:
post:
callbacks: {}
description: 'Send an invoice courtesy copy through email to some recipient provided in the request body.
The email will contain a link to the actual invoice and maybe contain a personalized body and subject.
If these are not provided, the email will contain a default body and subject.
If the response is successful, the email will be sent to the recipient but we do not guarantee that the email will be delivered successfully.
The success of the response means that the system has accepted the request and will attempt to send the email.
'
operationId: SibillWeb.Integration.V1.DocumentsActionsController.share_invoice
parameters:
- description: The company where to execute the operation
in: path
name: company_id
required: true
schema:
type: string
- description: The document identifier
in: path
name: document_id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SendInvoiceData'
description: Request
required: false
responses:
'200':
content:
application/json: {}
description: Ok
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Bad request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Not found
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/IntegrationError'
description: Unprocessable entity
'429':
# --- truncated at 32 KB (118 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/sibill/refs/heads/main/openapi/sibill-document-api-openapi.yml