API authentication
Obtain an access token in order to use the service
In order to use the API you must contact us and ask for authentication credentials.
The service auth is based on OAauth 2.
POST/oauth
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| grant_type | text | Only client_credentials allowed | Yes |
| client_secret | text | Provided by eFactura | Yes |
| client_id | text | Provided by eFactura | Yes |
Request
Headers
| Header | Value |
|---|---|
| Content-Type |
application/x-www-form-urlencoded
application/json
|
Response
Headers
| Header | Value |
|---|---|
| Content-Type |
application/json
|
Body
{
"access_token": "[the token]",
"expires_in": 86400,
"token_type": "Bearer",
"scope": null
}
Company
Company REST service. Add and retrieve (if authorized) companies.
POST /company
Create a company.
If the company already exists, you'll get a 409 Response Code, with the following body:
{
"authorization": {
"authorized": false,
},
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Conflict",
"status": 409,
"detail": "Resource was already added"
}
The authorization field contains information about missing authorization for this company. Note that this field can be false if (1) the company did not yet authorize you as a service provider in relation to efactura or (2) if the ANAF authorization is missing / expired for this company. In either case, you will have to obtain authorization for this company by using the company/authorization endpoint
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| code | text | An identifier issued by an official registrar that identifies the company as a legal entity or person. Unique identification code ( CUI for Romanian entities) |
YES |
| registrationName | text | The full formal name by which the company is registered in the national registry of legal entities or as a Taxable person or otherwise trades as a person or persons. |
YES |
| tradingName | text | A name by which the Company is known, other than registrationName name (also known as Business name). |
NO |
| address | text | Address |
NO |
| city | text | City |
NO |
| county | text | County |
NO |
| postalCode | text | Postal code |
NO |
| countryCode | text | Country code. Default is RO |
NO |
| vatCode | text | The company's VAT identifier.If empty it means that the company is not a VAT payer |
NO |
| legalForm | text | The company legal form (SRL, SA, SCA, PFA, II, IF, SCA, SCS, SNC) |
NO |
| tradeRegisterNumber | text | The trade register number. |
NO |
| socialCapital | text | Social capital of the company |
NO |
| dualistAdministration | boolean | Is the company administrated in a dualist way? |
NO |
| exciseCode | text | The company excise code |
NO |
| contact/name | text | The name of the contact person. |
NO |
| contact/email | text | An e-mail address for the contact point. |
NO |
| contact/phone | text | A phone number for the contact point. |
NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.e-factura-api.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.e-factura-api.v1+json
application/json |
| Authorization | Bearer [access_token] |
Body
{
"code": "[code]",
"vatCode": "[vat_code]",
"registrationName": "Lynch PLC",
"tradingName": "VonRueden-Aufderhar",
"address": "118 Matilde Coves East Delbert, GA 26552",
"city": "North Fabiolaville",
"countryCode": "RO",
"postalCode": "79733-9832",
"county": "vero",
"exciseCode": "in",
"tradeRegisterNumber": "Jxy\/827\/1980",
"legalForm": "SRL",
"socialCapital": "100000 EUR",
"dualistAdministration": true,
"contact": {
"name": "Emelie Denesik",
"phone": "+1-437-862-0519",
"email": "rowe.merl@ankunding.com"
}
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.e-factura-api.v1+json
application/hal+json
application/json |
Body
{
"code": "[code]",
"registrationName": "Lynch PLC",
"address": "118 Matilde Coves East Delbert, GA 26552",
"city": "North Fabiolaville",
"countryCode": "RO",
"postalCode": "79733-9832",
"vatCode": "[vat_code]",
"county": "vero",
"legalForm": "SRL",
"tradeRegisterNumber": "Jxy/827/1980",
"tradingName": "VonRueden-Aufderhar",
"exciseCode": "in",
"dualistAdministration": true,
"socialCapital": "100000 EUR",
"contact": {
"name": "Emelie Denesik",
"email": "rowe.merl@ankunding.com",
"phone": "+1-437-862-0519"
},
"_links": {
"self": {
"href": "http://api.efactura.local/company/UTcpcode"
}
}
}
GET /company[/:company_id]
Retrieve a company info by code. In order to successfully send the request, you must be authorized by the company.
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.e-factura-api.v1+json
application/hal+json
application/json |
| Authorization | Bearer [access_token] |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.e-factura-api.v1+json
application/hal+json
application/json |
Body
{
"code": "[code]",
"registrationName": "Lynch PLC",
"address": "118 Matilde Coves East Delbert, GA 26552",
"city": "North Fabiolaville",
"countryCode": "RO",
"postalCode": "79733-9832",
"vatCode": "[vat_code]",
"county": "vero",
"legalForm": "SRL",
"tradeRegisterNumber": "Jxy/827/1980",
"tradingName": "VonRueden-Aufderhar",
"exciseCode": "in",
"dualistAdministration": true,
"socialCapital": "100000 EUR",
"contact": {
"name": "Emelie Denesik",
"email": "rowe.merl@ankunding.com",
"phone": "+1-437-862-0519"
},
"_links": {
"self": {
"href": "http://api.efactura.local/company/UTcpcode"
}
}
}
Invoice
Send and retrieve invoices for companies.
POST /invoice
Create an invoice
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| _sendToANAF | boolean | Whether or not to also send this invoice to ANAF. If true (or 1), the seller must have previously authorized efactura in relation to ANAF |
NO |
| invoiceId | text | A unique identification of the Invoice. The sequential number required in Article 226(2) of the directive 2006/112/EC [2], to uniquely identify the Invoice within the business context, time-frame, operating systems and records of the Seller. No identification scheme is to be used. |
YES |
| issueDate | date | The date when the Invoice was issued. Format "YYYY-MM-DD" |
YES |
| amountWithVat | number | The total value of the purchase irrespective of payment status. |
YES |
| prepaidAmount | number | The sum of amounts which have been paid in advance. |
NO |
| dueDate | date | The date when the payment is due.Format "YYYY-MM-DD".One of dueDate or paymentTerms should be provided in case the payment value is grater than 0. |
NO |
| paymentTerms | text | A textual description of the payment terms that apply to the amount due for payment (Including description of possible penalties). |
NO |
| buyerReference | text | An identifier assigned by the Buyer used for internal routing purposes. An invoice must have buyer reference or purchase order reference(BT-13) |
NO |
| purchaseOrderReference | text | An identifier of a referenced purchase order, issued by the Buyer.An invoice must have buyer reference (BT-10) or purchase order reference. |
NO |
| contractDocumentReference | text | Contract reference |
NO |
| precedingInvoiceReference | text | The identification of an Invoice that was previously sent by the Seller. |
NO |
| precedingInvoiceIssueDate | date | The date when the Previous invoice was issued. Format "YYYY-MM-DD" |
NO |
| vatOnCollection | boolean | VAT on collection. true/false |
NO |
| externalDocumentUri | text | The URL (Uniform Resource Locator) that identifies where the external document is located. A means of locating the resource, including its primary access mechanism, e.g. http:// or ftp://.api |
NO |
| note | text | A textual note that gives unstructured information that is relevant to the Invoice as a whole.Such as the reason for any correction or assignment note in case the invoice has been factored. |
NO |
| currency | text | The currency in which all Invoice amounts are given (default is RON), except for the Total VAT amount in accounting currency. Only one currency shall be used in the Invoice, except for the VAT accounting currency code and the invoice total VAT amount in accounting currency. |
NO |
| invoicePeriodStartDate | text | Billing interval start date. Format = "YYYY-MM-DD". Example value: 2020-12-01 |
NO |
| invoicePeriodEndDate | text | Billing interval end date. Format = "YYYY-MM-DD". Example value: 2020-12-01 |
NO |
| seller/code | text | An identifier issued by an official registrar that identifies the company as a legal entity or person. Unique identification code ( CUI for Romanian entities) |
YES |
| seller/registrationName | text | The full formal name by which the company is registered in the national registry of legal entities or as a Taxable person or otherwise trades as a person or persons. |
YES |
| seller/tradingName | text | A name by which the Seller is known, other than Seller name (also known as Business name). |
NO |
| seller/address | text | Address |
YES |
| seller/city | text | City |
YES |
| seller/county | text | County |
YES |
| seller/postalCode | text | Postal code |
NO |
| seller/countryCode | text | Country code. Default is RO |
NO |
| seller/vatCode | text | The company's VAT identifier.If empty it means that the company is not a VAT payer |
NO |
| seller/legalForm | text | The company legal form (SRL, SA, SCA, PFA, II, IF, SCA, SCS, SNC) |
YES |
| seller/tradeRegisterNumber | text | The trade register number. |
YES |
| seller/socialCapital | text | Social capital of the company |
NO |
| seller/dualistAdministration | boolean | Is the company administrated in a dualist way? |
NO |
| seller/exciseCode | text | The company excise code |
NO |
| seller/contact/name | text | The name of the contact person. |
NO |
| seller/contact/email | text | An e-mail address for the contact point. |
NO |
| seller/contact/phone | text | A phone number for the contact point. |
NO |
| buyer/code | text | An identifier issued by an official registrar that identifies the company as a legal entity or person. Unique identification code ( CUI for Romanian entities) |
YES |
| buyer/registrationName | text | The full formal name by which the company is registered in the national registry of legal entities or as a Taxable person or otherwise trades as a person or persons. |
YES |
| buyer/tradingName | text | A name by which the Buyer is known, other than Buyer name (also known as Business name). |
NO |
| buyer/address | text | Address |
YES |
| buyer/city | text | City |
YES |
| buyer/county | text | County |
YES |
| buyer/postalCode | text | Postal code |
NO |
| buyer/countryCode | text | Country code. Default is RO |
NO |
| buyer/vatCode | text | The company's VAT identifier.If empty it means that the company is not a VAT payer |
NO |
| buyer/tradeRegisterNumber | text | The trade register number. |
NO |
| buyer/exciseCode | text | The company excise code |
NO |
| buyer/contact/name | text | The name of the contact person. |
NO |
| buyer/contact/email | text | An e-mail address for the contact point. |
NO |
| buyer/contact/phone | text | A phone number for the contact point. |
NO |
| lines[]/id | text | A unique identifier for the individual line within the Invoice. Example value: 12 |
YES |
| lines[]/name | text | Product\service name |
YES |
| lines[]/quantity | number | The quantity of items (goods or services) that is charged in the Invoice line.Example value: 100 |
YES |
| lines[]/um | text | The unit of measure that applies to the invoiced quantity. Codes for unit of packaging from UNECE Recommendation No. 21 can be used in accordance with the descriptions in the "Intro" section of UN/ECE Recommendation 20, Revision 11 (2015): The 2 character alphanumeric code values in UNECE Recommendation 21 shall be used. To avoid duplication with existing code values in UNECE Recommendation No. 20, each code value from UNECE Recommendation 21 shall be prefixed with an “X”, resulting in a 3 alphanumeric code when used as a unit of measure. |
YES |
| lines[]/price | number | The price of an item, exclusive of VAT, after subtracting item price discount. The Item net price has to be equal with the Item gross price less the Item price discount, if they are both provided. Item price can not be negative.Example value: 23.45 |
YES |
| lines[]/amount | number | The total amount of the Invoice line. The amount is “net” without VAT, i.e. inclusive of line level allowances and charges as well as other relevant taxes. Must be rounded to maximum 2 decimals. Example value: 233.46 |
YES |
| lines[]/currency | text | Currency code (default is RON). ISO 4217 Currency codes |
NO |
| lines[]/taxPercent | number | The VAT rate, represented as percentage that applies to the invoiced item. Example value: 25. Zero values are allowed. |
YES |
| lines[]/taxAmount | number | The total VAT of the line rounded to two(2) decimals. Ex. for value 420.228 correct is: 420.23 Incorrect: 420.228 or 420.22. Zero values are allowed. |
YES |
| lines[]/note | text | A textual note that gives unstructured information that is relevant to the Invoice line. |
NO |
| lines[]/taxCode | text | Duty or tax or fee category code (AE,E,S,Z,G,O,K). Defaults: S if taxPercent or taxAmount are present. If taxPercent or taxAmount are 0 or not specified the default is E if Seller is VAT payer otherwise O. AE - Vat Reverse Charge Code specifying that the standard VAT rate is levied from the invoicee. E Exempt from Tax Code specifying that taxes are not applicable. S - Standard rate Code specifying the standard rate. Z - Zero rated goods Code specifying that the goods are at a zero rate. G - Free export item, VAT not charged Code specifying that the item is free export and taxes are not charged. O - Services outside scope of tax Code specifying that taxes are not applicable to the services. K - VAT exempt for EEA intra-community supply of goods and services A tax category code indicating the item is VAT exempt due to an intra-community supply in the European Economic Area. |
NO |
| lines[]/sellerId | text | An identifier, assigned by the Seller, for the item. |
NO |
| lines[]/buyerId | text | An identifier, assigned by the Buyer, for the item. |
NO |
| lines[]/allowance | number | The amount of allowance without VAT. Must be rounded to maximum 2 decimals |
NO |
| lines[]/allowanceReason | text | The reason for the line level allowance, expressed as text. |
NO |
| paymentMeans[]/code | text | How the invoice has been / will be paid. Use only online_payment_service (payment will be made or has been made by an online payment service), bank_card (e.g. debit card, credit card), standing_agreement (an unspecified payment means known to both buyer and seller) or credit_transfer (the buyer will do / has done a bank transfer; IBAN is mandatory in this case). |
YES |
| paymentMeans[]/accountName | text | The name of the payment account, at a payment service provider, to which payment should be made. |
NO |
| paymentMeans[]/iban | text | The IBAN the amount payable should be transferred to |
NO |
| paymentMeans[]/spId | text | An identifier for the payment service provider where a payment account is located. Such as a BIC or a national clearing code where required. |
NO |
| paymentMeans[]/id | text | A textual value used to establish a link between the payment and the Invoice, issued by the Seller. Used for creditor's critical reconciliation information. This information element helps the Seller to assign an incoming payment to the relevant payment process. |
NO |
| delivery/id | text | An identifier for the location at which the goods and services are delivered. Example value: 83745498753497 |
NO |
| delivery/actualDeliveryDate | text | The date on which the supply of goods or services was made or completed. Format = "YYYY-MM-DD". Example value: 2017-12-01 |
NO |
| delivery/streetName | text | The main address line in an address. Ex. Green Street No 34 |
NO |
| delivery/additionalStreetName | text | An additional address line in an address that can be used to give further details supplementing the main line. Example value: Delivery Street 2 |
NO |
| delivery/city | text | The common name of the city, town or village, where the deliver to address is located. Example value: Cluj-Napoca |
NO |
| delivery/county | text | County |
NO |
| delivery/postalCode | text | The identifier for an addressable group of properties according to the relevant postal service. Example value: 86756 |
NO |
| delivery/countryCode | text | A code that identifies the country. Default is RO |
NO |
| allowanceCharges[]/charge | boolean | Use “true” when informing about Charges and “false” when informing about Allowances. |
YES |
| allowanceCharges[]/taxPercent | number | The VAT rate, represented as percentage that applies to the invoiced item. Example value: 25 |
YES |
| allowanceCharges[]/taxAmount | number | The VAT amount. Must be rounded to maximum 2 decimals. Example value: 200 |
YES |
| allowanceCharges[]/amount | number | The amount of an allowance or a charge, without VAT. Must be rounded to maximum 2 decimals. Example value: 200 |
YES |
| allowanceCharges[]/info | text | The reason for the document level allowance or charge, expressed as text. Ex. Discount |
YES |
| taxRepresentative/tradingName | text | The full name of the Seller's tax representative party. |
NO |
| taxRepresentative/address | text | Address |
NO |
| taxRepresentative/city | text | City |
NO |
| taxRepresentative/county | text | County |
NO |
| taxRepresentative/postalCode | text | Postal code |
NO |
| taxRepresentative/countryCode | text | Country code. Default is RO |
NO |
| taxRepresentative/vatCode | text | The VAT identifier of the Seller's tax representative party. |
NO |
| payee/tradingName | text | Payee name |
NO |
| payee/code | text | Payee legal registration identifier |
NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/hal+json
application/json |
| Content-Type | application/json
application/hal+json |
| Authorization | Bearer [access_token] |
Body
{
"invoiceId": "INV91268",
"issueDate": "2020-08-30",
"amountWithVat": 15191.75,
"prepaidAmount": 2000,
"dueDate": "2021-02-11",
"paymentTerms": "Unde fugiat odit ea doloribus quasi distinctio voluptatem.",
"buyerReference": "buyerReference",
"purchaseOrderReference": "purchaseOrderReference",
"contractDocumentReference": "contractDocumentReference",
"precedingInvoiceReference": "PREV-1234",
"precedingInvoiceIssueDate": "2020-08-31",
"vatOnCollection": true,
"externalDocumentUri": "http://www.google.com",
"note": "Invoice Note",
"currency": "RON",
"invoicePeriodStartDate": "1999-05-14",
"invoicePeriodEndDate": "2021-02-14",
"seller": {
"code": "99999999",
"vatCode": "RO99999999",
"registrationName": "Daniel, Kuphal and Halvorson",
"tradingName": "Bergnaum, Runte and Feest",
"address": "488 Altenwerth Pines Howeburgh, CO 24583",
"city": "Conroyton",
"countryCode": "RO",
"postalCode": "60039",
"county": "dolor",
"exciseCode": "aliquam",
"tradeRegisterNumber": "Jxy/2726/2008",
"legalForm": "SRL",
"socialCapital": "100000 EUR",
"dualistAdministration": true,
"contact": {
"name": "Felipe Beier",
"phone": "1-976-245-8333",
"email": "ceichmann@ruecker.com"
}
},
"buyer": {
"code": "88888888",
"vatCode": "RO88888888",
"registrationName": "Ankunding, Gutmann and Leffler",
"tradingName": "Barton PLC",
"address": "643 Metz Inlet Suite 059 Rolfsonberg, VA 05234-7137",
"city": "North Dorthy",
"countryCode": "RO",
"postalCode": "58032-9983",
"county": "Cluj",
"exciseCode": "ea",
"tradeRegisterNumber": "Jxy/1533/2012",
"contact": {
"name": "Rhianna Walsh",
"phone": "(787) 385-1812 x83878",
"email": "chelsea.heaney@bradtke.com"
}
},
"lines": [
{
"id": "1",
"price": 1200,
"quantity": 10,
"amount": 10800,
"taxPercent": 10,
"taxAmount": 1080,
"name": "Product 1",
"um": "H87",
"taxCode": "S",
"allowance": 1200,
"allowanceReason": "Line Discount 10%",
"sellerId": "xyz",
"buyerId": "xyz"
},
{
"id": "2",
"price": 233.46,
"quantity": 12,
"amount": 2801.52,
"taxPercent": 15,
"taxAmount": 420.23,
"name": "Product 2",
"um": "H87",
"note": "Whatever reason"
},
{
"id": "3",
"price": 100,
"quantity": 2,
"amount": 200,
"taxCode": "E",
"taxAmount": 0,
"taxPercent": 0,
"name": "Product 3",
"um": "H87"
}
],
"paymentMeans": [
{
"iban": "RO50PXTVZRM173PGD0TT5I5Z",
"id": 222052332,
"spId": "UCRNXGZD",
"code": "credit_transfer"
}
],
"delivery": {
"id": "xyz",
"actualDeliveryDate": "2021-01-24",
"streetName": "Isai Green",
"additionalStreetName": "Layla Loop",
"city": "West Stephanieton",
"county": "Hollishaven",
"countryCode": "RO",
"postalCode": "41142"
},
"allowanceCharges": [
{
"charge": false,
"taxPercent": 10,
"taxAmount": 10,
"amount": 100,
"info": "Global Discount"
}
],
"taxRepresentative": {
"tradingName": "Koelpin-Kerluke",
"address": "42542 Filiberto Circles Port Sylvester, WY 31734-1077",
"city": "Doylehaven",
"county": "Sibiu",
"countryCode": "RO",
"vatCode": "RO99999999",
"postalCode": "17826-9590"
},
"payee": {
"tradingName": "Payee Name",
"code": "112233"
}
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/hal+json
application/json |
Body
{
"sysUuid": "[uuid]",
"status": "in_approval",
"invoiceId": "INV91268",
"issueDate": "2020-08-30",
"amount": 13701.52,
"taxTotal": 1490.23,
"amountWithVat": 15191.75,
"payableAmount": 13191.75,
"prepaidAmount": 2000,
"dueDate": "2021-02-11",
"paymentTerms": "Unde fugiat odit ea doloribus quasi distinctio voluptatem.",
"buyerReference": "buyerReference",
"purchaseOrderReference": "purchaseOrderReference",
"contractDocumentReference": "contractDocumentReference",
"precedingInvoiceReference": "PREV-1234",
"precedingInvoiceIssueDate": "2020-08-31",
"vatOnCollection": true,
"externalDocumentUri": "http://www.google.com",
"note": "Invoice Note",
"currency": "RON",
"invoicePeriodStartDate": "1999-05-14",
"invoicePeriodEndDate": "2021-02-14",
"seller": {
"tradingName": "Bergnaum, Runte and Feest",
"code": "99999999",
"registrationName": "Daniel, Kuphal and Halvorson",
"legalForm": "SRL",
"tradeRegisterNumber": "Jxy/2726/2008",
"socialCapital": "100000 EUR",
"exciseCode": "aliquam",
"dualistAdministration": true,
"address": "488 Altenwerth Pines Howeburgh, CO 24583",
"city": "Conroyton",
"county": "dolor",
"countryCode": "RO",
"postalCode": "60039",
"vatCode": "RO99999999",
"contact": {
"name": "Felipe Beier",
"email": "ceichmann@ruecker.com",
"phone": "1-976-245-8333"
}
},
"buyer": {
"tradingName": "Barton PLC",
"code": "88888888",
"registrationName": "Ankunding, Gutmann and Leffler",
"address": "643 Metz Inlet Suite 059 Rolfsonberg, VA 05234-7137",
"city": "North Dorthy",
"county": "Cluj",
"countryCode": "RO",
"postalCode": "58032-9983",
"vatCode": "RO88888888",
"contact": {
"name": "Rhianna Walsh",
"email": "chelsea.heaney@bradtke.com",
"phone": "(787) 385-1812 x83878"
},
"exciseCode": "ea",
"tradeRegisterNumber": "Jxy/1533/2012"
},
"lines": [
{
"id": "1",
"name": "Product 1",
"quantity": 10,
"um": "H87",
"price": 1200,
"taxPercent": 10,
"taxAmount": 1080,
"taxCode": "S",
"sellerId": "xyz",
"buyerId": "xyz",
"amount": 10800,
"currency": "RON",
"note": null,
"allowance": 1200,
"allowanceReason": "Line Discount 10%",
"charge": 0,
"chargeReason": null
},
{
"id": "2",
"name": "Product 2",
"quantity": 12,
"um": "H87",
"price": 233.46,
"taxPercent": 15,
"taxAmount": 420.23,
"taxCode": "S",
"sellerId": null,
"buyerId": null,
"amount": 2801.52,
"currency": "RON",
"note": "Whatever reason",
"allowance": 0,
"allowanceReason": null,
"charge": 0,
"chargeReason": null
},
{
"id": "3",
"name": "Product 3",
"quantity": 2,
"um": "H87",
"price": 100,
"taxPercent": 0,
"taxAmount": 0,
"taxCode": "E",
"sellerId": null,
"buyerId": null,
"amount": 200,
"currency": "RON",
"note": null,
"allowance": 0,
"allowanceReason": null,
"charge": 0,
"chargeReason": null
}
],
"paymentMeans": [
{
"code": "credit_transfer",
"id": "222052332",
"accountName": null,
"iban": "RO50PXTVZRM173PGD0TT5I5Z",
"spId": "UCRNXGZD"
}
],
"delivery": {
"id": "xyz",
"actualDeliveryDate": "2021-01-24",
"streetName": "Isai Green",
"additionalStreetName": "Layla Loop",
"city": "West Stephanieton",
"county": "Hollishaven",
"postalCode": "41142",
"countryCode": "RO"
},
"allowanceCharges": [
{
"charge": false,
"amount": 100,
"taxPercent": 10,
"taxAmount": "10.00",
"info": "Global Discount"
}
],
"taxRepresentative": {
"tradingName": "Koelpin-Kerluke",
"address": "42542 Filiberto Circles Port Sylvester, WY 31734-1077",
"city": "Doylehaven",
"county": "Sibiu",
"countryCode": "RO",
"postalCode": "17826-9590",
"vatCode": "RO99999999"
},
"payee": {
"tradingName": "Payee Name",
"code": "112233"
},
"_links": {
"self": {
"href": "[base url]/invoice/[:invoice_uuid]"
}
}
}
GET /invoice[/:invoice_uuid]
Retrieve an invoice. Obs. Invoice access authorization for the seller or buyer is needed.
Request
Headers
| Header | Value |
|---|---|
| Accept | application/hal+json
application/json |
| Authorization | Bearer [access_token] |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/hal+json
application/json |
Body
{
"sysUuid": "[uuid]",
"status": "in_approval",
"invoiceId": "INV91268",
"issueDate": "2020-08-30",
"amount": 13701.52,
"taxTotal": 1490.23,
"amountWithVat": 15191.75,
"payableAmount": 13191.75,
"prepaidAmount": 2000,
"dueDate": "2021-02-11",
"paymentTerms": "Unde fugiat odit ea doloribus quasi distinctio voluptatem.",
"buyerReference": "buyerReference",
"purchaseOrderReference": "purchaseOrderReference",
"contractDocumentReference": "contractDocumentReference",
"precedingInvoiceReference": "PREV-1234",
"precedingInvoiceIssueDate": "2020-08-31",
"vatOnCollection": true,
"externalDocumentUri": "http://www.google.com",
"note": "Invoice Note",
"currency": "RON",
"invoicePeriodStartDate": "1999-05-14",
"invoicePeriodEndDate": "2021-02-14",
"seller": {
"tradingName": "Bergnaum, Runte and Feest",
"code": "99999999",
"registrationName": "Daniel, Kuphal and Halvorson",
"legalForm": "SRL",
"tradeRegisterNumber": "Jxy/2726/2008",
"socialCapital": "100000 EUR",
"exciseCode": "aliquam",
"dualistAdministration": true,
"address": "488 Altenwerth Pines Howeburgh, CO 24583",
"city": "Conroyton",
"county": "dolor",
"countryCode": "RO",
"postalCode": "60039",
"vatCode": "RO99999999",
"contact": {
"name": "Felipe Beier",
"email": "ceichmann@ruecker.com",
"phone": "1-976-245-8333"
}
},
"buyer": {
"tradingName": "Barton PLC",
"code": "88888888",
"registrationName": "Ankunding, Gutmann and Leffler",
"address": "643 Metz Inlet Suite 059 Rolfsonberg, VA 05234-7137",
"city": "North Dorthy",
"county": "Cluj",
"countryCode": "RO",
"postalCode": "58032-9983",
"vatCode": "RO88888888",
"contact": {
"name": "Rhianna Walsh",
"email": "chelsea.heaney@bradtke.com",
"phone": "(787) 385-1812 x83878"
},
"exciseCode": "ea",
"tradeRegisterNumber": "Jxy/1533/2012"
},
"lines": [
{
"id": "1",
"name": "Product 1",
"quantity": 10,
"um": "H87",
"price": 1200,
"taxPercent": 10,
"taxAmount": 1080,
"taxCode": "S",
"sellerId": "xyz",
"buyerId": "xyz",
"amount": 10800,
"currency": "RON",
"note": null,
"allowance": 1200,
"allowanceReason": "Line Discount 10%",
"charge": 0,
"chargeReason": null
},
{
"id": "2",
"name": "Product 2",
"quantity": 12,
"um": "H87",
"price": 233.46,
"taxPercent": 15,
"taxAmount": 420.23,
"taxCode": "S",
"sellerId": null,
"buyerId": null,
"amount": 2801.52,
"currency": "RON",
"note": "Whatever reason",
"allowance": 0,
"allowanceReason": null,
"charge": 0,
"chargeReason": null
},
{
"id": "3",
"name": "Product 3",
"quantity": 2,
"um": "H87",
"price": 100,
"taxPercent": 0,
"taxAmount": 0,
"taxCode": "E",
"sellerId": null,
"buyerId": null,
"amount": 200,
"currency": "RON",
"note": null,
"allowance": 0,
"allowanceReason": null,
"charge": 0,
"chargeReason": null
}
],
"paymentMeans": [
{
"code": "credit_transfer",
"id": "222052332",
"accountName": null,
"iban": "RO50PXTVZRM173PGD0TT5I5Z",
"spId": "UCRNXGZD"
}
],
"delivery": {
"id": "xyz",
"actualDeliveryDate": "2021-01-24",
"streetName": "Isai Green",
"additionalStreetName": "Layla Loop",
"city": "West Stephanieton",
"county": "Hollishaven",
"postalCode": "41142",
"countryCode": "RO"
},
"allowanceCharges": [
{
"charge": false,
"amount": 100,
"taxPercent": 10,
"taxAmount": "10.00",
"info": "Global Discount"
}
],
"taxRepresentative": {
"tradingName": "Koelpin-Kerluke",
"address": "42542 Filiberto Circles Port Sylvester, WY 31734-1077",
"city": "Doylehaven",
"county": "Sibiu",
"countryCode": "RO",
"postalCode": "17826-9590",
"vatCode": "RO99999999"
},
"payee": {
"tradingName": "Payee Name",
"code": "112233"
},
"_links": {
"self": {
"href": "[base url]/invoice/[:invoice_uuid]"
}
}
}
DELETE /invoice[/:invoice_uuid]
Delete an invoice. Obs. Invoice access authorization for the seller or buyer is needed.
Request
Headers
| Header | Value |
|---|---|
| Accept | application/hal+json
application/json |
| Authorization | Bearer [access_token] |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 204: No Content
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/hal+json
application/json |
PATCH /invoice[/:invoice_uuid]
Modify an invoice resource. Obs. Invoice access authorization for the seller or buyer is needed.
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| status | text | Invoice status. The allowed values are: ack, accepted, rejected, pay_scheduled and paid . After the status is changed, a POST request with the modified data is made to the URL taken from callbackUrl invoice property - if any. |
NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/hal+json
application/json |
| Content-Type | application/json
application/hal+json |
| Authorization | Bearer [access_token] |
Body
{
"status": "accepted"
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/hal+json
application/json |
Body
{
"oldStatus": "in_approval",
"newStatus": "accepted"
}
PUT /invoice[/:invoice_uuid]
Update an invoice. The fields sent in the request body are replaced in the Invoice resource. Obs. Invoice access authorization for the seller or buyer is needed.
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| _sendToANAF | boolean | Whether or not to also send this invoice to ANAF. If true (or 1), the seller must have previously authorized efactura in relation to ANAF |
NO |
| issueDate | date | The date when the Invoice was issued. Format "YYYY-MM-DD" |
YES |
| amountWithVat | number | The total value of the purchase irrespective of payment status. |
YES |
| prepaidAmount | number | The sum of amounts which have been paid in advance. |
NO |
| dueDate | date | The date when the payment is due.Format "YYYY-MM-DD".One of dueDate or paymentTerms should be provided in case the payment value is grater than 0. |
NO |
| paymentTerms | text | A textual description of the payment terms that apply to the amount due for payment (Including description of possible penalties). |
NO |
| buyerReference | text | An identifier assigned by the Buyer used for internal routing purposes. An invoice must have buyer reference or purchase order reference(BT-13) |
NO |
| purchaseOrderReference | text | An identifier of a referenced purchase order, issued by the Buyer.An invoice must have buyer reference (BT-10) or purchase order reference. |
NO |
| contractDocumentReference | text | Contract reference |
NO |
| precedingInvoiceReference | text | The identification of an Invoice that was previously sent by the Seller. |
NO |
| precedingInvoiceIssueDate | date | The date when the Previous invoice was issued. Format "YYYY-MM-DD" |
NO |
| vatOnCollection | boolean | VAT on collection. true/false |
NO |
| externalDocumentUri | text | The URL (Uniform Resource Locator) that identifies where the external document is located. A means of locating the resource, including its primary access mechanism, e.g. http:// or ftp://.api |
NO |
| note | text | A textual note that gives unstructured information that is relevant to the Invoice as a whole.Such as the reason for any correction or assignment note in case the invoice has been factored. |
NO |
| currency | text | The currency in which all Invoice amounts are given (default is RON), except for the Total VAT amount in accounting currency. Only one currency shall be used in the Invoice, except for the VAT accounting currency code and the invoice total VAT amount in accounting currency. |
NO |
| invoicePeriodStartDate | text | Billing interval start date. Format = "YYYY-MM-DD". Example value: 2020-12-01 |
NO |
| invoicePeriodEndDate | text | Billing interval end date. Format = "YYYY-MM-DD". Example value: 2020-12-01 |
NO |
| lines[]/id | text | A unique identifier for the individual line within the Invoice. Example value: 12 |
YES |
| lines[]/name | text | Product\service name |
YES |
| lines[]/quantity | number | The quantity of items (goods or services) that is charged in the Invoice line.Example value: 100 |
YES |
| lines[]/um | text | The unit of measure that applies to the invoiced quantity. Codes for unit of packaging from UNECE Recommendation No. 21 can be used in accordance with the descriptions in the "Intro" section of UN/ECE Recommendation 20, Revision 11 (2015): The 2 character alphanumeric code values in UNECE Recommendation 21 shall be used. To avoid duplication with existing code values in UNECE Recommendation No. 20, each code value from UNECE Recommendation 21 shall be prefixed with an “X”, resulting in a 3 alphanumeric code when used as a unit of measure. |
YES |
| lines[]/price | number | The price of an item, exclusive of VAT, after subtracting item price discount. The Item net price has to be equal with the Item gross price less the Item price discount, if they are both provided. Item price can not be negative.Example value: 23.45 |
YES |
| lines[]/amount | number | The total amount of the Invoice line. The amount is “net” without VAT, i.e. inclusive of line level allowances and charges as well as other relevant taxes. Must be rounded to maximum 2 decimals. Example value: 233.46 |
YES |
| lines[]/currency | text | Currency code (default is RON). ISO 4217 Currency codes |
NO |
| lines[]/taxPercent | number | The VAT rate, represented as percentage that applies to the invoiced item. Example value: 25. Zero values are allowed. |
YES |
| lines[]/taxAmount | number | The total VAT of the line rounded to two(2) decimals. Ex. for value 420.228 correct is: 420.23 Incorrect: 420.228 or 420.22. Zero values are allowed. |
YES |
| lines[]/note | text | A textual note that gives unstructured information that is relevant to the Invoice line. |
NO |
| lines[]/taxCode | text | Duty or tax or fee category code (AE,E,S,Z,G,O,K). Defaults: S if taxPercent or taxAmount are present. If taxPercent or taxAmount are 0 or not specified the default is E if Seller is VAT payer otherwise O. AE - Vat Reverse Charge Code specifying that the standard VAT rate is levied from the invoicee. E Exempt from Tax Code specifying that taxes are not applicable. S - Standard rate Code specifying the standard rate. Z - Zero rated goods Code specifying that the goods are at a zero rate. G - Free export item, VAT not charged Code specifying that the item is free export and taxes are not charged. O - Services outside scope of tax Code specifying that taxes are not applicable to the services. K - VAT exempt for EEA intra-community supply of goods and services A tax category code indicating the item is VAT exempt due to an intra-community supply in the European Economic Area. |
NO |
| lines[]/sellerId | text | An identifier, assigned by the Seller, for the item. |
NO |
| lines[]/buyerId | text | An identifier, assigned by the Buyer, for the item. |
NO |
| lines[]/allowance | number | The amount of allowance without VAT. Must be rounded to maximum 2 decimals |
NO |
| lines[]/allowanceReason | text | The reason for the line level allowance, expressed as text. |
NO |
| paymentMeans[]/code | text | How the invoice has been / will be paid. Use only online_payment_service (payment will be made or has been made by an online payment service), bank_card (e.g. debit card, credit card), standing_agreement (an unspecified payment means known to both buyer and seller) or credit_transfer (the buyer will do / has done a bank transfer; IBAN is mandatory in this case). |
YES |
| paymentMeans[]/accountName | text | The name of the payment account, at a payment service provider, to which payment should be made. |
NO |
| paymentMeans[]/iban | text | The IBAN the amount payable should be transferred to |
NO |
| paymentMeans[]/spId | text | An identifier for the payment service provider where a payment account is located. Such as a BIC or a national clearing code where required. |
NO |
| paymentMeans[]/id | text | A textual value used to establish a link between the payment and the Invoice, issued by the Seller. Used for creditor's critical reconciliation information. This information element helps the Seller to assign an incoming payment to the relevant payment process. |
NO |
| delivery/id | text | An identifier for the location at which the goods and services are delivered. Example value: 83745498753497 |
NO |
| delivery/actualDeliveryDate | text | The date on which the supply of goods or services was made or completed. Format = "YYYY-MM-DD". Example value: 2017-12-01 |
NO |
| delivery/streetName | text | The main address line in an address. Ex. Green Street No 34 |
NO |
| delivery/additionalStreetName | text | An additional address line in an address that can be used to give further details supplementing the main line. Example value: Delivery Street 2 |
NO |
| delivery/city | text | The common name of the city, town or village, where the deliver to address is located. Example value: Cluj-Napoca |
NO |
| delivery/county | text | County |
NO |
| delivery/postalCode | text | The identifier for an addressable group of properties according to the relevant postal service. Example value: 86756 |
NO |
| delivery/countryCode | text | A code that identifies the country. Default is RO |
NO |
| allowanceCharges[]/charge | boolean | Use “true” when informing about Charges and “false” when informing about Allowances. |
YES |
| allowanceCharges[]/taxPercent | number | The VAT rate, represented as percentage that applies to the invoiced item. Example value: 25 |
YES |
| allowanceCharges[]/taxAmount | number | The VAT amount. Must be rounded to maximum 2 decimals. Example value: 200 |
YES |
| allowanceCharges[]/amount | number | The amount of an allowance or a charge, without VAT. Must be rounded to maximum 2 decimals. Example value: 200 |
YES |
| allowanceCharges[]/info | text | The reason for the document level allowance or charge, expressed as text. Ex. Discount |
YES |
| taxRepresentative/tradingName | text | The full name of the Seller's tax representative party. |
NO |
| taxRepresentative/address | text | Address |
NO |
| taxRepresentative/city | text | City |
NO |
| taxRepresentative/county | text | County |
NO |
| taxRepresentative/postalCode | text | Postal code |
NO |
| taxRepresentative/countryCode | text | Country code. Default is RO |
NO |
| taxRepresentative/vatCode | text | The VAT identifier of the Seller's tax representative party. |
NO |
| payee/tradingName | text | Payee name |
NO |
| payee/code | text | Payee legal registration identifier |
NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/hal+json
application/json |
| Content-Type | application/json
application/hal+json |
| Authorization | Bearer [access_token] |
Body
{
"issueDate": "2020-08-30",
"amountWithVat": 15191.75,
"prepaidAmount": 2000,
"dueDate": "2021-02-11",
"paymentTerms": "Unde fugiat odit ea doloribus quasi distinctio voluptatem.",
"buyerReference": "buyerReference",
"purchaseOrderReference": "purchaseOrderReference",
"contractDocumentReference": "contractDocumentReference",
"precedingInvoiceReference": "PREV-1234",
"precedingInvoiceIssueDate": "2020-08-31",
"vatOnCollection": true,
"externalDocumentUri": "http://www.google.com",
"note": "Invoice Note",
"currency": "RON",
"invoicePeriodStartDate": "1999-05-14",
"invoicePeriodEndDate": "2021-02-14",
"lines": [
{
"id": "1",
"price": 1200,
"quantity": 10,
"amount": 10800,
"taxPercent": 10,
"taxAmount": 1080,
"name": "Product 1",
"um": "H87",
"taxCode": "S",
"allowance": 1200,
"allowanceReason": "Line Discount 10%",
"sellerId": "xyz",
"buyerId": "xyz"
},
{
"id": "2",
"price": 233.46,
"quantity": 12,
"amount": 2801.52,
"taxPercent": 15,
"taxAmount": 420.23,
"name": "Product 2",
"um": "H87",
"note": "Whatever reason"
},
{
"id": "3",
"price": 100,
"quantity": 2,
"amount": 200,
"taxCode": "E",
"taxAmount": 0,
"taxPercent": 0,
"name": "Product 3",
"um": "H87"
}
],
"paymentMeans": [
{
"iban": "RO50PXTVZRM173PGD0TT5I5Z",
"id": 222052332,
"spId": "UCRNXGZD",
"code": "credit_transfer"
}
],
"delivery": {
"id": "xyz",
"actualDeliveryDate": "2021-01-24",
"streetName": "Isai Green",
"additionalStreetName": "Layla Loop",
"city": "West Stephanieton",
"county": "Hollishaven",
"countryCode": "RO",
"postalCode": "41142"
},
"allowanceCharges": [
{
"charge": false,
"taxPercent": 10,
"taxAmount": 10,
"amount": 100,
"info": "Global Discount"
}
],
"taxRepresentative": {
"tradingName": "Koelpin-Kerluke",
"address": "42542 Filiberto Circles Port Sylvester, WY 31734-1077",
"city": "Doylehaven",
"county": "Sibiu",
"countryCode": "RO",
"vatCode": "RO99999999",
"postalCode": "17826-9590"
},
"payee": {
"tradingName": "Payee Name",
"code": "112233"
}
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/hal+json
application/json |
Body
{
"sysUuid": "[uuid]",
"status": "in_approval",
"invoiceId": "INV91268",
"issueDate": "2020-08-30",
"amount": 13701.52,
"taxTotal": 1490.23,
"amountWithVat": 15191.75,
"payableAmount": 13191.75,
"prepaidAmount": 2000,
"dueDate": "2021-02-11",
"paymentTerms": "Unde fugiat odit ea doloribus quasi distinctio voluptatem.",
"buyerReference": "buyerReference",
"purchaseOrderReference": "purchaseOrderReference",
"contractDocumentReference": "contractDocumentReference",
"precedingInvoiceReference": "PREV-1234",
"precedingInvoiceIssueDate": "2020-08-31",
"vatOnCollection": true,
"externalDocumentUri": "http://www.google.com",
"note": "Invoice Note",
"currency": "RON",
"invoicePeriodStartDate": "1999-05-14",
"invoicePeriodEndDate": "2021-02-14",
"seller": {
"tradingName": "Bergnaum, Runte and Feest",
"code": "99999999",
"registrationName": "Daniel, Kuphal and Halvorson",
"legalForm": "SRL",
"tradeRegisterNumber": "Jxy/2726/2008",
"socialCapital": "100000 EUR",
"exciseCode": "aliquam",
"dualistAdministration": true,
"address": "488 Altenwerth Pines Howeburgh, CO 24583",
"city": "Conroyton",
"county": "dolor",
"countryCode": "RO",
"postalCode": "60039",
"vatCode": "RO99999999",
"contact": {
"name": "Felipe Beier",
"email": "ceichmann@ruecker.com",
"phone": "1-976-245-8333"
}
},
"buyer": {
"tradingName": "Barton PLC",
"code": "88888888",
"registrationName": "Ankunding, Gutmann and Leffler",
"address": "643 Metz Inlet Suite 059 Rolfsonberg, VA 05234-7137",
"city": "North Dorthy",
"county": "Cluj",
"countryCode": "RO",
"postalCode": "58032-9983",
"vatCode": "RO88888888",
"contact": {
"name": "Rhianna Walsh",
"email": "chelsea.heaney@bradtke.com",
"phone": "(787) 385-1812 x83878"
},
"exciseCode": "ea",
"tradeRegisterNumber": "Jxy/1533/2012"
},
"lines": [
{
"id": "1",
"name": "Product 1",
"quantity": 10,
"um": "H87",
"price": 1200,
"taxPercent": 10,
"taxAmount": 1080,
"taxCode": "S",
"sellerId": "xyz",
"buyerId": "xyz",
"amount": 10800,
"currency": "RON",
"note": null,
"allowance": 1200,
"allowanceReason": "Line Discount 10%",
"charge": 0,
"chargeReason": null
},
{
"id": "2",
"name": "Product 2",
"quantity": 12,
"um": "H87",
"price": 233.46,
"taxPercent": 15,
"taxAmount": 420.23,
"taxCode": "S",
"sellerId": null,
"buyerId": null,
"amount": 2801.52,
"currency": "RON",
"note": "Whatever reason",
"allowance": 0,
"allowanceReason": null,
"charge": 0,
"chargeReason": null
},
{
"id": "3",
"name": "Product 3",
"quantity": 2,
"um": "H87",
"price": 100,
"taxPercent": 0,
"taxAmount": 0,
"taxCode": "E",
"sellerId": null,
"buyerId": null,
"amount": 200,
"currency": "RON",
"note": null,
"allowance": 0,
"allowanceReason": null,
"charge": 0,
"chargeReason": null
}
],
"paymentMeans": [
{
"code": "credit_transfer",
"id": "222052332",
"accountName": null,
"iban": "RO50PXTVZRM173PGD0TT5I5Z",
"spId": "UCRNXGZD"
}
],
"delivery": {
"id": "xyz",
"actualDeliveryDate": "2021-01-24",
"streetName": "Isai Green",
"additionalStreetName": "Layla Loop",
"city": "West Stephanieton",
"county": "Hollishaven",
"postalCode": "41142",
"countryCode": "RO"
},
"allowanceCharges": [
{
"charge": false,
"amount": 100,
"taxPercent": 10,
"taxAmount": "10.00",
"info": "Global Discount"
}
],
"taxRepresentative": {
"tradingName": "Koelpin-Kerluke",
"address": "42542 Filiberto Circles Port Sylvester, WY 31734-1077",
"city": "Doylehaven",
"county": "Sibiu",
"countryCode": "RO",
"postalCode": "17826-9590",
"vatCode": "RO99999999"
},
"payee": {
"tradingName": "Payee Name",
"code": "112233"
},
"_links": {
"self": {
"href": "[base url]/invoice/[:invoice_uuid]"
}
}
}
GET /invoice
Retrieve a list of paginated invoices ordered desc. by the time the invoice was added. Obs. Invoice access authorization for the seller or buyer is needed.
Query String Parametres
| Parameter | Type | Description | Required |
|---|---|---|---|
| page | integer | Pagination parameter. | No |
| sellerCode | text | Seller/Supplier Company Identifier |
Yesif buyerCode is not set Noif buyerCode is set |
| buyerCode | text | Buyer/Customer Company Identifier |
Yes if not sellerCode is not set No if not sellerCode is set |
| afterTime | unix timestamp | Get all invoices registered after that time | No |
| pageSize | integer | No of invoices per page. Max value is 100 | No |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/hal+json
application/json |
| Authorization | Bearer [access_token] |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/hal+json
application/json |
Body
{
"_links": {
"self": {
"href": "/invoice"
},
"first": {
"href": "/invoice?page={page}"
},
"prev": {
"href": "/invoice?page={page}"
},
"next": {
"href": "/invoice?page={page}"
},
"last": {
"href": "/invoice?page={page}"
}
},
"_embedded": {
"invoice": [
{
"sysUuid": "[uuid]",
"status": "in_approval",
"invoiceId": "INV91268",
"issueDate": "2020-08-30",
"amount": 13701.52,
"taxTotal": 1490.23,
"amountWithVat": 15191.75,
"payableAmount": 13191.75,
"prepaidAmount": 2000,
"dueDate": "2021-02-11",
"paymentTerms": "Unde fugiat odit ea doloribus quasi distinctio voluptatem.",
"buyerReference": "buyerReference",
"purchaseOrderReference": "purchaseOrderReference",
"contractDocumentReference": "contractDocumentReference",
"precedingInvoiceReference": "PREV-1234",
"precedingInvoiceIssueDate": "2020-08-31",
"vatOnCollection": true,
"externalDocumentUri": "http://www.google.com",
"note": "Invoice Note",
"currency": "RON",
"invoicePeriodStartDate": "1999-05-14",
"invoicePeriodEndDate": "2021-02-14",
"seller": {
"tradingName": "Bergnaum, Runte and Feest",
"code": "99999999",
"registrationName": "Daniel, Kuphal and Halvorson",
"legalForm": "SRL",
"tradeRegisterNumber": "Jxy/2726/2008",
"socialCapital": "100000 EUR",
"exciseCode": "aliquam",
"dualistAdministration": true,
"address": "488 Altenwerth Pines Howeburgh, CO 24583",
"city": "Conroyton",
"county": "dolor",
"countryCode": "RO",
"postalCode": "60039",
"vatCode": "RO99999999",
"contact": {
"name": "Felipe Beier",
"email": "ceichmann@ruecker.com",
"phone": "1-976-245-8333"
}
},
"buyer": {
"tradingName": "Barton PLC",
"code": "88888888",
"registrationName": "Ankunding, Gutmann and Leffler",
"address": "643 Metz Inlet Suite 059 Rolfsonberg, VA 05234-7137",
"city": "North Dorthy",
"county": "Cluj",
"countryCode": "RO",
"postalCode": "58032-9983",
"vatCode": "RO88888888",
"contact": {
"name": "Rhianna Walsh",
"email": "chelsea.heaney@bradtke.com",
"phone": "(787) 385-1812 x83878"
},
"exciseCode": "ea",
"tradeRegisterNumber": "Jxy/1533/2012"
},
"lines": [
{
"id": "1",
"name": "Product 1",
"quantity": 10,
"um": "H87",
"price": 1200,
"taxPercent": 10,
"taxAmount": 1080,
"taxCode": "S",
"sellerId": "xyz",
"buyerId": "xyz",
"amount": 10800,
"currency": "RON",
"note": null,
"allowance": 1200,
"allowanceReason": "Line Discount 10%",
"charge": 0,
"chargeReason": null
},
{
"id": "2",
"name": "Product 2",
"quantity": 12,
"um": "H87",
"price": 233.46,
"taxPercent": 15,
"taxAmount": 420.23,
"taxCode": "S",
"sellerId": null,
"buyerId": null,
"amount": 2801.52,
"currency": "RON",
"note": "Whatever reason",
"allowance": 0,
"allowanceReason": null,
"charge": 0,
"chargeReason": null
},
{
"id": "3",
"name": "Product 3",
"quantity": 2,
"um": "H87",
"price": 100,
"taxPercent": 0,
"taxAmount": 0,
"taxCode": "E",
"sellerId": null,
"buyerId": null,
"amount": 200,
"currency": "RON",
"note": null,
"allowance": 0,
"allowanceReason": null,
"charge": 0,
"chargeReason": null
}
],
"paymentMeans": [
{
"code": "credit_transfer",
"id": "222052332",
"accountName": null,
"iban": "RO50PXTVZRM173PGD0TT5I5Z",
"spId": "UCRNXGZD"
}
],
"delivery": {
"id": "xyz",
"actualDeliveryDate": "2021-01-24",
"streetName": "Isai Green",
"additionalStreetName": "Layla Loop",
"city": "West Stephanieton",
"county": "Hollishaven",
"postalCode": "41142",
"countryCode": "RO"
},
"allowanceCharges": [
{
"charge": false,
"amount": 100,
"taxPercent": 10,
"taxAmount": "10.00",
"info": "Global Discount"
}
],
"taxRepresentative": {
"tradingName": "Koelpin-Kerluke",
"address": "42542 Filiberto Circles Port Sylvester, WY 31734-1077",
"city": "Doylehaven",
"county": "Sibiu",
"countryCode": "RO",
"postalCode": "17826-9590",
"vatCode": "RO99999999"
},
"payee": {
"tradingName": "Payee Name",
"code": "112233"
},
"_links": {
"self": {
"href": "[base url]/invoice/[:invoice_uuid]"
}
}
}
]
}
}
UBLInvoice
Send/retrieve UBL Invoices to/from the Romanian Fiscal Authority (ANAF).
GET /ubl-invoice[/:ubl_invoice_uuid]
Get an invoice's XML content signed by the Romanian Fiscal Authority.
The Company identified by companyCode must have an account on https://efactura.online, and previously have authorized eFactura with ANAF. If ANAF authorization is missing, a 403 Forbidden response will be returned with the following body:
{
"type": "anaf_authorization_missing",
"title": "Missing ANAF authorization",
"status": 403,
"authorizationRequest": {
"url": "https://efactura.online/spv/authorize?sId=...&ret=..."
}
}
The Service Provider should redirect the user to the url included in the "authorizationRequest" response field where the user can authorize the app in ANAF. After successful authorization, user will be redirected to the redirectUrl provided when calling this service, where he should start the process again.
If Service Provider is not authorized to send invoices to ANAF in the name of the company making the request, a 403 Forbidden response will be returned. The Service Provider should use the "/company/authorization" endpoint in order to get an authorization from the end user to allow fetching invoices from ANAF in his name.
Query String Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| companyCode | text | An identifier issued by an official registrar that identifies the company as a legal entity or person. Unique identification code ( CUI for Romanian entities) | Yes |
| redirectUrl | url | The URL where the user should be redirected after successful authorization with ANAF. Used in cases where the ANAF authorization expires, or doesn't exist. The end-user will be redirected to this URL after successful authorization in the ANAF system | No |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/json |
| Authorization | Bearer [access_token] |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
Body
{
"sysUuid": "62d919f66f7dec655841b709", // ID of invoice from efactura
"status": "pending", // current status, can be "pending" or "processed"
"state": "-", // state, can be one of "-" (when status is "pending"), "ok" (everything went OK, invoice has been successfully processed), or "error" (ANAF reported an error while processing the invoice)
"anafIds": {
"idUpload": "23874638", // ID returned by ANAF when sending an invoice. It will be an empty string if nothing is available
"idDownload": "82736483", // ID made available after the successful processing of the invoice. Empty string if nothing is available
},
"anafErrors": [], // list of errors reported by ANAF when processing the invoice, if any
"invoiceXml": "", // base64-encoded string of the invoice's XML content
"signedInvoiceXml": "", // base64-encoded XML signature from ANAF, available if status = "processed" and state = "ok"
}
GET /ubl-invoice
Retrieve a list of invoice identifiers that have been sent to, or received via ANAF for a company identified by companyCode.
Use the type parameter to filter out for only received / sent invoices.
The Company identified by companyCode must have an account on https://efactura.online, and previously have authorized eFactura with ANAF. If ANAF authorization is missing, a 403 Forbidden response will be returned with the following body:
{
"type": "anaf_authorization_missing",
"title": "Missing ANAF authorization",
"status": 403,
"authorizationRequest": {
"url": "https://efactura.online/spv/authorize?sId=...&ret=..."
}
}
The Service Provider should redirect the user to the url included in the "authorizationRequest" response field where the user can authorize the app in ANAF. After successful authorization, user will be redirected to the redirectUrl provided when calling this service, where he should start the process again.
If Service Provider is not authorized to send invoices to ANAF in the name of the company making the request, a 403 Forbidden response will be returned. The Service Provider should use the "/company/authorization" endpoint in order to get an authorization from the end user to allow fetching invoices from ANAF in his name. Alternatively, the service provider can redirect the user to the url included in the authorizationRequest response field, where the user will grant access, after which he'll be redirected to the redirectUrl provided when calling this service, where he should start the process again. In such cases, the response will be:
{
"type": "missing_authorization",
"title": "Missing authorization",
"status": 403,
"authorizationRequest": {
"url": "https://efactura.online/authorization-request/293847923",
"expiresInSeconds": 600
}
}
Query String Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| type | text, one of 'sent' or 'received' |
Whether it should retrieve sent or received invoices (from the company's perspective) | Yes |
| companyCode | text | An identifier issued by an official registrar that identifies the company as a legal entity or person. Unique identification code ( CUI for Romanian entities) | Yes |
| sinceTimestamp | unix timestamp (seconds) | Retrieve invoices generated after this time | Yes |
| redirectUrl | url | The URL where the user should be redirected after successful authorization with ANAF. Used in cases where the ANAF authorization expires, or doesn't exist. The end-user will be redirected to this URL after successful authorization in the ANAF system | No |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/json |
| Authorization | Bearer [access_token] |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
Body
[
{
"sysUuid": "65c0edc4adcbca796e0bfed0", // ID of the invoice in efactura's system
"type": "received", // can be "sent" or "received"
}
]
POST /ubl-invoice
Validate and send a new UBL XML Invoice to the Romanian Fiscal Authority (ANAF). The Supplier must have an account on https://efactura.online, and previously have authorized eFactura with ANAF. If ANAF authorization is missing, a 403 Forbidden response will be returned with the following body:
{
"type": "anaf_authorization_missing",
"title": "Missing ANAF authorization",
"status": 403,
"authorizationRequest": {
"url": "https://efactura.online/spv/authorize?sId=...&ret=..."
}
}
The Service Provider should redirect the user to the url included in the "authorizationRequest" response field where the user can authorize the app in ANAF. After successful authorization, user will be redirected to the redirectUrl provided when calling this service, where he should start the process again.
If Service Provider is not authorized to send invoices to ANAF in the name of the company making the request, a 403 Forbidden response will be returned. The Service Provider should use the "/company/authorization" endpoint in order to get an authorization from the end user to allow fetching invoices from ANAF in his name. Alternatively, the service provider can redirect the user to the url included in the authorizationRequest response field, where the user will grant access, after which he'll be redirected to the redirectUrl provided when calling this service, where he should start the process again. In such cases, the response will be:
{
"type": "missing_authorization",
"title": "Missing authorization",
"status": 403,
"authorizationRequest": {
"url": "https://efactura.online/authorization-request/293847923",
"expiresInSeconds": 600
}
}
Query String Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| self-invoice | text | A flag indicating that this is a self-invoice. 1,true,yes,y are interpreted as true. |
No |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/json |
| Content-Type | application/json |
| Authorization | Bearer [access_token] |
Body
{
"redirectUrl": "The URL where the user should be redirected after successful authorization with ANAF. This should be a webpage from the Service Provider, where the user can restart the process of sending this invoice",
"invoiceXml": "The invoice as base64-encoded XML, acording to RO CIUS specification"
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
Body
{
"sysUuid": "62d919f66f7dec655841b709", // ID of invoice from efactura
"status": "pending", // current status, can be "pending" or "processed"
"state": "-", // state, can be one of "-" (when status is "pending"), "ok" (everything went OK, invoice has been successfully processed), or "error" (ANAF reported an error while processing the invoice)
"anafIds": {
"idUpload": "", // ID returned by ANAF when sending an invoice. It will be an empty string if nothing is available. Only populated after the invoice is actually sent to ANAF
"idDownload": "", // ID made available after the successful processing of the invoice. Empty string if nothing is available. Only populated after the invoice is processed by ANAF
},
"anafErrors": [], // list of errors reported by ANAF when processing the invoice, if any
"invoiceXml": "", // base64-encoded string of the invoice's XML content
"signedInvoiceXml": "", // base64-encoded XML signature from ANAF, available if status = "processed" and state = "ok"
}
CompanyAuthorization
Receiving invoices from eFactura can be done only after a company has authorized you as a Service Provider
POST /company/authorization[/:code]
Obtain an URL where a customer user from a company should be redirected in order to authorize you as an eFactura service provider. The URL could be opened in a new browser page/tab or included inside an iframe. The code from the request URL is not mandatory. The expiresIn returned property contains the number of seconds until the request expires.
After submitting his option, the user will be redirected to the supplied redirectUrl field, with a querystring parameter named authorization_status which can have any of the values accepted or rejected.
Example:
https://service-provider-url.com?authorization_status=accepted
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| redirectUrl | url | Url to redirect the user after authorization process |
NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/json
application/*+json |
| Content-Type | application/json |
| Authorization | Bearer [access_token] |
Body
{
"redirectUrl": "https://myapp.com"
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/json
application/*+json |
Body
{
"url": "The URL where to redirect the user",
"expiresIn":600
}
GET /company/authorization[/:code]
Check if you are authorized for a given company. Please append the company code to the request route /company/authorization/[company code]
Request
Headers
| Header | Value |
|---|---|
| Accept | application/json
application/*+json |
| Authorization | Bearer [access_token] |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/json
application/*+json |
Body
{
"authorized": [true/false],
"authorizedForAnaf": [true/false] // Whether user has also provided authorization for fetching invoices from ANAF
}
DownloadInvoice
Generate invoice content based on the specified format.
GET /invoice/download/:id[/:format]
Based on the format supplied in the URI path (ubl, pdf, original, html) the response body will contain the invoice formatted accordingly. If no format is specified then ubl is used by default.
UBL 21 is one of the approved EN 16931 syntax.
Original format is the initial content of the document (if it's the case). Ex. if the invoice was initially sent to eFactura as an CII D16B document, it will be returned that way.
HTML format can be used to generate a quick view of the invoice
PDF with Content-Disposition header set
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.e-factura-api.v1+json
application/json
application/*+json |
| Authorization | Bearer [access_token] |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.e-factura-api.v1+json
application/json
application/*+json |
Body
XML, PDF or HTML content.
InvoiceInvitation
Send an invitation to a seller company on buyer's behalf. The seller will have access to a private upload form , where invoices could be uploaded.
POST /invoice/invitation
An email will be sent to the specified email address. The mail body contains an URL address where the seller could upload invoices. The email aslo contains a generated password that will be used in the upload form.
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| sellerCode | string | Unique identifier of the seller |
YES |
| buyerCode | Unique identifier of the buyer |
YES | |
| string | The email where the invitation will be sent |
YES |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.e-factura-api.v1+json
application/json
application/*+json |
| Content-Type | application/vnd.e-factura-api.v1+json
application/json |
| Authorization | Bearer [access_token] |
Body
{
"sellerCode":"[code]",
"buyerCode":"[code]",
"email":"[valid email]"
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.e-factura-api.v1+json
application/json
application/*+json |
Body
{
"message": "Invitation was successfully registered"
}
ValidateAndStore
Applies same validation process as described for validation endpoint.
Additionally, if the validation passes, the invoice is stored in the database.
POST /invoice/validate-and-store
Accepted syntaxes are UBL 21 and CII D16B The content of the invoice can be sent as base64 encoded text or as an file upload. One of the two fields is required.
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| fileContent | text | XML invoice content. It should be base64 encoded |
NO |
| file | file | XML file containing the invoice |
NO |
| sellerCode | string | The seller unique identity code (CUI). This must match the invoice seller. |
NO |
| buyerCode | string | The buyer unique identity code (CUI). This must match the invoice buyer. |
NO |
| ruleSet | text | Validate against rule set.Possible values: cius-ro|peppol-bis3|en16931. Default value is: cius-ro |
NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.e-factura-api.v1+json
application/json
application/*+json |
| Content-Type | application/vnd.e-factura-api.v1+json
application/json |
Body
{
"sellerCode": "The seller unique identity code (CUI). This must match the invoice seller.",
"buyerCode": "The buyer unique identity code (CUI). This must match the invoice buyer.",
"fileContent": "The content that we are going to validate. It should be base64 encoded"
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.e-factura-api.v1+json
application/json
application/*+json |
Body
Please see /invoice REST endpoint documentation.
ValidateInvoice
Validates an invoice content accordingly to the Romanian CIUS More info at : https://mfinante.gov.ro/ro/web/efactura/informatii-tehnice
POST /invoice/validate
Accepted syntaxes are UBL 21 and CII D16B The content of the invoice can be sent as base64 encoded text or as an file upload. One of the two fields is required.
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| fileContent | text | XML invoice content. It should be base64 encoded |
NO |
| file | file | XML file containing the invoice |
NO |
| ruleSet | text | Validate against rule set.Possible values: cius-ro|peppol-bis3|en16931. Default value is: cius-ro |
NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.e-factura-api.v1+json
application/json
application/*+json |
| Content-Type | application/vnd.e-factura-api.v1+json
application/json |
| Authorization | Bearer [access_token] |
Body
{
"fileContent": "The content that we are going to validate. It should be base64 encoded",
"ruleSet":"peppol-bis3|en16931|cius-ro"
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.e-factura-api.v1+json
application/json
application/*+json |
Body
{
"valid": true/false,
"errors" :[list of found issues]
}