openapi: 3.1.0
info:
  title: InvoiceXpress API
  description: >+
    Endpoints for managing Accounts, Invoices, Estimates, and organization data
    in InvoiceXpress. <br><h2>Welcome to our API in JSON</h2> Hello there!
    Welcome to the world of InvoiceXpress API! This world is inhabitated by
    creatures we call Endpoints.<p><p> People and Endpoints live together by
    supporting each other. Some people play with Endpoints, some work with
    them.<p> If you’re reading this, let me guess, you need to issue invoices
    but don’t want to lose focus from building a great solution and writing
    amazing code.<p> Did we cover your scenario? Ok, great. Let’s do this.<p>
    <h3>Quick Start</h3> <ol><li>[Sign up FREE for 30
    days](https://web.invoicexpress.com/signup)</li><li>[Get your API
    key](https://web.invoicexpress.com/users/api_key)</li><li>[Create an
    Invoice](#tag/Invoices)</li></ol>

    ## Documentation


    Reference tables for Portuguese VAT (IVA) exemptions, payment mechanism
    codes used for partial payments, and accepted countries when creating a
    client or an account.


    <details>

    <summary>Authentication</summary>



    In order to authenticate a user through our API, an API key must be used.
    All API endpoints are available via HTTPS. HTTP access is denied. Each API
    key authenticates a user inside an account, and it's composed by arbitrary
    characters.


    This key must be passed on the query string in each HTTPS request to
    authenticate the user. Although all endpoints are accessed through HTTPS,
    please keep this token as secure as possible in order to avoid third party's
    to access your InvoiceXpress data.


    We strongly recommend you re-generate your API Key from time to time.


    **Example:**


    `https://ACCOUNT_NAME.app.invoicexpress.com/invoices.json?api_key=API_KEY`


    You can find your ACCOUNT_NAME and API_KEY here:
    [https://www.app.invoicexpress.com/users/api](https://www.app.invoicexpress.com/users/api)


    On POST and PUT requests do not forget to specify on the Header:


    `Content-Type: application/json`



    </details>


    <details>

    <summary>IVA exemption codes</summary>



    | Code | Description on the Invoice | Where does it apply? |

    | --- | --- | --- |

    | M01 | Artigo 16.°, n.° 6 do CIVA | Artigo 16.°, n.° 6, alíneas a) a d) do
    CIVA |

    | M02 | Artigo 6.° do Decreto-Lei n.° 198/90, de 19 de junho | Artigo 6.° do
    Decreto-Lei n.° 198/90, de 19 de junho |

    | M04 | Isento artigo 13.° do CIVA | Artigo 13.° do CIVA |

    | M05 | Isento artigo 14.° do CIVA | Artigo 14.° do CIVA |

    | M06 | Isento artigo 15.° do CIVA | Artigo 15.° do CIVA |

    | M07 | Isento artigo 9.° do CIVA | Artigo 9.° do CIVA |

    | M09 | IVA – não confere direito a dedução | Artigo 62.° alínea b) do CIVA
    |

    | M10 | IVA – regime de isenção | Artigo 57.° do CIVA |

    | M11 | Regime particular do tabaco | Decreto-Lei n.° 346/85, de 23 de
    agosto |

    | M12 | Regime da margem de lucro – Agências de viagens | Decreto-Lei n.°
    221/85, de 3 de julho |

    | M13 | Regime da margem de lucro – Bens em segunda mão | Decreto-Lei n.°
    199/96, de 18 de outubro |

    | M14 | Regime da margem de lucro – Objetos de arte | Decreto-Lei n.°
    199/96, de 18 de outubro |

    | M15 | Regime da margem de lucro – Objetos de coleção e antiguidades |
    Decreto-Lei n.° 199/96, de 18 de outubro |

    | M16 | Isento artigo 14.° do RITI | Artigo 14.° do RITI |

    | M19 | Outras isenções | Isenções temporárias determinadas em diploma
    próprio |

    | M20 | IVA – regime forfetário | Artigo 59.°-D n.°2 do CIVA |

    | M21 | IVA – não confere direito à dedução (ou expressão similar) | Artigo
    72.° n.° 4 do CIVA |

    | M25 | Mercadorias à consignação | Artigo 38.° n.° 1 alínea a) |

    | M30 | IVA – autoliquidação | Artigo 2.° n.° 1 alínea i) do CIVA |

    | M31 | IVA – autoliquidação | Artigo 2.° n.° 1 alínea j) do CIVA |

    | M32 | IVA – autoliquidação | Artigo 2.° n.° 1 alínea I) do CIVA |

    | M33 | IVA – autoliquidação | Artigo 2.° n.° 1 alínea m) do CIVA |

    | M40 | IVA – autoliquidação | Artigo 6.° n.° 6 alínea a) do CIVA, a
    contrário |

    | M41 | IVA – autoliquidação | Artigo 8.° n.° 3 do RITI |

    | M42 | IVA – autoliquidação | Decreto-Lei n.° 21/2007, de 29 de janeiro |

    | M43 | IVA – autoliquidação | Decreto-Lei n.° 362/99, de 16 de setembro |

    | M44 | IVA - Regras específicas - artigo 6.º | Artigo 6.º do CIVA – Regras
    específicas. A utilizar nas operações que não sejam localizadas em Portugal
    por força das regras de exceção constantes dos números 7 e seguintes do
    artigo 6.º do Código do IVA |

    | M45 | IVA - Regime transfronteiriço de isenção | Artigo 58.º-A do CIVA. A
    utilizar nas operações localizadas noutro Estado Membro da União Europeia e
    que ali fiquem isentas de IVA, em virtude de o transmitente dos bens ou
    prestador dos serviços ter aderido ao Regime Transfronteiriço de isenção
    relativamente às operações que realize nesse Estado Membro. Sem prejuízo do
    disposto no Ofício-Circulado n.º 25 065, de 08/04/2025, por uma questão de
    melhor identificação e separação destas operações, deve ser utilizada a
    menção "IVA – regime transfronteiriço de isenção". |

    | M46 | IVA - e-TaxFree | Decreto-lei n.º 19/2017, de 14 de fevereiro. A
    utilizar pelo vendedor na emissão de faturas relativas a operações em que
    tenha aplicado a isenção na transmissão de bens a serem transportados na
    bagagem pessoal de viajantes sem domicílio ou estabelecimento na União
    Europeia, nos termos do referido decreto-lei. |

    | M99 | Não sujeito ou não tributado | Outras situações de não liquidação do
    imposto (Exemplos: artigo 2.°, n.° 2 ; artigo 3.°, n.°s 4, 6 e 7; artigo
    4.°, n.° 5, todos do CIVA) |



    </details>


    <details>

    <summary>Payment mechanisms</summary>



    This list shows the possible values for the payment mechanism when doing a
    partial payment:


    - **CC**: Credit card

    - **CD**: Debit card

    - **CH**: Bank check

    - **CO**: Check or voucher

    - **CS**: Current account balance compensation

    - **DE**: e-Cash

    - **LC**: Commercial paper

    - **MB**: Multibanco payment references

    - **NU**: Cash

    - **OU**: Other methods not mentioned here

    - **PR**: Exchange of properties

    - **TB**: Bank transfer or authorized direct debit

    - **TR**: Restaurant ticket



    </details>


    <details>

    <summary>Country list</summary>



    This list shows the countries accepted when creating a client or an account:

    - Portugal

    - Ireland

    - UK

    - Canada

    - United States

    - Afghanistan

    - Albania

    - Algeria

    - American Samoa

    - Andorra

    - Angola

    - Anguilla

    - Antigua and Barbuda

    - Argentina

    - Armenia

    - Aruba

    - Australia

    - Austria

    - Azerbaijan

    - Bahamas

    - Bahrain

    - Bangladesh

    - Barbados

    - Belarus

    - Belgium

    - Belize

    - Benin

    - Bermuda

    - Bhutan

    - Bolivia

    - Bosnia-Herzegovina

    - Botswana

    - Brazil

    - British Indian Ocean Territory

    - Brunei

    - Bulgaria

    - Burkina Faso

    - Burma

    - Burundi

    - Cambodia

    - Cameroon

    - Canton and Enderbury Islands

    - Cape Verde

    - Cayman Islands

    - Central African Republic

    - Chad

    - Chile

    - China

    - Christmas Island

    - Cocos (Keeling) Islands

    - Colombia

    - Comoros

    - Congo

    - Congo, Democratic Republic

    - Cook Islands

    - Costa Rica

    - Côte d’Ivoire

    - Croatia

    - Cuba

    - Curaçao

    - Cyprus

    - Czech Republic

    - Denmark

    - Djibouti

    - Dominica

    - Dominican Republic

    - Dronning Maud Land

    - East Timor

    - Ecuador

    - Egypt

    - El Salvador

    - Equatorial Guinea

    - Eritrea

    - Estonia

    - Ethiopia

    - Faeroe Islands (Føroyar)

    - Falkland Islands

    - Fiji

    - Finland

    - France

    - French Guiana

    - French Polynesia

    - Gabon

    - Gambia

    - Georgia

    - Germany

    - Ghana

    - Gibraltar

    - Great Britain

    - Greece

    - Greenland

    - Grenada

    - Guadeloupe

    - Guam

    - Guatemala

    - Guernsey

    - Guinea-Bissau

    - Guinea

    - Guyana

    - Haiti

    - Heard and McDonald Islands

    - Honduras

    - Hong Kong

    - Hungary

    - Iceland

    - India

    - Indonesia

    - International Monetary Fund

    - Iran

    - Iraq

    - Isle of Man

    - Israel

    - Italy

    - Ivory Coast

    - Jamaica

    - Japan

    - Jersey

    - Johnston Island

    - Jordan

    - Kampuchea

    - Kazakhstan

    - Kenya

    - Kiribati

    - Korea, North

    - Korea, South

    - Kuwait

    - Kyrgyzstan

    - Laos

    - Latvia

    - Lebanon

    - Lesotho

    - Liberia

    - Libya

    - Liechtenstein

    - Lithuania

    - Luxembourg

    - Macau

    - Macedonia (Former Yug. Rep.)

    - Madagascar

    - Malawi

    - Malaysia

    - Maldives

    - Mali

    - Malta

    - Marshall Islands

    - Martinique

    - Mauritania

    - Mauritius

    - Mayotte

    - Micronesia

    - Midway Islands

    - Mexico

    - Moldova

    - Monaco

    - Mongolia

    - Montenegro

    - Montserrat

    - Morocco

    - Mozambique

    - Myanmar

    - Nauru

    - Namibia

    - Nepal

    - Netherlands Antilles

    - Netherlands

    - New Caledonia

    - New Zealand

    - Nicaragua

    - Niger

    - Nigeria

    - Niue

    - Norfolk Island

    - Northern Mariana Islands

    - Norway

    - Oman

    - Pakistan

    - Palau

    - Palestine

    - Panama

    - Papua New Guinea

    - Paraguay

    - Peru

    - Philippines

    - Pitcairn Island

    - Poland

    - Puerto Rico

    - Qatar

    - Reunion

    - Romania

    - Russia

    - Rwanda

    - Samoa (Western)

    - Samoa (America)

    - San Marino

    - São Tomé and Príncipe

    - Saudi Arabia

    - Sénégal

    - Serbia

    - Seychelles

    - Sierra Leone

    - Singapore

    - Slovakia

    - Slovenia

    - Solomon Islands

    - Somalia

    - South Africa

    - Spain

    - Sri Lanka

    - St. Helena

    - St. Kitts and Nevis

    - St. Lucia

    - St. Vincent and the Grenadines

    - Sudan

    - Suriname

    - Svalbard and Jan Mayen Islands

    - Swaziland

    - Sweden

    - Switzerland

    - Syria

    - Tahiti

    - Taiwan

    - Tajikistan

    - Tanzania

    - Thailand

    - Timor-Leste

    - Togo

    - Trinidad and Tobago

    - Tunisia

    - Turkey

    - Turkmenistan

    - Turks and Caicos Islands

    - Tuvalu

    - Uganda

    - Ukraine

    - United Arab Emirates

    - Upper Volta

    - Uruguay

    - Uzbekistan

    - Vanuatu

    - Vatican

    - Venezuela

    - Vietnam

    - Virgin Islands

    - Wake Island

    - Wallis and Futuna Islands

    - Western Sahara

    - Western Samoa

    - Yemen

    - Zaïre

    - Zambia

    - Zimbabwe



    </details>


    <details>

    <summary>Taxes country codes</summary>



    | Country | Code |

    | --- | --- |

    | Portugal – Continental | PT |

    | Portugal – Açores | PT-AC |

    | Portugal – Madeira | PT-MA |

    | Afghanistan | AF |

    | Åland Islands | AX |

    | Albania | AL |

    | Algeria | DZ |

    | American Samoa | AS |

    | Andorra | AD |

    | Angola | AO |

    | Anguilla | AI |

    | Antarctica | AQ |

    | Antigua and Barbuda | AG |

    | Argentina | AR |

    | Armenia | AM |

    | Aruba | AW |

    | Australia | AU |

    | Austria | AT |

    | Azerbaijan | AZ |

    | Bahamas | BS |

    | Bahrain | BH |

    | Bangladesh | BD |

    | Barbados | BB |

    | Belarus | BY |

    | Belgium | BE |

    | Belize | BZ |

    | Benin | BJ |

    | Bermuda | BM |

    | Bhutan | BT |

    | Bolivia | BO |

    | Bosnia-Herzegovina | BA |

    | Botswana | BW |

    | Bouvet Island | BV |

    | Brazil | BR |

    | British Indian Ocean Territory | IO |

    | Brunei | BN |

    | Bulgaria | BG |

    | Burkina Faso | BF |

    | Burma | MM |

    | Burundi | BI |

    | Cambodia | KH |

    | Cameroon | CM |

    | Canada | CA |

    | Canton and Enderbury Islands | KI |

    | Cape Verde | CV |

    | Cayman Islands | KY |

    | Central African Republic | CF |

    | Chad | TD |

    | Chile | CL |

    | China | CN |

    | Christmas Island | CX |

    | Cocos (Keeling) Islands | CC |

    | Colombia | CO |

    | Comoros | KM |

    | Congo | CG |

    | Congo, Democratic Republic | CD |

    | Cook Islands | CK |

    | Costa Rica | CR |

    | Côte d’Ivoire | CI |

    | Croatia | HR |

    | Cuba | CU |

    | Cyprus | CY |

    | Czech Republic | CZ |

    | Denmark | DK |

    | Djibouti | DJ |

    | Dominica | DM |

    | Dominican Republic | DO |

    | Dronning Maud Land | AQ |

    | East Timor | TL |

    | Ecuador | EC |

    | Egypt | EG |

    | El Salvador | SV |

    | Equatorial Guinea | GQ |

    | Eritrea | ER |

    | Estonia | EE |

    | Ethiopia | ET |

    | Falkland Islands | FK |

    | Faroe Islands | FO |

    | Fiji | FJ |

    | Finland | FI |

    | France | FR |

    | French Guiana | GF |

    | French Polynesia | PF |

    | French Southern Territories | TF |

    | Gabon | GA |

    | Gambia | GM |

    | Georgia | GE |

    | Germany | DE |

    | Ghana | GH |

    | Gibraltar | GI |

    | Greece | GR |

    | Greenland | GL |

    | Grenada | GD |

    | Guadeloupe | GP |

    | Guam | GU |

    | Guatemala | GT |

    | Guernsey | GG |

    | Guinea | GN |

    | Guinea-Bissau | GW |

    | Guyana | GY |

    | Haiti | HT |

    | Heard and McDonald Islands | HM |

    | Holy See (Vatican City State) | VA |

    | Honduras | HN |

    | Hong Kong | HK |

    | Hungary | HU |

    | Iceland | IS |

    | India | IN |

    | Indonesia | ID |

    | Iran | IR |

    | Iraq | IQ |

    | Ireland | IE |

    | Isle of Man | IM |

    | Israel | IL |

    | Italy | IT |

    | Ivory Coast | CI |

    | Jamaica | JM |

    | Japan | JP |

    | Jersey | JE |

    | Johnston Island | UM |

    | Jordan | JO |

    | Kampuchea | KH |

    | Kazakhstan | KZ |

    | Kenya | KE |

    | Kiribati | KI |

    | Korea, North | KP |

    | Korea, South | KR |

    | Kuwait | KW |

    | Kyrgyzstan | KG |

    | Laos | LA |

    | Latvia | LV |

    | Lebanon | LB |

    | Lesotho | LS |

    | Liberia | LR |

    | Libya | LY |

    | Liechtenstein | LI |

    | Lithuania | LT |

    | Luxembourg | LU |

    | Macau | MO |

    | Macedonia | MK |

    | Madagascar | MG |

    | Malawi | MW |

    | Malaysia | MY |

    | Maldives | MV |

    | Mali | ML |

    | Malta | MT |

    | Marshall Islands | MH |

    | Martinique | MQ |

    | Mauritania | MR |

    | Mauritius | MU |

    | Mayotte | YT |

    | Mexico | MX |

    | Micronesia | FM |

    | Midway Islands | UM |

    | Moldova | MD |

    | Monaco | MC |

    | Mongolia | MN |

    | Montenegro | ME |

    | Montserrat | MS |

    | Morocco | MA |

    | Mozambique | MZ |

    | Myanmar | MM |

    | Namibia | NA |

    | Nauru | NR |

    | Nepal | NP |

    | Netherlands | NL |

    | Netherlands Antilles | AN |

    | New Caledonia | NC |

    | New Zealand | NZ |

    | Nicaragua | NI |

    | Niger | NE |

    | Nigeria | NG |

    | Niue | NU |

    | Norfolk Island | NF |

    | Northern Mariana Islands | MP |

    | Norway | NO |

    | Oman | OM |

    | Pakistan | PK |

    | Palau | PW |

    | Palestine | PS |

    | Panama | PA |

    | Papua New Guinea | PG |

    | Paraguay | PY |

    | Peru | PE |

    | Philippines | PH |

    | Pitcairn Island | PN |

    | Poland | PL |

    | Puerto Rico | PR |

    | Qatar | QA |

    | Reunion | RE |

    | Romania | RO |

    | Russia | RU |

    | Russian Federation | RU |

    | Rwanda | RW |

    | Saint Barthélemy | BL |

    | St. Helena | SH |

    | St. Kitts and Nevis | KN |

    | St. Lucia | LC |

    | Saint Martin | MF |

    | Saint Pierre And Miquelon | PM |

    | St. Vincent and the Grenadines | VC |

    | Samoa (America) | AS |

    | Samoa (Western) | WS |

    | San Marino | SM |

    | São Tomé and Príncipe | ST |

    | Saudi Arabia | SA |

    | Sénégal | SN |

    | Serbia | RS |

    | Seychelles | SC |

    | Sierra Leone | SL |

    | Singapore | SG |

    | Slovakia | SK |

    | Slovenia | SI |

    | Solomon Islands | SB |

    | Somalia | SO |

    | South Africa | ZA |

    | South Georgia And The South Sandwich Islands | GS |

    | Spain | ES |

    | Sri Lanka | LK |

    | Sudan | SD |

    | Suriname | SR |

    | Svalbard and Jan Mayen Islands | SJ |

    | Swaziland | SZ |

    | Sweden | SE |

    | Switzerland | CH |

    | Syria | SY |

    | Tahiti | PF |

    | Taiwan | TW |

    | Tajikistan | TJ |

    | Tanzania | TZ |

    | Thailand | TH |

    | Timor-Leste | TL |

    | Togo | TG |

    | Tokelau | TK |

    | Tonga | TO |

    | Trinidad and Tobago | TT |

    | Tunisia | TN |

    | Turkey | TR |

    | Turkmenistan | TM |

    | Turks and Caicos Islands | TC |

    | Tuvalu | TV |

    | Uganda | UG |

    | Ukraine | UA |

    | United Arab Emirates | AE |

    | United Kingdom | GB |

    | Upper Volta | BF |

    | United States | US |

    | United States Minor Outlying Islands | UM |

    | Uruguay | UY |

    | Uzbekistan | UZ |

    | Vanuatu | VU |

    | Vatican | VA |

    | Venezuela | VE |

    | Vietnam | VN |

    | Virgin Islands | VG |

    | Virgin Islands, U.S. | VI |

    | Wake Island | UM |

    | Wallis and Futuna Islands | WF |

    | Western Sahara | EH |

    | Western Samoa | WS |

    | Yemen | YE |

    | Zaïre | CD |

    | Zambia | ZM |

    | Zimbabwe | ZW |



    </details>


    <details>

    <summary>Currency codes</summary>



    | Name | Symbol | Code |

    | --- | --- | --- |

    | Euro | € | EUR |

    | Pound sterling | £ | GBP |

    | Canadian dollar | C$ | CAD |

    | U.S. dollar | $ | USD |

    | Afghan afghani | ؋ | AFN |

    | Albanian lek | L | ALL |

    | Algerian dinar | د.ج | DZD |

    | Angolan kwanza | Kz | AOA |

    | Argentine peso | $ | ARS |

    | Armenian dram | դր. | AMD |

    | Aruban florin | ƒ | AWG |

    | Australian dollar | A$ | AUD |

    | Azerbaijani manat | ¤ | AZN |

    | Bahamian dollar | $ | BSD |

    | Bahraini dinar | ب.د | BHD |

    | Bangladeshi taka | ¤ | BDT |

    | Barbadian dollar | $ | BBD |

    | Belarusian ruble | Br | BYR |

    | Belize dollar | $ | BZD |

    | Bermudian dollar | $ | BMD |

    | Bhutanese ngultrum | ¤ | BTN |

    | Bolivian boliviano | Bs. | BOB |

    | Bosnia & Herzegovina mark | KM | BAM |

    | Botswana pula | P | BWP |

    | Brazilian real | R$ | BRL |

    | Brunei dollar | $ | BND |

    | Bulgarian lev | лв | BGN |

    | Burundian franc | Fr | BIF |

    | Cambodian riel | ¤ | KHR |

    | Cape Verdean escudo | Esc | CVE |

    | Cayman Islands dollar | $ | KYD |

    | Central African CFA franc | Fr | XAF |

    | CFP franc | Fr | XPF |

    | Chilean peso | $ | CLP |

    | Chinese yuan | ¥ | CNY |

    | Colombian peso | $ | COP |

    | Comorian franc | Fr | KMF |

    | Congolese franc | Fr | CDF |

    | Costa Rican colón | ₡ | CRC |

    | Croatian kuna | kn | HRK |

    | Cuban convertible peso | $ | CUC |

    | Cuban peso | $ | CUP |

    | Czech koruna | Kč | CZK |

    | Danish krone | kr. | DKK |

    | Djiboutian franc | Fr | DJF |

    | Dominican peso | $ | DOP |

    | East Caribbean dollar | $ | XCD |

    | Egyptian pound | ج.م | EGP |

    | Eritrean nakfa | Nfk | ERN |

    | Estonian kroon | KR | EEK |

    | Ethiopian birr | ¤ | ETB |

    | Falkland Islands pound | £ | FKP |

    | Fijian dollar | $ | FJD |

    | Gambian dalasi | D | GMD |

    | Georgian lari | ლ | GEL |

    | Ghanaian cedi | ₵ | GHS |

    | Gibraltar pound | £ | GIP |

    | Guatemalan quetzal | Q | GTQ |

    | Guinean franc | Fr | GNF |

    | Guyanese dollar | $ | GYD |

    | Haitian gourde | G | HTG |

    | Honduran lempira | L | HNL |

    | Hong Kong dollar | $ | HKD |

    | Hungarian forint | Ft | HUF |

    | Icelandic króna | kr | ISK |

    | Indian rupee | Rs | INR |

    | Indonesian rupiah | Rp | IDR |

    | Iranian rial | ﷼ | IRR |

    | Iraqi dinar | ع.د | IQD |

    | Israeli new sheqel | ₪ | ILS |

    | Jamaican dollar | $ | JMD |

    | Japanese yen | ¥ | JPY |

    | Jordanian dinar | د.ا | JOD |

    | Kazakhstani tenge | 〒 | KZT |

    | Kenyan shilling | Sh | KES |

    | Kuwaiti dinar | د.ك | KWD |

    | Kyrgyzstani som | ¤ | KGS |

    | Lao kip | ₭ | LAK |

    | Latvian lats | Ls | LVL |

    | Lebanese pound | ل.ل | LBP |

    | Lesotho loti | L | LSL |

    | Liberian dollar | $ | LRD |

    | Libyan dinar | ل.د | LYD |

    | Lithuanian litas | Lt | LTL |

    | Macanese pataca | P | MOP |

    | Macedonian denar | ден | MKD |

    | Malagasy ariary | ¤ | MGA |

    | Malawian kwacha | MK | MWK |

    | Malaysian ringgit | RM | MYR |

    | Maldivian rufiyaa | Rf | MVR |

    | Mauritanian ouguiya | UM | MRO |

    | Mauritian rupee | ₨ | MUR |

    | Mexican peso | $ | MXN |

    | Moldovan leu | L | MDL |

    | Mongolian tögrög | ₮ | MNT |

    | Moroccan dirham | د.م. | MAD |

    | Mozambican metical | MT | MZN |

    | Myanma kyat | Ks | MMK |

    | Namibian dollar | $ | NAD |

    | Nepalese rupee | ₨ | NPR |

    | Netherlands Antillean guilder | ƒ | ANG |

    | New Taiwan dollar | $ | TWD |

    | New Zealand dollar | $ | NZD |

    | Nicaraguan córdoba | C$ | NIO |

    | Nigerian naira | ₦ | NGN |

    | North Korean won | ₩ | KPW |

    | Norwegian krone | kr | NOK |

    | Omani rial | ر.ع. | OMR |

    | Pakistani rupee | ₨ | PKR |

    | Papua New Guinean kina | K | PGK |

    | Paraguayan guaraní | ₲ | PYG |

    | Peruvian nuevo sol | S/ | PEN |

    | Philippine peso | ₱ | PHP |

    | Polish złoty | zł | PLN |

    | Qatari riyal | ر.ق | QAR |

    | Romanian leu | lei | RON |

    | Russian ruble | ₽ | RUB |

    | Rwandan franc | Fr | RWF |

    | Saint Helena pound | £ | SHP |

    | Samoan tālā | T | WST |

    | São Tomé and Príncipe dobra | Db | STN |

    | Saudi riyal | ر.س | SAR |

    | Serbian dinar | дин. | RSD |

    | Seychellois rupee | ₨ | SCR |

    | Sierra Leonean leone | Le | SLL |

    | Singapore dollar | $ | SGD |

    | Solomon Islands dollar | $ | SBD |

    | Somali shilling | Sh | SOS |

    | South African rand | R | ZAR |

    | South Korean won | ₩ | KRW |

    | Sri Lankan rupee | Rs | LKR |

    | Sudanese pound | ج.س. | SDG |

    | Surinamese dollar | $ | SRD |

    | Swazi lilangeni | L | SZL |

    | Swedish krona | kr | SEK |

    | Swiss franc | Fr | CHF |

    | Syrian pound | ل.س. | SYP |

    | Tajikistani somoni | ЅМ | TJS |

    | Tanzanian shilling | Sh | TZS |

    | Thai baht | ฿ | THB |

    | Tongan paʻanga | T$ | TOP |

    | Trinidad and Tobago dollar | $ | TTD |

    | Tunisian dinar | د.ت | TND |

    | Turkish lira | ₺ | TRY |

    | Turkmenistan manat | m | TMT |

    | Ugandan shilling | Sh | UGX |

    | Ukrainian hryvnia | ₴ | UAH |

    | United Arab Emirates dirham | د.إ | AED |

    | Uruguayan peso | $ | UYU |

    | Uzbekistani so'm | ¤ | UZS |

    | Vanuatu vatu | Vt | VUV |

    | Venezuelan bolívar | Bs. | VES |

    | Vietnamese đồng | ₫ | VND |

    | West African CFA franc | Fr | XOF |

    | Yemeni rial | ﷼ | YER |

    | Zambian kwacha | ZK | ZMW |

    | Zimbabwean dollar | $ | ZWL |



    </details>


    <details>

    <summary>Request limits</summary>



    You can perform up to 780 requests per minute for each Account. If you
    exceed this limit, you'll get a 429 Too Many Requests response for
    subsequent requests.


    We recommend you handle 429 responses so your integration retries requests
    automatically.



    </details>


  version: 2.0.0
  contact:
    name: InvoiceXpress API Support
    email: support@invoicexpress.com
  x-logo:
    url: images/ix-logo.svg
    altText: InvoiceXpress Logo
servers:
  - url: https://{account_name}.app.invoicexpress.com
    description: Production Server
    variables:
      account_name:
        default: your-account
        description: Your account subdomain.
tags:
  - name: Accounts
    description: Create, update and get info about your account.
  - name: Invoices
    description: >-
      Create invoices, invoice receipts, simplified invoices, vat moss invoices,
      credit notes & debit notes and send them to your clients.
  - name: Estimates
    description: Create quotes, proformas or fees notes and send them to your clients.
  - name: Guides
    description: Create shippings, transports & devolutions and send them to your clients.
  - name: Sequences
    description: A Sequence is used to group invoices in a sequential order.
  - name: Taxes
    description: A Tax is applied to invoice items when creating invoices.
  - name: SAF-T
    description: >-
      Export the Standard Audit File for Tax (SAF-T PT) required by the
      Portuguese Tax Authority.
  - name: Clients
    description: A Client is an entity you send invoices to.
  - name: Items
    description: An Item is the product or service you invoice.
  - name: Treasury
    description: Section dedicated to treasury movements.
security:
  - apiKeyAuth: []
paths:
  /api/accounts/create.json:
    post:
      summary: Create Account
      operationId: createAccount
      tags:
        - Accounts
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountCreateRequest'
      responses:
        '201':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountCreateSuccess'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422CreateAccount'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/api/accounts/create.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /api/accounts/create_already_user.json:
    post:
      summary: Create for existing user
      operationId: createAccountExisting
      tags:
        - Accounts
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountCreateRequest'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountCreateSuccess'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422AlreadyUser'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/api/accounts/create_already_user.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /api/accounts/{account-id}/get.json:
    get:
      summary: Get Account
      operationId: getAccount
      tags:
        - Accounts
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountGetSuccess'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/api/accounts/1/get.json?api_key=YOUR_API_KEY"
  /api/accounts/{account-id}/update.json:
    put:
      summary: Update Account
      operationId: updateAccount
      tags:
        - Accounts
      parameters:
        - $ref: '#/components/parameters/AccountIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountUpdateRequest'
      responses:
        '200':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422UpdateAccount'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/api/accounts/1/update.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /api/v3/accounts/at_communication.json:
    post:
      summary: AT Communication
      operationId: atCommunication
      tags:
        - Accounts
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AtCommunicationRequest'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AtCommunicationSuccess'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422AtCommunication'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/api/v3/accounts/at_communication.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /invoices.json:
    get:
      summary: List All
      operationId: listInvoices
      tags:
        - Invoices
      description: Returns a list of invoices.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/ListInvoicesQueryParamns'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceListAllResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/invoices.json?api_key=YOUR_API_KEY&type[]=Invoice&status[]=sent&date[from]=01/01/2024&date[to]=31/12/2024&due_date[from]=01/01/2024&due_date[to]=31/12/2024&total_before_taxes[from]=0&total_before_taxes[to]=1000"
  /{invoices-type}.json:
    post:
      summary: Create Invoice
      operationId: createInvoice
      tags:
        - Invoices
      description: >
        Creates a new invoice, simplified_invoice, invoice_receipt, credit_note
        or debit_note.




        ### Creating new clients or items along with the documents

        This method also allows to create a new client and/or new items in the
        same request with the following behavior:

        * If the client name does not exist, a new one is created.

        * If items do not exist with the given names, new ones will be created.

        * If item name already exists, the item is updated with the new values.


        ### Taxes

        Regarding item taxes, if the tax name is not found, the default tax is
        applyed to that item. Portuguese accounts should also send the IVA
        exemption reason if the invoice contains exempt items (IVA 0%).


        > **Note:** Simplified Invoices are only available in Portugal.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/DocumentTypeInvoiceParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceCreateRequest'
      responses:
        '201':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.


            #### Response wrapper key


            The parent key shown in the example below as `invoice` is only an
            example — it always matches the singular of the requested
            `{invoices-type}` path parameter: `invoice` for `invoices`,
            `invoice_receipt` for `invoice_receipts`, `simplified_invoice` for
            `simplified_invoices`, `credit_note` for `credit_notes`, and
            `debit_note` for `debit_notes`. The nested object shape is identical
            in every case.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '409':
          description: CONFLICT
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/409CreateInvoice'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422CreateInvoice'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/1.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{estimates-type}.json:
    post:
      summary: Create Estimate
      operationId: createEstimate
      tags:
        - Estimates
      description: Creates a new quote, proforma or fees_note.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/DocumentTypeEstimateParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateCreateRequest'
      responses:
        '201':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422CreateInvoice'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/1.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{guides-type}.json:
    post:
      summary: Create Guide
      operationId: createGuide
      tags:
        - Guides
      description: Creates a new shipping, transport or devolution.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/DocumentTypeGuideParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GuideCreateRequest'
      responses:
        '201':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuideGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422CreateInvoice'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/1.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{invoices-type}/{document-id}.json:
    get:
      summary: Get Invoice
      operationId: getInvoice
      tags:
        - Invoices
      parameters:
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/DocumentTypeInvoiceParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.


            #### Response wrapper key


            The parent key shown in the example below as `invoice` is only an
            example — it always matches the singular of the requested
            `{invoices-type}` path parameter: `invoice` for `invoices`,
            `invoice_receipt` for `invoice_receipts`, `simplified_invoice` for
            `simplified_invoices`, `credit_note` for `credit_notes`, and
            `debit_note` for `debit_notes`. The nested object shape is identical
            in every case.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/1/1050.json?api_key=YOUR_API_KEY"
    put:
      summary: Update Invoice
      operationId: updateInvoice
      tags:
        - Invoices
      description: >
        Updates a new invoice, simplified_invoice, invoice_receipt, credit_note
        or debit_note.




        ### Creating new clients or items along with the invoice

        This method also allows to create a new client and/or new items in the
        same request with the following behavior:

        * If the client name does not exist, a new one is created.

        * If items do not exist with the given names, new ones will be created.

        * If item name already exists, the item is updated with the new values.


        ### Taxes

        Regarding item taxes, if the tax name is not found, the default tax is
        applyed to that item. Portuguese accounts should also send the IVA
        exemption reason if the invoice contains exempt items (IVA 0%).


        > **Note:** Simplified Invoices are only available in Portugal.
      parameters:
        - $ref: '#/components/parameters/DocumentTypeInvoiceParam'
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceUpdateRequest'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.


            #### Response wrapper key


            The parent key shown in the example below as `invoice` is only an
            example — it always matches the singular of the requested
            `{invoices-type}` path parameter: `invoice` for `invoices`,
            `invoice_receipt` for `invoice_receipts`, `simplified_invoice` for
            `simplified_invoices`, `credit_note` for `credit_notes`, and
            `debit_note` for `debit_notes`. The nested object shape is identical
            in every case.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Documents'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422UpdateInvoices'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/1/1050.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{estimates-type}/{document-id}.json:
    get:
      summary: Get Estimate
      operationId: getEstimate
      tags:
        - Estimates
      parameters:
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/DocumentTypeEstimateParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/1/1050.json?api_key=YOUR_API_KEY"
    put:
      summary: Update Estimate
      operationId: updateEstimate
      tags:
        - Estimates
      description: Updates a quote, proforma or fees_note.
      parameters:
        - $ref: '#/components/parameters/DocumentTypeEstimateParam'
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateCreateRequest'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Documents'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422UpdateInvoices'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/1/1050.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{guides-type}/{document-id}.json:
    get:
      summary: Get Guide
      operationId: getGuide
      tags:
        - Guides
      parameters:
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/DocumentTypeGuideParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuideGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/1/1050.json?api_key=YOUR_API_KEY"
    put:
      summary: Update Guide
      operationId: updateGuide
      tags:
        - Guides
      description: Updates a shipping, transport or devolution.
      parameters:
        - $ref: '#/components/parameters/DocumentTypeGuideParam'
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GuideCreateRequest'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuideGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Documents'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422UpdateInvoices'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/1/1050.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{invoices-type}/{document-id}/change-state.json:
    put:
      summary: Change Invoice State
      operationId: changeInvoiceState
      tags:
        - Invoices
      description: >
        Changes the state of invoice documents.


        | From | To | State on Request Body | Notes |

        | :--- | :--- | :--- | :--- |

        | draft | final | **finalized** | All documents. |

        | draft | settled | **finalized** | Only `invoice_receipt`. |

        | draft | deleted | **deleted** | All documents. |

        | final | canceled | **canceled** | All documents. |

        | settled | canceled | **canceled** | Only `invoice_receipt`. |

        | final | settled | **settled** | All documents. |

        | settled | final | **unsettled** | Only `credit_note` and `debit_note`.
        |
      parameters:
        - $ref: '#/components/parameters/DocumentTypeInvoiceParam'
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeStateInvoiceRequest'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.


            #### Response wrapper key


            The parent key shown in the example below as `invoice` is only an
            example — it always matches the singular of the requested
            `{invoices-type}` path parameter: `invoice` for `invoices`,
            `invoice_receipt` for `invoice_receipts`, `simplified_invoice` for
            `simplified_invoices`, `credit_note` for `credit_notes`, and
            `debit_note` for `debit_notes`. The nested object shape is identical
            in every case.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Documents'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422ChangeState'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/1/1050/change-state.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{estimates-type}/{document-id}/change-state.json:
    put:
      summary: Change Estimate State
      operationId: changeEstimateState
      tags:
        - Estimates
      description: |
        Changes the state of estimate documents (quotes, proformas, fees_notes).

        | From | To | Event |
        | :--- | :--- | :--- |
        | Draft | final | `finalized` |
        | Draft | deleted | `deleted` |
        | final | Accepted | `accept` |
        | final | refused | `refuse` |
        | final | canceled | `canceled` |
        | Accepted | refused | `refuse` |
        | refused | Accepted | `accept` |
        | Accepted | canceled | `canceled` |
        | refused | canceled | `canceled` |
      parameters:
        - $ref: '#/components/parameters/DocumentTypeEstimateParam'
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeStateEstimateRequest'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Documents'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422ChangeState'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/1/1050/change-state.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{guides-type}/{document-id}/change-state.json:
    put:
      summary: Change Guide State
      operationId: changeGuideState
      tags:
        - Guides
      description: >
        Changes the state of guide documents (shippings, transports,
        devolutions).


        | From | To | Event |

        | :--- | :--- | :--- |

        | draft | final | **finalized** |

        | draft | deleted | **deleted** |

        | final | canceled | **canceled** |
      parameters:
        - $ref: '#/components/parameters/DocumentTypeGuideParam'
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeStateGuideRequest'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuideGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Documents'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422ChangeState'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/1/1050/change-state.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{invoices-type}/{document-id}/email-document.json:
    put:
      summary: Send Invoice by Email
      operationId: sendInvoiceEmail
      tags:
        - Invoices
      parameters:
        - $ref: '#/components/parameters/DocumentTypeInvoiceParam'
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailDocumentRequest'
      responses:
        '200':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '403':
          description: FORBIDDEN — the account's email service is disabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403SendEmail'
        '404':
          description: NOT FOUND
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422SendEmail'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/1/1050/email-document.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{estimates-type}/{document-id}/email-document.json:
    put:
      summary: Send Estimate by Email
      operationId: sendEstimateEmail
      tags:
        - Estimates
      parameters:
        - $ref: '#/components/parameters/DocumentTypeEstimateParam'
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailDocumentRequest'
      responses:
        '200':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '403':
          description: FORBIDDEN — the account's email service is disabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403SendEmail'
        '404':
          description: NOT FOUND
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422SendEmail'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/1/1050/email-document.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /{guides-type}/{document-id}/email-document.json:
    put:
      summary: Send Guide by Email
      operationId: sendGuideEmail
      tags:
        - Guides
      parameters:
        - $ref: '#/components/parameters/DocumentTypeGuideParam'
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailDocumentRequest'
      responses:
        '200':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '403':
          description: FORBIDDEN — the account's email service is disabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403SendEmail'
        '404':
          description: NOT FOUND
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422SendEmail'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/1/1050/email-document.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /estimates.json:
    get:
      summary: List All
      operationId: listEstimates
      tags:
        - Estimates
      description: Returns a list of estimates (Quotes, Proformas, Fees Notes).
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/ListEstimatesQueryParamns'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimatesListAll'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/estimates.json?api_key=YOUR_API_KEY&type[]=Quote&status[]=sent&due_date[from]=01/01/2024&due_date[to]=31/12/2024&date[from]=01/01/2024&date[to]=31/12/2024&total_before_taxes[from]=0&total_before_taxes[to]=1000"
  /api/pdf/{document-id}.json:
    get:
      summary: Generate PDF
      operationId: generatePdf
      tags:
        - Invoices
        - Estimates
        - Guides
      parameters:
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
        - name: second_copy
          in: query
          schema:
            type: boolean
            example: false
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PdfResponse'
        '202':
          description: ACCEPTED
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/api/pdf/1050.json?api_key=YOUR_API_KEY&second_copy=false"
  /api/qr_codes/{document-id}.json:
    get:
      summary: Get QR Code
      operationId: getQrCode
      tags:
        - Invoices
        - Guides
      parameters:
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrCodeResponse'
        '202':
          description: ACCEPTED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/202QRCode'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404QRCode'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422QRCode'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/api/qr_codes/1050.json?api_key=YOUR_API_KEY"
  /document/{document-id}/related_documents.json:
    get:
      summary: Related Documents
      operationId: relatedDocs
      tags:
        - Invoices
      parameters:
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/200RelatedDocuments'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/document/1050/related_documents.json?api_key=YOUR_API_KEY"
  /documents/{document-id}/partial_payments.json:
    post:
      summary: Generate Payment
      operationId: generatePayment
      tags:
        - Invoices
      parameters:
        - $ref: '#/components/parameters/DocumentIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422GeneratePayment'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/documents/1050/partial_payments.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /receipts/{receipt-id}/change-state.json:
    put:
      summary: Cancel Payment
      operationId: cancelReceipt
      tags:
        - Invoices
      parameters:
        - name: receipt-id
          in: path
          required: true
          schema:
            type: integer
            example: 42
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelPaymentRequest'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Documents'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422CancelPayment'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/receipts/42/change-state.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /guides.json:
    get:
      summary: List All
      operationId: listGuides
      tags:
        - Guides
      description: Returns a list of guides (Shippings, Transports and Devolutions).
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/ListGuidesQueryParamns'
      responses:
        '200':
          description: >
            SUCCESS 


            #### Possible values for field atcud:


            * ABCD1234-1 (or similar) - Unique document identifier to the Tax
            Authority, when the sequence is registered.

            * N/D - The document's sequence is relevant for ATCUD but is not
            registered in the Tax Authority.

            * N/A - The document's sequence is not relevant for ATCUD and is not
            registered in the Tax Authority.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuideListAll'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/guides.json?api_key=YOUR_API_KEY&type[]=Shipping&status[]=sent&loaded_at[from]=01/01/2024&loaded_at[to]=31/12/2024"
  /api/export_saft.json:
    get:
      summary: Export Saft
      operationId: export_saft
      tags:
        - SAF-T
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/SaftExportQueryParams'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Saft200Response'
        '202':
          description: ACCEPTED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Saft202Response'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Saft422Response'
        '500':
          description: FAILED TO GENERATE SAF-T
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Saft500Response'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/api/export_saft.json?api_key=YOUR_API_KEY&month=10&year=2017"
  /sequences/{sequence_id}/register.json:
    put:
      summary: Register Sequence
      operationId: registerSequence
      tags:
        - Sequences
      description: Registers a document sequence with the Tax Authority (AT).
      parameters:
        - $ref: '#/components/parameters/SequenceIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: >
            OK


            <br>


            **Possible values for fields `current_<document
            type>_validation_code`:**


            | Value | Description |

            | :--- | :--- |

            | **ABCD1234** | Validation code for each sequence that is
            registered in the Tax Authority. |

            | **N/D** | The sequence is relevant for ATCUD but is not registered
            in the Tax Authority. |

            | **N/A** | The sequence is not relevant for ATCUD and is not
            registered in the Tax Authority. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SequenceResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sequence006Response'
        '409':
          description: |
            CONFLICT

            **Available codes:**
            | Code | Description |
            | :--- | :--- |
            | **005** | All sequences are registered. |
            | **008** | The sequence is already being registered. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sequence005Response'
        '422':
          description: >
            UNPROCESSABLE ENTITY


            **Available codes:**

            | Code | Description |

            | :--- | :--- |

            | **001** | Sequence name not allowed. |

            | **002** | Invalid Tax Authority credentials. |

            | **003** | Account fiscal ID doesn’t have open activity in Tax
            Authority. |

            | **004** | Account is not portuguese. |

            | **007** | All Sequences are registered in AT. |

            | **000** | Unknown error. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sequence001Response'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/sequences/12345/register.json?api_key=YOUR_API_KEY"
  /sequences.json:
    get:
      summary: List All Sequences
      operationId: listSequences
      tags:
        - Sequences
      description: Returns all your sequences.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: >
            Success.


            <br>


            **Possible values for fields `current_<document
            type>_validation_code`:**


            | Value | Description |

            | :--- | :--- |

            | **ABCD1234** | Validation code for each sequence that is
            registered in the Tax Authority. |

            | **N/D** | The sequence is relevant for ATCUD but is not registered
            in the Tax Authority. |

            | **N/A** | The sequence is not relevant for ATCUD and is not
            registered in the Tax Authority. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SequenceResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/sequences.json?api_key=YOUR_API_KEY"
    post:
      summary: Create Sequence
      operationId: createSequence
      tags:
        - Sequences
      description: >
        Creates and registers a new sequence. 

        For portuguese accounts, it’s necessary to have AT credentials
        configured.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SequenceCreateRequest'
      responses:
        '201':
          description: >
            SUCCESS. Created.


            <br>


            **Possible values for fields `current_<document
            type>_validation_code`:**


            | Value | Description |

            | :--- | :--- |

            | **ABCD1234** | Validation code for each sequence that is
            registered in the Tax Authority. |

            | **N/D** | The sequence is relevant for ATCUD but is not registered
            in the Tax Authority. |

            | **N/A** | The sequence is not relevant for ATCUD and is not
            registered in the Tax Authority. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SequenceGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '409':
          description: |
            CONFLICT

            **Available codes:**
            | Code | Description |
            | :--- | :--- |
            | **006** | The sequence is already being registered. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sequence006Response'
        '422':
          description: >
            UNPROCESSABLE ENTITY


            **Available codes:**

            | Code | Description |

            | :--- | :--- |

            | **001** | Sequence name not allowed. |

            | **002** | Sequence already exists. |

            | **003** | Invalid sequence. |

            | **004** | Invalid Tax Authority credentials. |

            | **005** | Account fiscal ID doesn’t have open activity in Tax
            Authority. |

            | **000** | Unknown error. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sequence001Response'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/sequences.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /sequences/{sequence_id}.json:
    get:
      summary: Get Sequence
      operationId: getSequence
      tags:
        - Sequences
      description: Returns a specific sequence.
      parameters:
        - $ref: '#/components/parameters/SequenceIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: >
            Success.


            <br>


            **Possible values for fields `current_<document
            type>_validation_code`:**


            | Value | Description |

            | :--- | :--- |

            | **ABCD1234** | Validation code for each sequence that is
            registered in the Tax Authority. |

            | **N/D** | The sequence is relevant for ATCUD but is not registered
            in the Tax Authority. |

            | **N/A** | The sequence is not relevant for ATCUD and is not
            registered in the Tax Authority. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SequenceGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/sequences/12345.json?api_key=YOUR_API_KEY"
  /sequences/{sequence_id}/set_current.json:
    put:
      summary: Set Sequence as Default
      operationId: setSequenceDefault
      tags:
        - Sequences
      description: Sets a specific sequence as the default.
      parameters:
        - $ref: '#/components/parameters/SequenceIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
        '422':
          description: UNPROCESSABLE ENTITY
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/sequences/12345/set_current.json?api_key=YOUR_API_KEY"
  /taxes.json:
    get:
      summary: List All Taxes
      operationId: listTaxes
      tags:
        - Taxes
      description: Returns all your taxes.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxesResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/taxes.json?api_key=YOUR_API_KEY"
    post:
      summary: Create Taxes
      operationId: createTax
      tags:
        - Taxes
      description: Creates a new tax.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxesCreateRequest'
      responses:
        '201':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxesGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422CreateTaxes'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/taxes.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /taxes/{taxes_id}.json:
    get:
      summary: Get Taxes
      operationId: getTax
      tags:
        - Taxes
      description: Returns a specific tax.
      parameters:
        - $ref: '#/components/parameters/TaxesIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxesGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/taxes/12345.json?api_key=YOUR_API_KEY"
    put:
      summary: Update Taxes
      operationId: updateTax
      tags:
        - Taxes
      description: Updates a tax.
      parameters:
        - $ref: '#/components/parameters/TaxesIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxesCreateRequest'
      responses:
        '200':
          description: Success
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422UpdateTaxes'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/taxes/12345.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
    delete:
      summary: Delete Tax
      operationId: deleteTax
      tags:
        - Taxes
      description: Deletes a tax.
      parameters:
        - $ref: '#/components/parameters/TaxesIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: Success
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X DELETE
            "https://your-account.app.invoicexpress.com/taxes/12345.json?api_key=YOUR_API_KEY"
  /clients.json:
    get:
      summary: List All Clients
      operationId: listClients
      tags:
        - Clients
      description: Returns a list of all your clients.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/PageParam'
        - $ref: '#/components/parameters/PerPageParam'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientsListAll'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/clients.json?api_key=YOUR_API_KEY&page=1&per_page=30"
    post:
      summary: Create Client
      operationId: createClient
      tags:
        - Clients
      description: Creates a new client.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientRequest'
      responses:
        '201':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientsGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422CreateClients'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/clients.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /clients/{client_id}.json:
    get:
      summary: Get Client
      operationId: getClient
      tags:
        - Clients
      description: Returns a specific client.
      parameters:
        - $ref: '#/components/parameters/ClientsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientsGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/clients/12345.json?api_key=YOUR_API_KEY"
    put:
      summary: Update Client
      operationId: updateClient
      tags:
        - Clients
      description: Updates a client.
      parameters:
        - $ref: '#/components/parameters/ClientsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientRequest'
      responses:
        '200':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
        '422':
          description: UNPROCESSABLE ENTITY
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/clients/12345.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /clients/find-by-name.json:
    get:
      summary: Find Client by Name
      operationId: findClientByName
      tags:
        - Clients
      description: Returns a specific client.
      parameters:
        - $ref: '#/components/parameters/FindByName'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientsGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/clients/find-by-name.json?api_key=YOUR_API_KEY&client_name=foo"
  /clients/find-by-code.json:
    get:
      summary: Find Client by Code
      operationId: findClientByCode
      tags:
        - Clients
      description: Returns a specific client.
      parameters:
        - $ref: '#/components/parameters/FindByCode'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientsGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/clients/find-by-code.json?api_key=YOUR_API_KEY&client_code=foo"
  /clients/{client_id}/invoices.json:
    post:
      summary: List Client Invoices
      operationId: listClientInvoices
      tags:
        - Clients
      description: >-
        This method allows you to obtain the invoices for a specific client. You
        can filter the results by document status, type and if it’s archived or
        not.
      parameters:
        - name: client_id
          in: path
          required: true
          description: Filter invoices for this client.
          schema:
            type: integer
            example: 42
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/PageParam'
        - $ref: '#/components/parameters/PerPageParam'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientsInvoiceFilterRequest'
      responses:
        '200':
          description: SUCCESS. Returns the client's invoices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientsInvoicesResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/clients/42/invoices.json?api_key=YOUR_API_KEY&page=1&per_page=30"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /items.json:
    get:
      summary: List All Items
      operationId: listItems
      tags:
        - Items
      description: Returns a list of all your items.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
        - $ref: '#/components/parameters/PageParam'
        - $ref: '#/components/parameters/PerPageParam'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemsListAll'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/items.json?api_key=YOUR_API_KEY&page=1&per_page=30"
    post:
      summary: Create Item
      operationId: createItem
      tags:
        - Items
      description: Creates a new item.
      parameters:
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemRequest'
      responses:
        '201':
          description: SUCCESS. Returns the created item.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemsGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422CreateItems'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/items.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /items/{item_id}.json:
    get:
      summary: Get Item
      operationId: getItem
      tags:
        - Items
      description: Returns a specific item.
      parameters:
        - $ref: '#/components/parameters/ItemsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemsGetResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/items/12345.json?api_key=YOUR_API_KEY"
    put:
      summary: Update Item
      operationId: updateItem
      tags:
        - Items
      description: Updates an item.
      parameters:
        - $ref: '#/components/parameters/ItemsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemRequest'
      responses:
        '200':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422UpdateItems'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/items/12345.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
    delete:
      summary: Delete Item
      operationId: deleteItem
      tags:
        - Items
      description: Deletes an item.
      parameters:
        - $ref: '#/components/parameters/ItemsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X DELETE
            "https://your-account.app.invoicexpress.com/items/12345.json?api_key=YOUR_API_KEY"
  /api/v3/clients/{client_id}/balance.json:
    get:
      summary: Get Client Balance
      operationId: getClientBalance
      tags:
        - Treasury
      description: Returns the balance of a specific client.
      parameters:
        - $ref: '#/components/parameters/ClientsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientBalanceResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Clients'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/api/v3/clients/12345/balance.json?api_key=YOUR_API_KEY"
  /api/v3/clients/{client_id}/initial_balance.json:
    put:
      summary: Update Initial Balance
      operationId: updateClientInitialBalance
      tags:
        - Treasury
      description: Updates the initial balance of a specific client.
      parameters:
        - $ref: '#/components/parameters/ClientsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitialBalanceRequest'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitialBalanceResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Clients'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422InitialBalance'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PUT
            "https://your-account.app.invoicexpress.com/api/v3/clients/12345/initial_balance.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /api/v3/clients/{client_id}/regularization.json:
    get:
      summary: Get Client Regularization
      operationId: getClientRegularizations
      tags:
        - Treasury
      description: Returns a list of all your client’s regularization.
      parameters:
        - $ref: '#/components/parameters/ClientsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegularizationListResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Clients'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            "https://your-account.app.invoicexpress.com/api/v3/clients/12345/regularization.json?api_key=YOUR_API_KEY"
    post:
      summary: Create Regularization
      operationId: createClientRegularization
      tags:
        - Treasury
      description: Creates a new client’s regularization.
      parameters:
        - $ref: '#/components/parameters/ClientsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegularizationRequest'
      responses:
        '201':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegularizationCreateResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Clients'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422CreateRegularization'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/api/v3/clients/12345/regularization.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /api/v3/clients/{client_id}/regularization/{id}.json:
    delete:
      summary: Delete Regularization
      operationId: deleteClientRegularization
      tags:
        - Treasury
      description: Deletes a client’s regularization.
      parameters:
        - $ref: '#/components/parameters/ClientsIdParam'
        - $ref: '#/components/parameters/TreasuryIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '200':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Clients'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X DELETE
            "https://your-account.app.invoicexpress.com/api/v3/clients/12345/regularization/1.json?api_key=YOUR_API_KEY"
  /api/v3/clients/{client_id}/treasury_movements.json:
    post:
      summary: Create Treasury Movement
      operationId: createClientTreasuryMovement
      tags:
        - Treasury
      description: Creates a new client’s treasury movement.
      parameters:
        - $ref: '#/components/parameters/ClientsIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreasuryMovementRequest'
      responses:
        '201':
          description: SUCCESS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreasuryMovementResponse'
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Clients'
        '422':
          description: UNPROCESSABLE ENTITY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/422Treasury'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://your-account.app.invoicexpress.com/api/v3/clients/12345/treasury_movements.json?api_key=YOUR_API_KEY"
            \
              -H "Content-Type: application/json" \
              --data '{}'
  /api/v3/clients/{client_id}/treasury_movements/{id}.json:
    delete:
      summary: Delete Treasury Movement
      operationId: deleteClientTreasuryMovement
      tags:
        - Treasury
      description: Deletes a client’s treasury movement.
      parameters:
        - $ref: '#/components/parameters/ClientsIdParam'
        - $ref: '#/components/parameters/TreasuryIdParam'
        - $ref: '#/components/parameters/ApiKeyParam'
      responses:
        '204':
          description: SUCCESS
        '401':
          description: ACCESS DENIED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: NOT FOUND
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Clients'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X DELETE
            "https://your-account.app.invoicexpress.com/api/v3/clients/12345/treasury_movements/1.json?api_key=YOUR_API_KEY"
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: query
      name: api_key
  parameters:
    ApiKeyParam:
      name: api_key
      in: query
      required: true
      schema:
        type: string
        example: YOUR_API_KEY
      description: Your API Key.
    DocumentTypeInvoiceParam:
      name: invoices-type
      in: path
      required: true
      schema:
        type: string
        enum:
          - invoices
          - invoice_receipts
          - simplified_invoices
          - credit_notes
          - debit_notes
      description: The type of the invoice document.
    DocumentTypeEstimateParam:
      name: estimates-type
      in: path
      required: true
      schema:
        type: string
        enum:
          - quotes
          - proformas
          - fees_notes
      description: The type of the estimate document.
    DocumentTypeGuideParam:
      name: guides-type
      in: path
      required: true
      schema:
        type: string
        enum:
          - shippings
          - transports
          - devolutions
      description: The type of the guide document.
    DocumentIdParam:
      name: document-id
      in: path
      required: true
      schema:
        type: integer
        example: 1050
      description: The ID of the document.
    AccountIdParam:
      name: account-id
      in: path
      required: true
      schema:
        type: integer
        example: 1
    ListInvoicesQueryParamns:
      name: Query Parameters
      in: query
      style: form
      explode: true
      schema:
        $ref: '#/components/schemas/QueryParamns'
      description: Click to expand options.
    ListEstimatesQueryParamns:
      name: Query Parameters
      in: query
      style: form
      explode: true
      schema:
        $ref: '#/components/schemas/EstimateFilters'
      description: Click to expand options.
    ListGuidesQueryParamns:
      name: Query Parameters
      in: query
      style: form
      explode: true
      schema:
        $ref: '#/components/schemas/GuideQueryParamns'
      description: Click to expand options.
    SaftExportQueryParams:
      name: Saft Params
      in: query
      style: form
      explode: true
      required: true
      schema:
        $ref: '#/components/schemas/SaftExportParams'
      description: Click to expand options.
    SequenceIdParam:
      name: sequence_id
      in: path
      required: true
      description: ID of the sequence.
      schema:
        type: string
        example: '12345'
    TaxesIdParam:
      name: taxes_id
      in: path
      required: true
      description: ID of the tax.
      schema:
        type: string
        example: '12345'
    ClientsIdParam:
      name: client_id
      in: path
      required: true
      description: ID of the client.
      schema:
        type: string
        example: '12345'
    PageParam:
      name: page
      in: query
      required: false
      description: You can ask for a specific page of results. Defaults to 1.
      schema:
        type: integer
        example: 1
    PerPageParam:
      name: per_page
      in: query
      required: false
      description: >-
        You can specify how many results you want to fetch. Defaults to 10 or
        value defined in account settings (10, 20 or 30).
      schema:
        type: integer
        example: 30
    FindByName:
      name: client_name
      in: query
      required: true
      description: >-
        The client name you want to search. Warning: partial search is not
        supported.
      schema:
        type: string
        example: foo
    FindByCode:
      name: client_code
      in: query
      required: true
      description: The client code you want to search.
      schema:
        type: string
        example: foo
    ItemsIdParam:
      name: item_id
      in: path
      required: true
      description: ID of the item.
      schema:
        type: string
        example: '12345'
    TreasuryIdParam:
      name: id
      in: path
      required: true
      description: The ID of the regularization you want to delete.
      schema:
        type: integer
        example: 1
  schemas:
    '401':
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              error:
                type: string
                example: Authentication Error
    AccountCreateRequest:
      type: object
      required:
        - account
      properties:
        account:
          type: object
          required:
            - organization_name
            - email
            - password
            - password_confirmation
            - terms
          properties:
            first_name:
              type: string
              example: John
            last_name:
              type: string
              example: Doe
            organization_name:
              type: string
              example: My Company
              maxLength: 100
              description: Values longer than 100 characters are rejected with HTTP 422.
            phone:
              type: string
              example: '912345678'
              maxLength: 255
            email:
              type: string
              example: john.doe@example.com
              maxLength: 255
            password:
              type: string
              example: secret123
            password_confirmation:
              type: string
              example: secret123
            fiscal_id:
              type: string
              example: '500100200'
              maxLength: 255
            tax_country:
              type: string
              enum:
                - '1'
                - '2'
                - '3'
              example: '1'
            language:
              type: string
              enum:
                - pt
                - en
                - es
              example: pt
            terms:
              type: string
              enum:
                - '1'
                - '0'
              example: '1'
            marketing:
              type: string
              enum:
                - '1'
                - '0'
              example: '0'
    AccountCreateSuccess:
      type: object
      properties:
        account:
          type: object
          properties:
            id:
              type: string
              example: '12345'
            name:
              type: string
              example: mycompany
              maxLength: 20
              minLength: 3
              description: >-
                Account subdomain (slug) used in the account URL — not the
                display name. The display name is `organization_name`.
            url:
              type: string
              example: https://mycompany.app.invoicexpress.com
            api_key:
              type: string
              example: abc123xyz456
            state:
              type: string
              example: active
              maxLength: 255
    AccountGetSuccess:
      type: object
      properties:
        account:
          type: object
          properties:
            organization_name:
              type: string
              example: My Company
              maxLength: 100
              description: Values longer than 100 characters are rejected with HTTP 422.
            fiscal_id:
              type: string
              example: '500100200'
              maxLength: 255
            email:
              type:
                - string
                - 'null'
              example: john.doe@example.com
              maxLength: 255
            state:
              type: string
              example: active
              maxLength: 255
            at_configured:
              type: boolean
              example: true
            trial:
              type: boolean
              example: true
    AccountUpdateRequest:
      type: object
      required:
        - account
      properties:
        account:
          type: object
          required:
            - organization_name
            - email
            - password
            - terms
          properties:
            first_name:
              type: string
              example: My New Company Name
            last_name:
              type: string
              example: My New Company Name
            organization_name:
              type: string
              example: My New Company Name
              maxLength: 100
              description: Values longer than 100 characters are rejected with HTTP 422.
            phone:
              type: string
              example: '210000000'
              maxLength: 255
            email:
              type: string
              example: billing@company.com
              maxLength: 255
            password:
              type: string
              example: secret123
            fiscal_id:
              type: string
              example: '500100200'
              maxLength: 255
              description: Cannot be changed
            address:
              type: string
              example: Main Street, 123
              maxLength: 210
              description: Values longer than 210 characters are rejected with HTTP 422.
            city:
              type: string
              example: Lisbon
              maxLength: 50
              description: Values longer than 50 characters are rejected with HTTP 422.
            postal_code:
              type: string
              example: 1000-001
              maxLength: 255
            website:
              type: string
              example: www.company.com
              maxLength: 255
            fax:
              type: string
              example: '210000001'
              maxLength: 255
            terms:
              type: string
              enum:
                - '1'
                - '0'
              example: '1'
            credentials:
              $ref: '#/components/schemas/Credentials'
    Credentials:
      type: object
      description: AT Credentials.
      required:
        - username
        - password
      properties:
        username:
          type: string
          example: 500100200/1
        password:
          type: string
          example: password
        type:
          type: string
          enum:
            - AT
          default: AT
        context:
          type: string
          enum:
            - Sequences
          default: Sequences
    AtCommunicationRequest:
      type: object
      required:
        - at_communication
      properties:
        at_communication:
          type: object
          required:
            - at_subuser
            - at_password
            - communication_type
          properties:
            at_subuser:
              type: string
              example: 500100200/1
              maxLength: 255
            at_password:
              type: string
              example: password
              maxLength: 255
            communication_type:
              type: string
              enum:
                - auto
                - manual
                - guides
                - portal_at
              example: auto
    AtCommunicationSuccess:
      type: object
      properties:
        success:
          type: boolean
          example: true
    InvoiceCreateRequest:
      type: object
      description: Document details.
      required:
        - invoice
      properties:
        invoice:
          $ref: '#/components/schemas/CreateBody'
        proprietary_uid:
          type: string
          example: uuid-123
    InvoiceUpdateRequest:
      type: object
      description: Document details.
      required:
        - invoice
      properties:
        invoice:
          $ref: '#/components/schemas/CreateBody'
    ChangeStateInvoiceRequest:
      type: object
      required:
        - invoice
      properties:
        invoice:
          type: object
          required:
            - state
          properties:
            state:
              type: string
              enum:
                - finalized
                - canceled
                - deleted
                - accepted
                - refused
                - settled
              example: finalized
            message:
              type: string
              example: Wrong value
              description: No enforced character limit.
    EmailDocumentRequest:
      type: object
      required:
        - message
      properties:
        message:
          type: object
          required:
            - client
          properties:
            client:
              type: object
              required:
                - email
                - save
              properties:
                email:
                  type: string
                  example: dest@mail.com
                save:
                  type: string
                  enum:
                    - '0'
                    - '1'
                  example: '1'
            subject:
              type: string
              example: Invoice
            body:
              type: string
              example: Attached.
            cc:
              type: string
              example: cc@mail.com
            bcc:
              type: string
              example: bcc@mail.com
            logo:
              type: string
              enum:
                - '0'
                - '1'
              example: '1'
    PaymentRequest:
      type: object
      required:
        - partial_payment
      properties:
        partial_payment:
          type: object
          required:
            - amount
          properties:
            amount:
              type: number
              example: 10
            payment_mechanism:
              type: string
              enum:
                - TB
                - MB
                - CC
              example: TB
            note:
              type: string
              example: Transfer
            serie:
              type: string
            payment_date:
              type: string
              example: 22/11/2025
    CancelPaymentRequest:
      type: object
      required:
        - receipt
      properties:
        receipt:
          type: object
          required:
            - state
            - message
          properties:
            state:
              type: string
              enum:
                - canceled
              example: canceled
            message:
              type: string
              example: Error
    ChangeStateEstimateRequest:
      type: object
      required:
        - quote
      properties:
        quote:
          type: object
          required:
            - state
          properties:
            state:
              type: string
              enum:
                - finalized
                - canceled
                - deleted
                - accepted
                - refused
              example: finalized
            message:
              type: string
              example: Wrong value
              description: Cancellation message. No enforced character limit (text column).
    EstimatesItemRequest:
      type: object
      description: Line Item.
      required:
        - name
        - description
        - unit_price
        - quantity
      properties:
        name:
          type: string
          example: Consulting
          maxLength: 60
          description: >-
            Maximum 60 characters. V3 rejects a longer name with HTTP 422; V2
            accepts the request and silently truncates the stored value to 60
            characters.
        description:
          type: string
          example: IT Services
          maxLength: 200
          description: >-
            Maximum 200 characters and 20 lines. V3 rejects a longer description
            with HTTP 422; V2 accepts the request and silently truncates the
            stored value to 200 characters.
        unit_price:
          type: number
          example: 50
        quantity:
          type: number
          example: 2
        unit:
          type: string
          example: hour
          description: One of a fixed set of supported unit values.
        discount:
          type: number
          example: 0
        tax:
          $ref: '#/components/schemas/EstimatesTaxRequest'
    EstimatesTaxRequest:
      type: object
      properties:
        name:
          type: string
          example: IVA23
          maxLength: 255
          description: Defaults to 255 characters at the database level.
    EstimateCreateRequest:
      type: object
      required:
        - quote
      properties:
        quote:
          type: object
          required:
            - client
            - items
          properties:
            date:
              type: string
              example: 22/11/2025
              description: dd/mm/yyyy
            due_date:
              type: string
              example: 22/12/2025
              description: dd/mm/yyyy
            reference:
              type: string
              example: PO-999
              maxLength: 255
            observations:
              type: string
              example: Services rendered
              description: No enforced character limit (text column).
            retention:
              type: string
              example: '0'
            tax_exemption:
              type: string
              example: M00
            sequence_id:
              type: string
              example: '123456'
            manual_sequence_number:
              type: string
              maxLength: 255
              description: >-
                255-character limit is the database column default, not an
                explicit business rule.
            client:
              $ref: '#/components/schemas/DocumentClientRequest'
            items:
              type: array
              items:
                $ref: '#/components/schemas/EstimatesItemRequest'
            mb_reference:
              type: string
              enum:
                - '0'
                - '1'
              example: '1'
            auto_add_related_document:
              type: string
              example: '0'
            tax_exemption_reason:
              type: string
              example: M00
              maxLength: 210
              description: >-
                Validated at 210 characters by the document model, below the
                255-character database column limit.
    GuideGetResponse:
      type: object
      properties:
        shipping:
          type: object
          description: >-
            Wrapper key matches the singular of the requested guide type —
            `shipping`, `transport` or `devolution`. Shown here as "shipping".
          properties:
            id:
              type: integer
              example: 541797
            status:
              type: string
              example: final
            archived:
              type: boolean
              example: false
            type:
              type: string
              example: Shipping
            sequence_number:
              type: string
              example: 1/D
            inverted_sequence_number:
              type: string
              example: D/1
            atcud:
              type: string
              example: ABCD1234-1
            date:
              type: string
              example: 13/07/2017
            due_date:
              type: string
              description: dd/mm/yyyy
              example: 27/07/2026
            reference:
              type:
                - string
                - 'null'
              example: null
              maxLength: 255
            observations:
              type:
                - string
                - 'null'
              example: null
              description: No enforced character limit (text column).
            retention:
              type:
                - string
                - 'null'
              example: null
            loaded_at:
              type: string
              description: >-
                dd/mm/yyyy HH:mm:ss. Note the list endpoint returns this same
                field as date-only (dd/mm/yyyy).
              example: 27/07/2026 23:00:00
            license_plate:
              type:
                - string
                - 'null'
              example: 11-AA-22
              maxLength: 255
              description: >-
                255-character limit is the database column default, not an
                explicit business rule.
            permalink:
              type: string
              example: >-
                https://web.invoicexpress.com/documents/541797d75bbee48911934cbd4a4294946a324295f52b08
            saft_hash:
              type: string
              example: vaDf
              description: No enforced character limit (text column).
            sum:
              type: number
              example: 1
            discount:
              type: number
              example: 0
            before_taxes:
              type: number
              example: 1
            taxes:
              type: number
              example: 0.07
            total:
              type: number
              example: 1.07
            currency:
              type: string
              example: Euro
            address_from:
              type: object
              properties:
                country:
                  type: string
                  example: Portugal
                  maxLength: 255
                  description: >-
                    Not stored on the address itself — resolved through a
                    tax-location name lookup, falling back to Portugal.
                postal_code:
                  type: string
                  example: 1050-083
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule.
                detail:
                  type: string
                  example: Avenida Duque D'Avila, 46 - 3ºA
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule. Note the API
                    re-inserts line breaks roughly every 35 characters before
                    storing, so an input close to 255 characters can overflow
                    the column — keep well under the limit.
                city:
                  type: string
                  example: Lisboa
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule.
            address_to:
              type: object
              properties:
                country:
                  type: string
                  example: Portugal
                  maxLength: 255
                  description: >-
                    Not stored on the address itself — resolved through a
                    tax-location name lookup, falling back to Portugal.
                postal_code:
                  type: string
                  example: 4000-327
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule.
                detail:
                  type: string
                  example: Avenida dos Aliados
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule. Note the API
                    re-inserts line breaks roughly every 35 characters before
                    storing, so an input close to 255 characters can overflow
                    the column — keep well under the limit.
                city:
                  type: string
                  example: Porto
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule.
            client:
              type: object
              properties:
                id:
                  type: integer
                  example: 1310176
                name:
                  type: string
                  example: John
                  maxLength: 100
                country:
                  type: string
                  example: Portugal
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default, not an
                    explicit business rule.
            items:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    example: iPhone
                    maxLength: 60
                    description: >-
                      Maximum 60 characters. V3 rejects a longer name with HTTP
                      422; V2 accepts the request and silently truncates the
                      stored value to 60 characters.
                  description:
                    type:
                      - string
                      - 'null'
                    example: null
                    maxLength: 200
                    description: >-
                      Maximum 200 characters and 20 lines. V3 rejects a longer
                      description with HTTP 422; V2 accepts the request and
                      silently truncates the stored value to 200 characters.
                  unit_price:
                    type: string
                    example: '1.0'
                  unit:
                    type:
                      - string
                      - 'null'
                    example: service
                    description: >-
                      Restricted to a fixed set of unit values rather than
                      length-limited free text.
                  quantity:
                    type: string
                    example: '1.0'
                  tax:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 31597
                      name:
                        type: string
                        example: IVA7
                      value:
                        type: number
                        example: 7
                  discount:
                    type: number
                    example: 0
                  subtotal:
                    type: number
                    example: 1
                  tax_amount:
                    type: number
                    example: 0.07
                  discount_amount:
                    type: number
                    example: 0
                  total:
                    type: number
                    example: 1.07
            sequence_id:
              type:
                - integer
                - 'null'
              example: 12345
            tax_exemption:
              type: string
              example: M01
            at_doc_code_id:
              type:
                - string
                - 'null'
              example: '999'
              maxLength: 255
              readOnly: true
              description: >-
                Read-only. Written only by the AT gateway and never accepted on
                input. The 255-character limit is the database column default,
                not an explicit business rule.
    ChangeStateGuideRequest:
      type: object
      required:
        - shipping
      properties:
        shipping:
          type: object
          required:
            - state
          properties:
            state:
              type: string
              enum:
                - finalized
                - canceled
                - deleted
              example: finalized
            message:
              type: string
              example: Wrong value
              description: >-
                No enforced character limit (text column, stored as
                cancel_message).
    GuideListAllResponse:
      $ref: '#/components/schemas/GuideListAll'
    GuideCreateRequest:
      type: object
      required:
        - shipping
      properties:
        shipping:
          type: object
          required:
            - date
            - due_date
            - loaded_at
            - address_from
            - address_to
            - client
            - items
          properties:
            date:
              type: string
              description: dd/mm/yyyy
              example: 03/12/2017
            due_date:
              type: string
              description: dd/mm/yyyy
              example: 03/12/2017
            loaded_at:
              type: string
              description: dd/mm/yyyy HH:mm:ss
              example: 02/12/2017 19:00:00
            license_plate:
              type: string
              example: 11-AA-22
              maxLength: 255
              description: >-
                255-character limit is the database column default, not an
                explicit business rule.
            address_from:
              type: object
              required:
                - detail
                - city
                - postal_code
                - country
              properties:
                detail:
                  type: string
                  example: Rua 5
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule. Note the API
                    re-inserts line breaks roughly every 35 characters before
                    storing, so an input close to 255 characters can overflow
                    the column — keep well under the limit.
                city:
                  type: string
                  example: Lisboa
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule.
                postal_code:
                  type: string
                  example: 1000-555
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule.
                country:
                  type: string
                  example: Portugal
                  maxLength: 255
                  description: >-
                    Not stored on the address itself — resolved through a
                    tax-location name lookup, falling back to Portugal.
            address_to:
              type: object
              required:
                - detail
                - city
                - postal_code
                - country
              properties:
                detail:
                  type: string
                  example: Avenida 10
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule. Note the API
                    re-inserts line breaks roughly every 35 characters before
                    storing, so an input close to 255 characters can overflow
                    the column — keep well under the limit.
                city:
                  type: string
                  example: Porto
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule.
                postal_code:
                  type: string
                  example: 2000-555
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default on the
                    Address model, not an explicit business rule.
                country:
                  type: string
                  example: Portugal
                  maxLength: 255
                  description: >-
                    Not stored on the address itself — resolved through a
                    tax-location name lookup, falling back to Portugal.
            reference:
              type: string
              example: '999'
              maxLength: 255
            observations:
              type: string
              example: Observations
              description: No enforced character limit (text column).
            retention:
              type: string
              example: '0'
            tax_exemption:
              type: string
              example: M01
            sequence_id:
              type: string
              example: '12345'
            manual_sequence_number:
              type: string
              example: '1'
              maxLength: 255
              description: >-
                255-character limit is the database column default, not an
                explicit business rule.
            client:
              type: object
              description: >-
                To identify an existing client, send `id`, `code`, or `name` —
                not all three are required. Resolution priority: if `id` is sent
                and matches a client on the account, that client is used and
                `name`/`code` are ignored. Without `id`, if `code` matches an
                existing client, that client is used and `name` is not needed.
                Without an `id`/`code` match, `name` is used to find or create
                the client. Creating a brand-new client (no `id`/`code` match)
                still requires `name`; `code` is always optional and is never
                generated automatically by InvoiceXpress.
              properties:
                id:
                  type: integer
                  example: 1310176
                  description: >-
                    Internal client ID. Preferred way to identify an existing
                    client — see the object description.
                name:
                  type: string
                  example: Client Name
                  maxLength: 100
                code:
                  type: string
                  example: A1
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default, not an
                    explicit business rule.
                email:
                  type: string
                  example: foo@bar.com
                  maxLength: 254
                address:
                  type: string
                  example: Saldanha
                  description: No enforced character limit (text column).
                city:
                  type: string
                  example: Lisbon
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default, not an
                    explicit business rule.
                postal_code:
                  type: string
                  example: 1050-555
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default, not an
                    explicit business rule.
                country:
                  type: string
                  example: Portugal
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default, not an
                    explicit business rule.
                fiscal_id:
                  type: string
                  example: '508000000'
                  maxLength: 255
                  description: >-
                    255-character limit is the database column default, not an
                    explicit business rule.
                website:
                  type: string
                  example: www.website.com
                  maxLength: 60
                phone:
                  type: string
                  example: '910000000'
                  maxLength: 20
                fax:
                  type: string
                  example: '210000000'
                  maxLength: 20
                observations:
                  type: string
                  example: Observations
                  description: No enforced character limit (text column).
            items:
              type: array
              items:
                type: object
                required:
                  - name
                  - description
                  - unit_price
                  - quantity
                properties:
                  name:
                    type: string
                    example: Item Name
                    maxLength: 60
                    description: >-
                      Maximum 60 characters. V3 rejects a longer name with HTTP
                      422; V2 accepts the request and silently truncates the
                      stored value to 60 characters.
                  description:
                    type: string
                    example: Item Description
                    maxLength: 200
                    description: >-
                      Maximum 200 characters and 20 lines. V3 rejects a longer
                      description with HTTP 422; V2 accepts the request and
                      silently truncates the stored value to 200 characters.
                  unit_price:
                    type: string
                    example: '100'
                  quantity:
                    type: string
                    example: '5'
                  unit:
                    type: string
                    example: service
                    description: >-
                      Restricted to a fixed set of unit values rather than
                      length-limited free text.
                  discount:
                    type: string
                    example: '50'
                  tax:
                    type: object
                    properties:
                      name:
                        type: string
                        example: IVA23
            tax_exemption_reason:
              type: string
              example: M00
              maxLength: 210
              description: >-
                Validated at 210 characters by the document model, below the
                255-character database column limit.
            load_site:
              type: string
              example: Lisbon, Portugal
              description: No enforced character limit (text column).
            delivery_site:
              type: string
              example: Madrid, Spain
              description: No enforced character limit (text column).
    Saft200Response:
      type: object
      properties:
        Url:
          type: string
          description: >-
            Link to download your SAF-T file. Absent when there are no documents
            to export in the selected period — see message instead.
          example: https://some.url
        message:
          type: string
          description: >-
            Present instead of Url when there are no documents to export in the
            selected period.
          example: There aren't any documents to export on the selected period.
    Saft202Response:
      type: object
      properties:
        message:
          type: string
          example: >-
            The SAF-T file generation was started. Please keep requesting until
            you get back the url.
    Saft500Response:
      type: object
      properties:
        message:
          type: string
          example: Error generating SAF-T. Please try again.
    Saft422Response:
      type: object
      properties:
        message:
          type: string
          example: There aren't any documents to export on the selected period.
    SequenceResponse:
      type: object
      properties:
        sequences:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 146090
              serie:
                type: string
                example: '2022'
                maxLength: 35
              default_sequence:
                type: integer
                example: 1
              current_invoice_number:
                type: integer
                example: 0
              current_invoice_sequence_id:
                type: integer
                example: 146090
              current_invoice_validation_code:
                type: string
                example: ABCD1230
              current_invoice_receipt_number:
                type: integer
                example: 0
              current_invoice_receipt_sequence_id:
                type: integer
                example: 146092
              current_invoice_receipt_validation_code:
                type: string
                example: ABCD1231
              current_simplified_invoice_number:
                type: integer
                example: 0
              current_simplified_invoice_sequence_id:
                type: integer
                example: 146091
              current_simplified_invoice_validation_code:
                type: string
                example: ABCD1232
              current_credit_note_number:
                type: integer
                example: 0
              current_credit_note_sequence_id:
                type: integer
                example: 146095
              current_credit_note_validation_code:
                type: string
                example: ABCD1233
              current_debit_note_number:
                type: integer
                example: 0
              current_debit_note_sequence_id:
                type: integer
                example: 146094
              current_debit_note_validation_code:
                type: string
                example: ABCD1234
              current_receipt_number:
                type: integer
                example: 0
              current_receipt_sequence_id:
                type: integer
                example: 146093
              current_receipt_validation_code:
                type: string
                example: ABCD1235
              current_shipping_number:
                type: integer
                example: 0
              current_shipping_sequence_id:
                type: integer
                example: 146104
              current_shipping_validation_code:
                type: string
                example: ABCD1236
              current_transport_number:
                type: integer
                example: 0
              current_transport_sequence_id:
                type: integer
                example: 146106
              current_transport_validation_code:
                type: string
                example: ABCD1237
              current_devolution_number:
                type: integer
                example: 0
              current_devolution_sequence_id:
                type: integer
                example: 146105
              current_devolution_validation_code:
                type: string
                example: ABCD1238
              current_proforma_number:
                type: integer
                example: 0
              current_proforma_sequence_id:
                type: integer
                example: 146102
              current_proforma_validation_code:
                type: string
                example: ABCD1239
              current_quote_number:
                type: integer
                example: 0
              current_quote_sequence_id:
                type: integer
                example: 146101
              current_quote_validation_code:
                type: string
                example: ABCD1240
              current_fees_note_number:
                type: integer
                example: 0
              current_fees_note_sequence_id:
                type: integer
                example: 146103
              current_fees_note_validation_code:
                type: string
                example: N/A
              current_vat_moss_invoice_number:
                type: integer
                example: 0
              current_vat_moss_invoice_sequence_id:
                type: integer
                example: 146097
              current_vat_moss_invoice_validation_code:
                type: string
                example: N/A
              current_vat_moss_credit_note_number:
                type: integer
                example: 0
              current_vat_moss_credit_note_sequence_id:
                type: integer
                example: 146098
              current_vat_moss_credit_note_validation_code:
                type: string
                example: N/A
              current_vat_moss_receipt_number:
                type: integer
                example: 0
              current_vat_moss_receipt_sequence_id:
                type: integer
                example: 146099
              current_vat_moss_receipt_validation_code:
                type: string
                example: N/A
    SequenceGetResponse:
      type: object
      properties:
        sequences:
          type: object
          properties:
            id:
              type: integer
              example: 146090
            serie:
              type: string
              example: '2022'
              maxLength: 35
            default_sequence:
              type: integer
              example: 1
            current_invoice_number:
              type: integer
              example: 0
            current_invoice_sequence_id:
              type: integer
              example: 146090
            current_invoice_validation_code:
              type: string
              example: ABCD1230
            current_invoice_receipt_number:
              type: integer
              example: 0
            current_invoice_receipt_sequence_id:
              type: integer
              example: 146092
            current_invoice_receipt_validation_code:
              type: string
              example: ABCD1231
            current_simplified_invoice_number:
              type: integer
              example: 0
            current_simplified_invoice_sequence_id:
              type: integer
              example: 146091
            current_simplified_invoice_validation_code:
              type: string
              example: ABCD1232
            current_credit_note_number:
              type: integer
              example: 0
            current_credit_note_sequence_id:
              type: integer
              example: 146095
            current_credit_note_validation_code:
              type: string
              example: ABCD1233
            current_debit_note_number:
              type: integer
              example: 0
            current_debit_note_sequence_id:
              type: integer
              example: 146094
            current_debit_note_validation_code:
              type: string
              example: ABCD1234
            current_receipt_number:
              type: integer
              example: 0
            current_receipt_sequence_id:
              type: integer
              example: 146093
            current_receipt_validation_code:
              type: string
              example: ABCD1235
            current_shipping_number:
              type: integer
              example: 0
            current_shipping_sequence_id:
              type: integer
              example: 146104
            current_shipping_validation_code:
              type: string
              example: ABCD1236
            current_transport_number:
              type: integer
              example: 0
            current_transport_sequence_id:
              type: integer
              example: 146106
            current_transport_validation_code:
              type: string
              example: ABCD1237
            current_devolution_number:
              type: integer
              example: 0
            current_devolution_sequence_id:
              type: integer
              example: 146105
            current_devolution_validation_code:
              type: string
              example: ABCD1238
            current_proforma_number:
              type: integer
              example: 0
            current_proforma_sequence_id:
              type: integer
              example: 146102
            current_proforma_validation_code:
              type: string
              example: ABCD1239
            current_quote_number:
              type: integer
              example: 0
            current_quote_sequence_id:
              type: integer
              example: 146101
            current_quote_validation_code:
              type: string
              example: ABCD1240
            current_fees_note_number:
              type: integer
              example: 0
            current_fees_note_sequence_id:
              type: integer
              example: 146103
            current_fees_note_validation_code:
              type: string
              example: N/A
            current_vat_moss_invoice_number:
              type: integer
              example: 0
            current_vat_moss_invoice_sequence_id:
              type: integer
              example: 146097
            current_vat_moss_invoice_validation_code:
              type: string
              example: N/A
            current_vat_moss_credit_note_number:
              type: integer
              example: 0
            current_vat_moss_credit_note_sequence_id:
              type: integer
              example: 146098
            current_vat_moss_credit_note_validation_code:
              type: string
              example: N/A
            current_vat_moss_receipt_number:
              type: integer
              example: 0
            current_vat_moss_receipt_sequence_id:
              type: integer
              example: 146099
            current_vat_moss_receipt_validation_code:
              type: string
              example: N/A
    SequenceCreateRequest:
      type: object
      required:
        - sequence
      properties:
        sequence:
          type: object
          required:
            - serie
          properties:
            serie:
              type: string
              description: Series name
              example: '2023'
              minLength: 1
              maxLength: 35
            default_sequence:
              type: string
              description: >-
                If "1", this sequence is chosen as the default sequence. Other
                values are ignored.
              example: '1'
    Sequence006Response:
      type: object
      properties:
        errors:
          type: object
          properties:
            code:
              type: string
              example: '006'
            message:
              type: string
              example: The sequence doesn't exist.
    Sequence005Response:
      type: object
      properties:
        errors:
          type: object
          properties:
            code:
              type: string
              example: '005'
            message:
              type: string
              example: All sequences are registered.
    Sequence001Response:
      type: object
      properties:
        errors:
          type: object
          properties:
            code:
              type: string
              example: '001'
            message:
              type: string
              example: Sequence name not allowed.
    TaxesResponse:
      type: object
      properties:
        taxes:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 31554
              name:
                type: string
                example: IVA23
                maxLength: 255
              value:
                type: string
                example: '23.0'
              region:
                type: string
                example: PT
              code:
                type: string
                example: NOR
                maxLength: 255
              default_tax:
                type: integer
                example: 1
                description: 1 if it is the default tax, 0 otherwise
    TaxesGetResponse:
      type: object
      properties:
        tax:
          type: object
          properties:
            id:
              type: integer
              example: 31540
            name:
              type: string
              example: IVA23
              maxLength: 255
            value:
              type: string
              example: '23.0'
            region:
              type: string
              example: PT
            code:
              type: string
              example: NOR
              maxLength: 255
            default_tax:
              type: integer
              example: 1
              description: 1 if it is the default tax, 0 otherwise
    TaxesCreateRequest:
      type: object
      required:
        - tax
      properties:
        tax:
          type: object
          required:
            - name
            - value
          properties:
            name:
              type: string
              description: Tax name
              example: IVA23
              maxLength: 255
            value:
              type: string
              description: Tax value (%)
              example: '23.0'
            region:
              type: string
              description: >
                Tax region. Required to export SAF-T PT.


                Must be one of: `PT`, `PT-AC`, `PT-MA`, `Desconhecido`, or
                country codes.
              example: PT
            code:
              type: string
              description: >
                Tax code.


                Must be one of: `NOR` (Normal), `INT` (Intermediate), `RED`
                (Reduced), `OUT` (Other), `ISE` (Exempt).


                Not validated server-side; if left blank it defaults to `NOR`.
              enum:
                - NOR
                - INT
                - RED
                - OUT
                - ISE
              example: NOR
            default_tax:
              type: integer
              description: If "1", the tax is chosen as the default tax on your account.
              example: 1
    422UpdateTaxes:
      type: object
      properties:
        base:
          type: array
          items:
            type: string
          example:
            - Tax region is empty
    422CreateTaxes:
      type: object
      properties:
        name:
          type: array
          items:
            type: string
          example:
            - is not available.
    ClientsListAll:
      type: object
      properties:
        clients:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 89895780
              name:
                type: string
                example: Client Name
                maxLength: 100
              code:
                type:
                  - string
                  - 'null'
                example: '12345'
                maxLength: 255
                description: >-
                  Maximum length is the database default, not an enforced
                  business rule.
              email:
                type:
                  - string
                  - 'null'
                example: foo@bar.com
                maxLength: 254
              language:
                type:
                  - string
                  - 'null'
                example: pt
                maxLength: 255
                description: >-
                  Maximum length is the database default, not an enforced
                  business rule.
              address:
                type:
                  - string
                  - 'null'
                example: Avenida da República, Lisboa
                description: No enforced character limit (text column).
              city:
                type:
                  - string
                  - 'null'
                example: Lisboa
                maxLength: 255
                description: >-
                  Maximum length is the database default, not an enforced
                  business rule.
              postal_code:
                type:
                  - string
                  - 'null'
                example: 1050-555
                maxLength: 255
                description: >-
                  Maximum length is the database default, not an enforced
                  business rule.
              country:
                type:
                  - string
                  - 'null'
                example: Portugal
                maxLength: 255
                description: >-
                  Omitted entirely for clients with no country set. Maximum
                  length is the database default, not an enforced business rule.
              fiscal_id:
                type:
                  - string
                  - 'null'
                example: '508025338'
                maxLength: 255
                description: >-
                  Maximum length is the database default, not an enforced
                  business rule.
              website:
                type:
                  - string
                  - 'null'
                example: www.invoicexpress.com
                maxLength: 60
              phone:
                type:
                  - string
                  - 'null'
                example: '213456789'
                maxLength: 20
              fax:
                type:
                  - string
                  - 'null'
                example: '213456788'
                maxLength: 20
              preferred_contact:
                type: object
                description: May be an empty object when no preferred contact is set.
                properties:
                  name:
                    type:
                      - string
                      - 'null'
                    example: Bruce Norris
                    maxLength: 255
                    description: >-
                      Contact-level name has no length validation, unlike the
                      client-level `name` (max 100); the limit shown is the
                      database default.
                  email:
                    type:
                      - string
                      - 'null'
                    example: email@invoicexpress.com
                    maxLength: 255
                    description: >-
                      Contact-level email allows one character more than the
                      client-level `email` (max 254).
                  phone:
                    type:
                      - string
                      - 'null'
                    example: '213456789'
                    maxLength: 255
                    description: >-
                      Contact-level phone has no length validation, unlike the
                      client-level `phone` (max 20); the limit shown is the
                      database default.
                  mobile:
                    type:
                      - string
                      - 'null'
                    example: null
                    minLength: 4
                    maxLength: 14
                    description: Digits only (4-14). Validated against /\A\d{4,14}\z/.
              observations:
                type:
                  - string
                  - 'null'
                example: null
                description: No enforced character limit (text column).
              send_options:
                type:
                  - integer
                  - 'null'
                example: 1
        pagination:
          type: object
          properties:
            total_entries:
              type: integer
              example: 6
            current_page:
              type: integer
              example: 1
            total_pages:
              type: integer
              example: 1
            per_page:
              type: integer
              example: 10
    ClientsGetResponse:
      type: object
      properties:
        client:
          type: object
          properties:
            id:
              type: integer
              example: 196601767
            name:
              type: string
              example: Ricardo Pereira
              maxLength: 100
            code:
              type:
                - string
                - 'null'
              example: null
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            language:
              type:
                - string
                - 'null'
              example: pt
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            email:
              type:
                - string
                - 'null'
              example: someone@example.com
              maxLength: 254
            address:
              type:
                - string
                - 'null'
              example: Lisbon
              description: No enforced character limit (text column).
            city:
              type:
                - string
                - 'null'
              example: Lisbon
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            postal_code:
              type:
                - string
                - 'null'
              example: 1750-455
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            fiscal_id:
              type:
                - string
                - 'null'
              example: '508025338'
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            website:
              type:
                - string
                - 'null'
              example: www.invoicexpress.com
              maxLength: 60
            country:
              type:
                - string
                - 'null'
              example: Portugal
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            phone:
              type:
                - string
                - 'null'
              example: '2313423424'
              maxLength: 20
            fax:
              type:
                - string
                - 'null'
              example: '2313423425'
              maxLength: 20
            preferred_contact:
              type: object
              description: May be an empty object when no preferred contact is set.
              properties:
                name:
                  type:
                    - string
                    - 'null'
                  example: Ricardo Pereira
                  maxLength: 255
                  description: >-
                    Contact-level name has no length validation, unlike the
                    client-level `name` (max 100); the limit shown is the
                    database default.
                email:
                  type:
                    - string
                    - 'null'
                  example: someone@example.com
                  maxLength: 255
                  description: >-
                    Contact-level email allows one character more than the
                    client-level `email` (max 254).
                phone:
                  type:
                    - string
                    - 'null'
                  example: '2233442233'
                  maxLength: 255
                  description: >-
                    Contact-level phone has no length validation, unlike the
                    client-level `phone` (max 20); the limit shown is the
                    database default.
                mobile:
                  type:
                    - string
                    - 'null'
                  example: null
                  minLength: 4
                  maxLength: 14
                  description: Digits only (4-14). Validated against /\A\d{4,14}\z/.
            observations:
              type:
                - string
                - 'null'
              example: null
              description: No enforced character limit (text column).
            open_account_link:
              type: string
              example: >-
                https://www.app.invoicexpress.com/suppliers/1f7bba947948c50e04af20d329db5bc67c38cf89
            send_options:
              type:
                - integer
                - 'null'
              example: 1
            payment_days:
              type:
                - integer
                - 'null'
              example: 0
            tax_exemption_code:
              type:
                - string
                - 'null'
              example: M00
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
    ClientRequest:
      type: object
      required:
        - client
      properties:
        client:
          type: object
          required:
            - name
            - code
          properties:
            name:
              type: string
              example: Client Name
              maxLength: 100
            code:
              type: string
              example: '12345'
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            email:
              type: string
              example: foo@bar.com
              maxLength: 254
            language:
              type: string
              enum:
                - en
                - pt
                - es
              example: pt
            address:
              type: string
              example: Avenida da República, Lisboa
              description: No enforced character limit (text column).
            city:
              type: string
              example: Lisboa
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            postal_code:
              type: string
              example: 1050-555
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            country:
              type: string
              example: Portugal
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            fiscal_id:
              type: string
              example: '508025338'
              maxLength: 255
              description: >-
                Maximum length is the database default, not an enforced business
                rule.
            website:
              type: string
              example: www.invoicexpress.com
              maxLength: 60
            phone:
              type: string
              example: '213456789'
              maxLength: 20
            fax:
              type: string
              example: '213456788'
              maxLength: 20
            preferred_contact:
              type: object
              description: The preferred contact details.
              properties:
                name:
                  type: string
                  example: Bruce Norris
                  maxLength: 255
                  description: >-
                    Contact-level name has no length validation, unlike the
                    client-level `name` (max 100); the limit shown is the
                    database default.
                email:
                  type: string
                  example: email@invoicexpress.com
                  maxLength: 255
                  description: >-
                    Contact-level email allows one character more than the
                    client-level `email` (max 254).
                phone:
                  type: string
                  example: '213456789'
                  maxLength: 255
                  description: >-
                    Contact-level phone has no length validation, unlike the
                    client-level `phone` (max 20); the limit shown is the
                    database default.
            observations:
              type: string
              example: Observations
              description: No enforced character limit (text column).
            send_options:
              type: string
              enum:
                - '1'
                - '2'
                - '3'
              example: '1'
    ClientsInvoicesResponse:
      type: object
      properties:
        invoices:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 541793
              status:
                type: string
                example: final
              cancel_reason:
                type: string
                description: >-
                  Only present once the document has been canceled — carries the
                  message supplied to change-state.
                example: document was duplicated
              archived:
                type: boolean
                example: true
              type:
                type: string
                example: Invoice
              sequence_number:
                type: string
                example: 28/A
              inverted_sequence_number:
                type: string
                example: A/28
              date:
                type: string
                example: 27/06/2017
              due_date:
                type: string
                example: 27/06/2017
              reference:
                type:
                  - string
                  - 'null'
                example: foo
              observations:
                type:
                  - string
                  - 'null'
                example: foo
              retention:
                type:
                  - string
                  - 'null'
                example: null
              atcud:
                type: string
                example: N/D
              permalink:
                type: string
                example: https://web.invoicexpress.com/documents/...
              saft_hash:
                type: string
                description: Only present once the document has been finalized.
                example: Tdik
              sum:
                type: number
                example: 1
              discount:
                type:
                  - number
                  - 'null'
                example: 0
              before_taxes:
                type: number
                example: 1
              taxes:
                type: number
                example: 0.07
              total:
                type: number
                example: 1.07
              currency:
                type: string
                example: Euro
              client:
                type: object
                properties:
                  id:
                    type: integer
                    example: 1310176
                  name:
                    type: string
                    example: John
                  email:
                    type:
                      - string
                      - 'null'
                    example: john@example.com
                  address:
                    type:
                      - string
                      - 'null'
                    example: Avenida da República, Lisboa
                  postal_code:
                    type:
                      - string
                      - 'null'
                    example: 1050-555
                  city:
                    type:
                      - string
                      - 'null'
                    example: Lisboa
                  fiscal_id:
                    type:
                      - string
                      - 'null'
                    example: '508025338'
                  country:
                    type: string
                    example: Portugal
              items:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      example: ' iPhone '
                    description:
                      type:
                        - string
                        - 'null'
                      example: foo
                    unit_price:
                      type: string
                      example: '1.0'
                    unit:
                      type:
                        - string
                        - 'null'
                      example: foo
                    quantity:
                      type: string
                      example: '1.0'
                    tax:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 31597
                        name:
                          type: string
                          example: IVA7
                        value:
                          type: number
                          example: 7
                    discount:
                      type: number
                      example: 0
                    subtotal:
                      type: number
                      example: 1
                    tax_amount:
                      type: number
                      example: 0.07
                    discount_amount:
                      type: number
                      example: 0
                    total:
                      type: number
                      example: 1.07
              sequence_id:
                type:
                  - integer
                  - 'null'
                description: Absent while the document is still a draft.
                example: 12345
              tax_exemption:
                type: string
                description: Absent unless a tax exemption applies.
                example: M01
        pagination:
          type: object
          properties:
            total_entries:
              type: integer
              example: 6
            current_page:
              type: integer
              example: 1
            total_pages:
              type: integer
              example: 1
            per_page:
              type: integer
              example: 10
    ClientsInvoiceFilterRequest:
      type: object
      properties:
        filter:
          type: object
          description: Filters to apply on the list
          properties:
            status:
              type: array
              items:
                type: string
              example:
                - final
            by_type:
              type: array
              items:
                type: string
              example:
                - Invoice
            archived:
              type: array
              items:
                type: string
              example:
                - non_archived
    422CreateClients:
      type: object
      properties:
        errors:
          type: array
          description: Lista de mensagens de erro.
          items:
            type: string
          example:
            - Name can't be blank
    ItemsListAll:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 402322
              name:
                type: string
                example: Large
                maxLength: 60
              description:
                type:
                  - string
                  - 'null'
                example: foo
                maxLength: 200
              unit_price:
                type: string
                example: '24.3902'
              unit:
                type: string
                example: service
                description: >-
                  One of: `hour`, `day`, `month`, `unit`, `service`, `tax`,
                  `other`, `product`, `article`.
              tax:
                type: object
                properties:
                  name:
                    type: string
                    example: IVA23
                  value:
                    type: string
                    example: '23.0'
                  comment:
                    type: string
                    example: tax value:23.0%
    ItemsGetResponse:
      type: object
      properties:
        item:
          type: object
          properties:
            id:
              type: integer
              example: 402321
            name:
              type: string
              example: Medium
              maxLength: 60
            description:
              type:
                - string
                - 'null'
              example: foo
              maxLength: 200
            unit_price:
              type: string
              example: '16.2602'
            unit:
              type: string
              example: service
              description: >-
                One of: `hour`, `day`, `month`, `unit`, `service`, `tax`,
                `other`, `product`, `article`.
            tax:
              type: object
              properties:
                name:
                  type: string
                  example: IVA23
                value:
                  type: string
                  example: '23.0'
                comment:
                  type: string
                  example: tax value:23.0%
    ItemRequest:
      type: object
      required:
        - item
      properties:
        item:
          type: object
          required:
            - name
            - description
            - unit_price
          properties:
            name:
              type: string
              example: Item name
              maxLength: 60
              description: >-
                Item name. Values longer than 60 characters are rejected with
                HTTP 422 — they are not truncated.
            description:
              type: string
              example: Item description
              maxLength: 200
              description: >-
                Item description. Values longer than 200 characters are rejected
                with HTTP 422 — they are not truncated.
            unit_price:
              type: number
              example: 9.99
            unit:
              type: string
              example: service
              description: >-
                One of: `hour`, `day`, `month`, `unit`, `service`, `tax`,
                `other`, `product`, `article`.
            tax:
              type: object
              properties:
                name:
                  type: string
                  example: IVA23
    422UpdateItems:
      type: object
      properties:
        errors:
          type: array
          description: Lista de objetos contendo mensagens de erro detalhadas.
          items:
            type: object
            properties:
              error:
                type: string
          example:
            - error: Name is not available.
            - error: >-
                Name can't be changed because it is already associated with
                invoices
            - error: >-
                Price is not valid. Check the decimal mark and if you are
                inserting only numbers.
    422CreateItems:
      type: object
      properties:
        errors:
          type: array
          description: Lista de objetos contendo mensagens de erro detalhadas.
          items:
            type: object
            properties:
              error:
                type: string
          example:
            - error: Price is a required field
            - error: RRP is a required field
            - error: Name is a required field
    ClientBalanceResponse:
      type: object
      properties:
        currency:
          type: object
          properties:
            symbol:
              type: string
              example: €
            code:
              type: string
              example: EUR
        initial_balance:
          type: object
          properties:
            value:
              type: number
              example: 0
            created_at:
              type: string
              format: date
              example: '1970-01-01'
            observation:
              type:
                - string
                - 'null'
              example: null
        balance:
          type: object
          properties:
            with_vat:
              type: number
              example: 0
        overdue_balance:
          type: object
          properties:
            with_vat:
              type: number
              example: 0
        remaining_balance:
          type: object
          properties:
            total:
              type: number
              example: 0
            value:
              type: number
              example: 0
    InitialBalanceRequest:
      type: object
      required:
        - initial_balance
      properties:
        initial_balance:
          type: object
          required:
            - value
            - date
          properties:
            value:
              type: number
              example: 123.45
            date:
              type: string
              example: '2023-05-19'
            observation:
              type:
                - string
                - 'null'
              example: null
    RegularizationListResponse:
      type: object
      properties:
        regularization:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 1
              number:
                type: string
                example: NR00000001
              value:
                type: number
                example: 123.45
              date:
                type: string
                format: date
                example: '2023-05-19'
              observation:
                type:
                  - string
                  - 'null'
                example: null
        pagination:
          type: object
          properties:
            total_entries:
              type: integer
              example: 1
            current_page:
              type: integer
              example: 1
            total_pages:
              type: integer
              example: 1
            per_page:
              type: integer
              example: 10
    RegularizationRequest:
      type: object
      required:
        - regularization
      properties:
        regularization:
          type: object
          required:
            - value
            - date
          properties:
            value:
              type: number
              example: 123.45
            date:
              type: string
              example: '2023-08-24'
            observation:
              type:
                - string
                - 'null'
              example: null
    TreasuryMovementRequest:
      type: object
      required:
        - treasury_movement
      properties:
        treasury_movement:
          type: object
          required:
            - value
            - movement_type
            - date
          properties:
            value:
              type: number
              example: 123.45
            movement_type:
              type: string
              enum:
                - Reimbursement
                - Payment
              example: Reimbursement
            payment_method:
              type: string
              description: >-
                Treasury movement can be CC “Cartão de crédito”, CD “Cartão de
                débito”, CH “Cheque bancário”, CI “Crédito documentário
                internacional”, CO “Cheque ou cartão oferta”, CS “Compensação de
                saldos de conta corrente”, DE “Dinheiro electrónico”, LC “Letra
                comercial”, MB “Referências de pagamento para Multibanco”, NU
                “Numerário”, or “Outros meios aqui não assinalados”, PR “Permuta
                de bens”, TB “Transferência bancária ou débito direto
                autorizado”, TR “Ticket restaurante”
              example: MB
            date:
              type: string
              example: '2023-04-28'
            serie:
              type: string
              example: '2023'
            observation:
              type: string
              example: Payment observation
    TreasuryMovementResponse:
      type: object
      properties:
        treasury_movement:
          type: object
          properties:
            value:
              type: number
              example: 123.45
            movement_type:
              type: string
              example: Reimbursement
            payment_method:
              type: string
              example: MB
            date:
              type: string
              format: date
              example: '2023-04-28'
            serie:
              type: string
              example: '2023'
            observation:
              type:
                - string
                - 'null'
              example: null
    InitialBalanceResponse:
      type: object
      properties:
        initial_balance:
          type: object
          properties:
            value:
              type: number
              example: 123.45
            date:
              type: string
              format: date
              example: '2023-05-19'
            observation:
              type:
                - string
                - 'null'
              example: null
    404Clients:
      type: object
      properties:
        errors:
          type: array
          description: Lista de erros retornada quando o cliente não é encontrado.
          items:
            type: object
            properties:
              error:
                type: string
          example:
            - error: Client not found
    422InitialBalance:
      type: object
      properties:
        errors:
          type: array
          description: Lista de erros de validação do saldo inicial.
          items:
            type: object
            properties:
              error:
                type: string
          example:
            - error: Date can't be blank
    422CreateRegularization:
      type: object
      properties:
        errors:
          type: array
          description: Lista de erros de validação ao criar uma regularização.
          items:
            type: object
            properties:
              error:
                type: string
          example:
            - error: >-
                The regularization amount must be less than or equal to the
                remaining balance
            - error: Date can't be blank
    RegularizationCreateResponse:
      type: object
      properties:
        regularization:
          type: object
          properties:
            id:
              type: integer
              example: 1
            number:
              type: string
              example: NR00000001
            value:
              type: number
              example: 123.45
            date:
              type: string
              format: date
              example: '2023-05-19'
            observation:
              type:
                - string
                - 'null'
              example: null
    422Treasury:
      type: object
      properties:
        errors:
          type: array
          description: Lista de erros de validação num movimento de tesouraria.
          items:
            type: object
            properties:
              error:
                type: string
          example:
            - error: 'Validation failed: Value is not a number'
    InvoiceGetResponse:
      type: object
      description: >-
        Returned by the create, get, update, and change-state endpoints for
        `{invoices-type}` documents. The parent key shown here as `invoice` is
        only an example — the actual key always matches the singular of the
        requested `{invoices-type}` path parameter: `invoice` for `invoices`,
        `invoice_receipt` for `invoice_receipts`, `simplified_invoice` for
        `simplified_invoices`, `credit_note` for `credit_notes`, and
        `debit_note` for `debit_notes`. The nested object shape is identical in
        every case.
      properties:
        invoice:
          $ref: '#/components/schemas/FullDocumentObject'
    EstimateGetResponse:
      type: object
      properties:
        quote:
          type: object
          properties:
            id:
              type: integer
              example: 541791
            status:
              type: string
              example: final
            archived:
              type: boolean
              example: false
            type:
              type: string
              example: Quote
            sequence_number:
              type: string
              example: 1/A
            inverted_sequence_number:
              type: string
              example: A/1
            atcud:
              type: string
              example: ABCD1234-1
            date:
              type: string
              example: 12/06/2017
            due_date:
              type: string
              example: 12/06/2017
            reference:
              type:
                - string
                - 'null'
              example: null
              maxLength: 255
            observations:
              type:
                - string
                - 'null'
              example: foo
              description: No enforced character limit (text column).
            retention:
              type:
                - string
                - 'null'
              example: null
            permalink:
              type: string
              example: >-
                https://web.invoicexpress.com/documents/541791f16ae45a73b703c684a221ef198c10020f3d56a1
            saft_hash:
              type: string
              example: NfTN
              description: Server-generated. No enforced character limit (text column).
            sum:
              type: number
              example: 10
            discount:
              type: number
              example: 0
            before_taxes:
              type: number
              example: 10
            taxes:
              type: number
              example: 2.3
            total:
              type: number
              example: 12.3
            currency:
              type: string
              example: Euro
            sequence_id:
              type:
                - integer
                - 'null'
              example: 12345
            tax_exemption:
              type: string
              example: M01
              maxLength: 255
            client:
              $ref: '#/components/schemas/InvoiceClient'
            items:
              type: array
              items:
                $ref: '#/components/schemas/InvoiceItem'
    InvoiceListAllResponse:
      type: object
      properties:
        invoices:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 541793
              status:
                type: string
                example: final
              cancel_reason:
                type: string
                description: >-
                  Only present once the document has been canceled — carries the
                  message supplied to change-state. No enforced character limit
                  (text column).
                example: document was duplicated
              archived:
                type: boolean
                example: true
              type:
                type: string
                example: Invoice
              sequence_number:
                type: string
                example: A/28
              inverted_sequence_number:
                type: string
                example: A/28
              atcud:
                type: string
                example: ABCD1234-28
              date:
                type: string
                description: dd/mm/yyyy
                example: 27/06/2017
              due_date:
                type: string
                description: dd/mm/yyyy
                example: 27/06/2017
              reference:
                type:
                  - string
                  - 'null'
                example: fb30
                maxLength: 255
              observations:
                type:
                  - string
                  - 'null'
                example: foo
                description: No enforced character limit (text column).
              retention:
                type:
                  - string
                  - 'null'
                example: null
              permalink:
                type: string
                example: >-
                  https://web.invoicexpress.com/documents/541793e1ab2ebd5c06def40c346ffbe0ff2b463eb1c0f0
              saft_hash:
                type: string
                example: Tdik
                description: Server-generated. No enforced character limit (text column).
              sum:
                type: number
                example: 1
              discount:
                type: number
                example: 0
              before_taxes:
                type: number
                example: 1
              taxes:
                type: number
                example: 0.07
              total:
                type: number
                example: 1.07
              currency:
                type: string
                example: Euro
              sequence_id:
                type:
                  - integer
                  - 'null'
                example: 12345
              tax_exemption:
                type: string
                example: M01
                maxLength: 255
              client:
                type: object
                properties:
                  id:
                    type: integer
                    example: 1310176
                  name:
                    type: string
                    example: John
                  code:
                    type:
                      - string
                      - 'null'
                    example: CLI-001
                  email:
                    type:
                      - string
                      - 'null'
                    example: john@example.com
                  address:
                    type:
                      - string
                      - 'null'
                    example: Avenida da República, Lisboa
                  postal_code:
                    type:
                      - string
                      - 'null'
                    example: 1050-555
                  city:
                    type:
                      - string
                      - 'null'
                    example: Lisboa
                  fiscal_id:
                    type:
                      - string
                      - 'null'
                    example: '508025338'
                  country:
                    type: string
                    example: Portugal
              items:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      example: ' iPhone '
                    description:
                      type:
                        - string
                        - 'null'
                      example: foo
                    unit_price:
                      type: string
                      example: '1.0'
                    unit:
                      type:
                        - string
                        - 'null'
                      example: foo
                    quantity:
                      type: string
                      example: '1.0'
                    discount:
                      type: number
                      example: 0
                    subtotal:
                      type: number
                      example: 1
                    tax_amount:
                      type: number
                      example: 0.07
                    discount_amount:
                      type: number
                      example: 0
                    total:
                      type: number
                      example: 1.07
                    tax:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 31597
                        name:
                          type: string
                          example: IVA7
                        value:
                          type: number
                          example: 7
        pagination:
          $ref: '#/components/schemas/Pagination'
    PaymentResponse:
      type: object
      properties:
        receipt:
          $ref: '#/components/schemas/FullDocumentObject'
    FullDocumentObject:
      type: object
      properties:
        id:
          type: integer
          example: 2137287
        status:
          type: string
          example: final
        archived:
          type: boolean
          example: false
        type:
          type: string
          example: Invoice
        sequence_number:
          type: string
          example: 6/G
        inverted_sequence_number:
          type: string
          example: G/6
        atcud:
          type: string
          example: ABCD1234-6
        sequence_id:
          type:
            - integer
            - 'null'
          example: 12345
        tax_exemption:
          type: string
          example: M01
          maxLength: 255
        date:
          type: string
          example: 04/08/2016
        due_date:
          type: string
          example: 19/08/2016
        reference:
          type:
            - string
            - 'null'
          example: ref123
          maxLength: 255
        observations:
          type:
            - string
            - 'null'
          example: Observations
          description: No enforced character limit (text column).
        retention:
          type:
            - string
            - 'null'
          example: null
        cancel_reason:
          type:
            - string
            - 'null'
          description: >-
            Present after the document has been canceled. No enforced character
            limit (text column).
          example: API test cancellation
        permalink:
          type: string
          example: https://web.invoicexpress.com/documents/...
        saft_hash:
          type: string
          example: J4ay
          description: Server-generated. No enforced character limit (text column).
        sum:
          type: number
          example: 24.39
        discount:
          type:
            - number
            - 'null'
          example: 0
        before_taxes:
          type: number
          example: 24.39
        taxes:
          type: number
          example: 5.61
        total:
          type: number
          example: 30
        currency:
          type: string
          example: Euro
        client:
          $ref: '#/components/schemas/InvoiceClient'
        items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceItem'
        mb_reference:
          $ref: '#/components/schemas/MbReference'
    InvoiceClient:
      type: object
      properties:
        id:
          type: integer
          example: 628535
        name:
          type: string
          example: John Doe
        code:
          type: string
          example: C1
        country:
          type: string
          example: Portugal
        email:
          type: string
          example: john@example.com
    InvoiceItem:
      type: object
      properties:
        name:
          type: string
          example: Product A
        description:
          type:
            - string
            - 'null'
          example: Big Product
        unit_price:
          type: string
          example: '100.0'
        quantity:
          type: string
          example: '1.0'
        unit:
          type: string
          example: un
        discount:
          type: number
          example: 0
        tax:
          type: object
          properties:
            id:
              type: integer
              example: 756700
            name:
              type: string
              example: IVA23
            value:
              type: number
              example: 23
        subtotal:
          type: number
          example: 100
        tax_amount:
          type: number
          example: 23
        discount_amount:
          type: number
          example: 0
        total:
          type: number
          example: 123
    MbReference:
      type: object
      properties:
        entity:
          type: string
          example: '10611'
        reference:
          type: string
          example: 123 456 789
        value:
          type: number
          example: 123.45
    PdfResponse:
      type: object
      properties:
        output:
          type: object
          properties:
            pdfUrl:
              type: string
              example: url.pdf
    QrCodeResponse:
      type: object
      properties:
        qr_code:
          type: object
          properties:
            url:
              type: string
              example: url.png
    Pagination:
      type: object
      properties:
        total_entries:
          type: integer
          example: 50
        per_page:
          type: integer
          example: 20
        current_page:
          type: integer
          example: 1
        total_pages:
          type: integer
          example: 3
    422CreateAccount:
      type: object
      properties:
        errors:
          description: >-
            An array of validation error objects, or a plain array of strings
            (e.g. ["Param is missing"]) if a required top-level param is missing
            entirely.
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  error:
                    type: string
                    example: Owner Owner is invalid
            - type: array
              items:
                type: string
              example:
                - Param is missing
    422UpdateAccount:
      type: array
      items:
        type: string
      example:
        - fiscal_id
        - is invalid
    422AlreadyUser:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              error:
                type: string
                example: Terms and Conditions should be accepted
    422AtCommunication:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              error:
                type: string
          example:
            - error: The field communication_type can't be blank
            - error: The field at_subuser has an incorrect size
    422CreateInvoice:
      type: object
      properties:
        errors:
          type: object
          properties:
            error:
              type: string
              example: undefined method `match' for 1:Integer
    409CreateInvoice:
      type: object
      properties:
        reason:
          type: string
          example: >-
            There's an ongoing document creation with the provided UID
            UUID41237123189981ddajkls23478y
    422UpdateInvoices:
      type: object
      properties:
        errors:
          type: object
          properties:
            error:
              type: string
              example: Elemento client não fornecido
    404Documents:
      type: object
      properties:
        errors:
          type: object
          properties:
            error:
              type: string
              example: Document not found
    422ChangeState:
      type: object
      properties:
        errors:
          type: object
          properties:
            error:
              type: string
              example: 'CantHandle: 1 for Invoice'
    202QRCode:
      type: object
      properties:
        qr_code:
          type: object
          properties:
            message:
              type: string
              example: QR Code is being generated
    404QRCode:
      type: object
      properties:
        error:
          type: string
          example: No document with ID 24563387 was found in this account
    422QRCode:
      type: object
      properties:
        error:
          type: string
          example: >-
            Document with ID 248920464 is still in draft. QR Codes are only
            available for final, canceled or settled documents.
    200RelatedDocuments:
      type: object
      properties:
        documents:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 541793
              status:
                type: string
                example: final
              archived:
                type: boolean
                example: true
              type:
                type: string
                example: Invoice
              sequence_number:
                type: string
                example: 28/A
              inverted_sequence_number:
                type: string
                example: A/28
              atcud:
                type: string
                example: ABCD1234-28
              date:
                type: string
                example: 27/06/2017
              due_date:
                type: string
                example: 27/06/2017
              reference:
                type:
                  - string
                  - 'null'
                example: foo
                maxLength: 255
              observations:
                type:
                  - string
                  - 'null'
                example: foo
                description: No enforced character limit (text column).
              retention:
                type:
                  - string
                  - 'null'
                example: null
              cancel_reason:
                type:
                  - string
                  - 'null'
                description: >-
                  Present after the document has been canceled. No enforced
                  character limit (text column).
                example: API test cancellation
              permalink:
                type: string
                example: >-
                  https://web.invoicexpress.com/documents/541793e1ab2ebd5c06def40c346ffbe0ff2b463eb1c0f0
              saft_hash:
                type: string
                example: Tdik
                description: Server-generated. No enforced character limit (text column).
              sum:
                type: number
                example: 1
              discount:
                type:
                  - number
                  - 'null'
                example: 0
              before_taxes:
                type: number
                example: 1
              taxes:
                type: number
                example: 0.07
              total:
                type: number
                example: 1.07
              currency:
                type: string
                example: Euro
              sequence_id:
                type:
                  - integer
                  - 'null'
                example: 12345
              tax_exemption:
                type: string
                example: M01
                maxLength: 255
              client:
                type: object
                properties:
                  id:
                    type: integer
                    example: 1310176
                  name:
                    type: string
                    example: John
                  country:
                    type: string
                    example: Portugal
              items:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      example: ' iPhone '
                    description:
                      type: string
                      example: foo
                    unit_price:
                      type: string
                      example: '1.0'
                    unit:
                      type:
                        - string
                        - 'null'
                      example: foo
                    quantity:
                      type: string
                      example: '1.0'
                    discount:
                      type: number
                      example: 0
                    subtotal:
                      type: number
                      example: 1
                    tax_amount:
                      type: number
                      example: 0.07
                    discount_amount:
                      type: number
                      example: 0
                    total:
                      type: number
                      example: 1.07
                    tax:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 31597
                        name:
                          type: string
                          example: IVA7
                        value:
                          type: number
                          example: 7
    422GeneratePayment:
      type: array
      items:
        type: string
      example:
        - payment_mechanism
        - is invalid
    422CancelPayment:
      type: object
      properties:
        errors:
          type: object
          properties:
            error:
              type: string
              example: 'CantHandle: 1 for Invoice'
    EstimatesListAll:
      type: object
      properties:
        estimates:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 541791
              status:
                type: string
                example: final
              archived:
                type: boolean
                example: false
              type:
                type: string
                example: Quote
              sequence_number:
                type: string
                example: 1/A
              inverted_sequence_number:
                type: string
                example: A/1
              atcud:
                type: string
                example: ABCD1234-1
              date:
                type: string
                example: 12/06/2017
              due_date:
                type: string
                example: 12/06/2017
              reference:
                type:
                  - string
                  - 'null'
                example: foo
                maxLength: 255
              observations:
                type:
                  - string
                  - 'null'
                example: foo
                description: No enforced character limit (text column).
              retention:
                type:
                  - string
                  - 'null'
                example: null
              permalink:
                type: string
                example: >-
                  https://web.invoicexpress.com/documents/541791f16ae45a73b703c684a221ef198c10020f3d56a1
              saft_hash:
                type: string
                example: NfTN
                description: Server-generated. No enforced character limit (text column).
              sum:
                type: number
                example: 10
              discount:
                type: number
                example: 0
              before_taxes:
                type: number
                example: 10
              taxes:
                type: number
                example: 2.3
              total:
                type: number
                example: 12.3
              currency:
                type: string
                example: Euro
              sequence_id:
                type:
                  - integer
                  - 'null'
                example: 12345
              tax_exemption:
                type: string
                example: M01
                maxLength: 255
              client:
                type: object
                properties:
                  id:
                    type: integer
                    example: 1310176
                  name:
                    type: string
                    example: John
                  code:
                    type:
                      - string
                      - 'null'
                    example: CLI-001
                  email:
                    type:
                      - string
                      - 'null'
                    example: john@example.com
                  address:
                    type:
                      - string
                      - 'null'
                    example: Avenida da República, Lisboa
                  postal_code:
                    type:
                      - string
                      - 'null'
                    example: 1050-555
                  city:
                    type:
                      - string
                      - 'null'
                    example: Lisboa
                  fiscal_id:
                    type:
                      - string
                      - 'null'
                    example: '508025338'
                  country:
                    type: string
                    example: Portugal
              items:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      example: iPhone
                    description:
                      type:
                        - string
                        - 'null'
                      example: foo
                    unit_price:
                      type: string
                      example: '10.0'
                    unit:
                      type:
                        - string
                        - 'null'
                      example: foo
                    quantity:
                      type: string
                      example: '1.0'
                    discount:
                      type: number
                      example: 0
                    subtotal:
                      type: number
                      example: 10
                    tax_amount:
                      type: number
                      example: 2.3
                    discount_amount:
                      type: number
                      example: 0
                    total:
                      type: number
                      example: 12.3
                    tax:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 31567
                        name:
                          type:
                            - string
                            - 'null'
                          description: Null when the line has no tax assigned.
                          example: IVA23
                        value:
                          type: number
                          example: 23
        pagination:
          $ref: '#/components/schemas/Pagination'
    422SendEmail:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              error:
                type: string
                example: Email is a required field
    403SendEmail:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              error:
                type: string
                example: >-
                  Email service is disabled for your account. To activate it,
                  please contact us at support@invoicexpress.com.
    QueryParamns:
      type: object
      required:
        - type[]
        - status[]
        - non_archived
      properties:
        type[]:
          type: array
          items:
            type: string
            enum:
              - Invoice
              - InvoiceReceipt
              - CreditNote
              - DebitNote
              - Receipt
              - CashInvoice
          example:
            - Invoice
          description: Type(s) of document.
        status[]:
          type: array
          items:
            type: string
            enum:
              - draft
              - sent
              - settled
              - canceled
              - second_copy
              - deleted
          example:
            - sent
          description: Status(es) of document.
        non_archived:
          type: boolean
          example: true
          description: Show non-archived documents.
        archived:
          type: boolean
          description: Include archived docs
        text:
          type: string
          description: Filter by client/doc text
        reference:
          type: string
          description: Filter by reference
        date[from]:
          type: string
          description: Start date (dd/mm/yyyy)
        date[to]:
          type: string
          description: End date (dd/mm/yyyy)
        due_date[from]:
          type: string
          description: Due date start
        due_date[to]:
          type: string
          description: Due date end
        total_before_taxes[from]:
          type: number
          description: Min value
        total_before_taxes[to]:
          type: number
          description: Max value
        page:
          type: integer
          description: Page number
        per_page:
          type: integer
          description: Items per page
    DocumentClientRequest:
      type: object
      description: >-
        Client Details. To identify an existing client, send `id`, `code`, or
        `name` — not all three are required. Resolution priority: if `id` is
        sent and matches a client on the account, that client is used and
        `name`/`code` are ignored. Without `id`, if `code` matches an existing
        client, that client is used and `name` is not needed. Without an
        `id`/`code` match, `name` is used to find or create the client. Creating
        a brand-new client (no `id`/`code` match) still requires `name`; `code`
        is always optional and is never generated automatically by
        InvoiceXpress.
      properties:
        id:
          type: integer
          example: 1310176
          description: >-
            Internal client ID. Preferred way to identify an existing client —
            see schema description.
        name:
          type: string
          example: Client A
          maxLength: 100
        code:
          type: string
          example: CLI-001
          maxLength: 255
          description: Maximum length is the database default, not a business rule.
        email:
          type: string
          example: client@mail.com
          maxLength: 254
        address:
          type: string
          example: Street A
          description: No enforced character limit.
        city:
          type: string
          example: Lisbon
          maxLength: 255
          description: Maximum length is the database default, not a business rule.
        postal_code:
          type: string
          example: 1000-100
          maxLength: 255
          description: Maximum length is the database default, not a business rule.
        fiscal_id:
          type: string
          example: '500999888'
          maxLength: 255
          description: Maximum length is the database default, not a business rule.
        country:
          type: string
          example: Portugal
          maxLength: 255
          description: Maximum length is the database default, not a business rule.
        website:
          type: string
          example: www.client-a.com
          maxLength: 60
        phone:
          type: string
          example: '912345678'
          maxLength: 20
        fax:
          type: string
          example: '212345678'
          maxLength: 20
        observations:
          type: string
          example: VIP Client
          description: No enforced character limit.
    InvoiceTaxRequest:
      type: object
      properties:
        name:
          type: string
          example: IVA23
          maxLength: 255
          description: Maximum length is the database default, not a business rule.
    InvoiceItemRequest:
      type: object
      description: Line Item.
      required:
        - name
        - description
        - unit_price
        - quantity
      properties:
        name:
          type: string
          example: Consulting
          maxLength: 60
          description: >-
            Maximum 60 characters. The V2 API silently truncates longer values
            to 60; the V3 API rejects them with 422.
        description:
          type: string
          example: IT Services
          maxLength: 200
          description: >-
            Maximum 200 characters and 20 lines. The V2 API silently truncates
            longer values to 200; the V3 API rejects them with 422.
        unit_price:
          type: number
          example: 50
        quantity:
          type: number
          example: 2
        unit:
          type: string
          example: hour
          description: Not a length limit — constrained to a fixed set of unit values.
        discount:
          type: number
          example: 0
        tax:
          $ref: '#/components/schemas/InvoiceTaxRequest'
    GlobalDiscountRequest:
      type: object
      properties:
        value_type:
          type: string
          enum:
            - percentage
            - absolute
          example: percentage
        value:
          type: number
          example: 10
    CreateBody:
      type: object
      description: Invoice Body
      required:
        - date
        - due_date
        - client
        - items
      properties:
        date:
          type: string
          example: 22/11/2025
          description: dd/mm/yyyy
        due_date:
          type: string
          example: 22/12/2025
          description: dd/mm/yyyy
        reference:
          type: string
          example: PO-999
          maxLength: 255
        observations:
          type: string
          example: Services rendered
          description: No enforced character limit.
        retention:
          type: string
          example: '0'
        tax_exemption:
          type: string
          example: M00
          maxLength: 255
          description: >-
            Maximum length is the database default, not a business rule — the
            value is effectively an AT exemption code.
        sequence_id:
          type: string
          example: '123456'
        manual_sequence_number:
          type: string
          maxLength: 255
          description: Maximum length is the database default, not a business rule.
        client:
          $ref: '#/components/schemas/DocumentClientRequest'
        items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceItemRequest'
        mb_reference:
          type: string
          enum:
            - '0'
            - '1'
          example: '1'
        owner_invoice_id:
          type: integer
          example: 1049
        tax_exemption_reason:
          type: string
          example: M00
          maxLength: 210
          description: >-
            Maximum 210 characters. Enforced by model validation — longer values
            are rejected with 422 even though the underlying column would accept
            more.
        currency_code:
          type: string
          example: USD
        rate:
          type: string
          example: '1.10'
        plugin_id:
          type: string
          example: plugin_123
        global_discount:
          $ref: '#/components/schemas/GlobalDiscountRequest'
    EstimateFilters:
      type: object
      required:
        - type[]
        - status[]
        - non_archived
      properties:
        type[]:
          type: array
          items:
            type: string
            enum:
              - Quote
              - Proforma
              - FeesNote
          example:
            - Quote
          description: Type(s) of document.
        status[]:
          type: array
          items:
            type: string
            enum:
              - draft
              - sent
              - accepted
              - refused
              - canceled
              - deleted
          example:
            - sent
          description: Status(es) of document.
        non_archived:
          type: boolean
          example: true
          description: Show non-archived documents.
        archived:
          type: boolean
          description: Include archived docs
        text:
          type: string
          description: Filter by client/doc text
        due_date[from]:
          type: string
          description: Start date (dd/mm/yyyy)
        due_date[to]:
          type: string
          description: End date (dd/mm/yyyy)
        date[from]:
          type: string
          description: Start date (dd/mm/yyyy)
        date[to]:
          type: string
          description: End date (dd/mm/yyyy)
        total_before_taxes[from]:
          type: number
          description: Min value
        total_before_taxes[to]:
          type: number
          description: Max value
        page:
          type: integer
          description: Page number
        per_page:
          type: integer
          description: Items per page
    GuideQueryParamns:
      type: object
      required:
        - type[]
        - status[]
        - non_archived
      properties:
        text:
          type: string
          description: Search for guide, client or item details.
        type[]:
          type: array
          items:
            type: string
            enum:
              - Shipping
              - Transport
              - Devolution
          example:
            - Shipping
          description: Type(s) of document.
        status[]:
          type: array
          items:
            type: string
            enum:
              - draft
              - sent
              - canceled
              - second_copy
          example:
            - sent
          description: Status(es) of document.
        non_archived:
          type: boolean
          example: true
          description: Show non-archived documents.
        archived:
          type: boolean
          description: Include archived docs
        loaded_at[from]:
          type: string
          description: Date in format dd/mm/yyyy.
        loaded_at[to]:
          type: string
          description: Date in format dd/mm/yyyy.
        page:
          type: integer
          description: Page number
        per_page:
          type: integer
          description: Items per page
    GuideListAll:
      type: object
      properties:
        guides:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                example: 541797
              status:
                type: string
                example: final
              archived:
                type: boolean
                example: false
              type:
                type: string
                example: Shipping
              sequence_number:
                type: string
                example: 1/D
              inverted_sequence_number:
                type: string
                description: Only present once the guide has been finalized.
                example: D/1
              atcud:
                type: string
                example: ABCD1234-1
              date:
                type: string
                description: dd/mm/yyyy
                example: 13/07/2017
              due_date:
                type: string
                description: dd/mm/yyyy
                example: 13/07/2017
              reference:
                type:
                  - string
                  - 'null'
                example: null
                maxLength: 255
              observations:
                type:
                  - string
                  - 'null'
                example: null
                description: No enforced character limit (text column).
              retention:
                type:
                  - string
                  - 'null'
                example: null
              permalink:
                type: string
                example: >-
                  https://web.invoicexpress.com/documents/541797d75bbee48911934cbd4a4294946a324295f52b08
              saft_hash:
                type: string
                description: Only present once the guide has been finalized.
                example: vaDf
              sum:
                type: number
                example: 1
              discount:
                type: number
                example: 0
              before_taxes:
                type: number
                example: 1
              taxes:
                type: number
                example: 0.07
              total:
                type: number
                example: 1.07
              currency:
                type: string
                example: Euro
              loaded_at:
                type: string
                description: >-
                  dd/mm/yyyy. Note the single-guide endpoint returns this same
                  field with a time component (dd/mm/yyyy HH:mm:ss).
                example: 27/07/2026
              license_plate:
                type:
                  - string
                  - 'null'
                example: 11-AA-22
                maxLength: 255
                description: >-
                  255-character limit is the database column default, not an
                  explicit business rule.
              at_doc_code_id:
                type:
                  - string
                  - 'null'
                example: '999'
                maxLength: 255
                readOnly: true
                description: >-
                  Read-only. Written only by the AT gateway and never accepted
                  on input. The 255-character limit is the database column
                  default, not an explicit business rule.
              sequence_id:
                type:
                  - integer
                  - 'null'
                description: Only present once the guide has been finalized.
                example: 12345
              tax_exemption:
                type: string
                example: M01
              address_from:
                type: object
                properties:
                  country:
                    type: string
                    example: Portugal
                    maxLength: 255
                    description: >-
                      Not stored on the address itself — resolved through a
                      tax-location name lookup, falling back to Portugal.
                  postal_code:
                    type: string
                    example: 1050-083
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default on the
                      Address model, not an explicit business rule.
                  detail:
                    type: string
                    example: Avenida Duque D'Avila, 46 - 3ºA
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default on the
                      Address model, not an explicit business rule. Note the API
                      re-inserts line breaks roughly every 35 characters before
                      storing, so an input close to 255 characters can overflow
                      the column — keep well under the limit.
                  city:
                    type: string
                    example: Lisboa
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default on the
                      Address model, not an explicit business rule.
              address_to:
                type: object
                properties:
                  country:
                    type: string
                    example: Portugal
                    maxLength: 255
                    description: >-
                      Not stored on the address itself — resolved through a
                      tax-location name lookup, falling back to Portugal.
                  postal_code:
                    type: string
                    example: 4000-327
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default on the
                      Address model, not an explicit business rule.
                  detail:
                    type: string
                    example: Avenida dos Aliados
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default on the
                      Address model, not an explicit business rule. Note the API
                      re-inserts line breaks roughly every 35 characters before
                      storing, so an input close to 255 characters can overflow
                      the column — keep well under the limit.
                  city:
                    type: string
                    example: Porto
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default on the
                      Address model, not an explicit business rule.
              load_site:
                type:
                  - string
                  - 'null'
                description: >-
                  Flattened `address_from` (detail, postal code, city, country).
                  Null when not set.
                example: Avenida Duque D'Avila, 1050-083 Lisboa, Portugal
              delivery_site:
                type:
                  - string
                  - 'null'
                description: >-
                  Flattened `address_to` (detail, postal code, city, country).
                  Null when not set.
                example: Avenida dos Aliados, 4000-327 Porto, Portugal
              client:
                type: object
                description: >-
                  Only `id` and `name` are guaranteed; the remaining fields are
                  present when set on the client record.
                properties:
                  id:
                    type: integer
                    example: 1310176
                  name:
                    type: string
                    example: John
                    maxLength: 100
                  code:
                    type:
                      - string
                      - 'null'
                    example: CLI-001
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default, not an
                      explicit business rule.
                  email:
                    type:
                      - string
                      - 'null'
                    example: john@example.com
                    maxLength: 254
                  address:
                    type:
                      - string
                      - 'null'
                    example: Avenida da República, Lisboa
                    description: No enforced character limit (text column).
                  postal_code:
                    type:
                      - string
                      - 'null'
                    example: 1050-555
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default, not an
                      explicit business rule.
                  city:
                    type:
                      - string
                      - 'null'
                    example: Lisboa
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default, not an
                      explicit business rule.
                  fiscal_id:
                    type:
                      - string
                      - 'null'
                    example: '508025338'
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default, not an
                      explicit business rule.
                  country:
                    type: string
                    example: Portugal
                    maxLength: 255
                    description: >-
                      255-character limit is the database column default, not an
                      explicit business rule.
              items:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      example: iPhone
                      maxLength: 60
                      description: >-
                        Maximum 60 characters. V3 rejects a longer name with
                        HTTP 422; V2 accepts the request and silently truncates
                        the stored value to 60 characters.
                    description:
                      type:
                        - string
                        - 'null'
                      example: null
                      maxLength: 200
                      description: >-
                        Maximum 200 characters and 20 lines. V3 rejects a longer
                        description with HTTP 422; V2 accepts the request and
                        silently truncates the stored value to 200 characters.
                    unit_price:
                      type: string
                      example: '1.0'
                    unit:
                      type:
                        - string
                        - 'null'
                      example: service
                      description: >-
                        Restricted to a fixed set of unit values rather than
                        length-limited free text.
                    quantity:
                      type: string
                      example: '1.0'
                    tax:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 31597
                        name:
                          type: string
                          example: IVA7
                        value:
                          type: number
                          example: 7
                    discount:
                      type: number
                      example: 0
                    subtotal:
                      type: number
                      example: 1
                    tax_amount:
                      type: number
                      example: 0.07
                    discount_amount:
                      type: number
                      example: 0
                    total:
                      type: number
                      example: 1.07
        pagination:
          $ref: '#/components/schemas/Pagination'
    SaftExportParams:
      type: object
      required:
        - month
        - year
      properties:
        month:
          type: string
          description: The month for which you want to generate the SAF-T.
          example: '10'
        year:
          type: string
          description: The year for which you want to generate the SAF-T.
          example: '2017'
