Felhasználói eszközök

Eszközök a webhelyen


spec:crent

eVIR - C-Rent communication

Main goal: Create invoices based on the rental data from C-Rent

eVIR system access

API communication method

API Communication can be a single JSON object via POST method:

The posted content:

  {
    "token":".....",
    "dok":"hertz_crent_invoice_felvesz",
    "invoice":{ 
      "Partner":{ 
        ...
      },
      ...
  
    }
  }

The embedded JSON data structure of field invoice is detailed below.

Return values

The return value of the successful C-Rent → eVIR data transfer must be a JSON data structure in the following format:

[
  {
    "status":"OK",
    "invoice_id":9,
    .... (other elements)
  }
]

If eVIR could store the data then the return value contains the followings:

  • „status” key contains „OK” value.
  • „invoice_id” contains the internal ID of the transferred invoice data.

In case of missing „status” key with „OK” value, or the result is not a JSON object, then it means error, the data is not stored.

The structure may have additional fields.


Invoice JSON data structure

Example

{
  "Partner":{
    "Id": 183409,
    "Name": "BC.HU Kft.",
    "Type": "COMPANY",
    "TaxNumber": "23882991-2-42",
    "Address": {
      "Country": "HU",
      "PostalCode": "1155",
      "City": "Budapest",
      "StreetName": "Wysocki",
      "PublicPlaceCategory": "utca",
      "Number": "3"
    }
  },
  "Payments": [
    {
      "Id": "00600",
      "Method": "VIS",
      "Value": 127
    }
  ],
  "PaymentDate": "2021-06-31",
  "DeliveryDate": "2021-06-15",
  "GrossValue": 127,
  "Currency": "EUR",
  "ExchangeRate": 348.48,
  "Language": "HU",
  "Comment": "Example invoice",
  "InvoiceAppearance": "PAPER",
  "InvoiceLines": [
    {
      "Article": {
        "ArticleNumber": "HTZHU-28",
        "Description": "Renting a car",
        "UnitOfMeasure": "db",
        "Type": "SERVICE",
        "Vat": "27"
        "LedgerAccount": "93130",
      },
      "Quantity": 1,
      "NetValue": 100,
      "Comment": "Example comment"
    }
  ],
  "Contract": {
    "ContractNumber": "76999987",
    "ReservationNumber": "1278954765",
    "OfficeCode": "HUBUD14",
    "Cost": "54000",
    "Events": [
      {
        "PlateNumber": "ABC-123",
          "CarModel": "Opel",
          "CarCategory": "C",
          "CheckOut": {
            "OfficeCode": "HUBUD14",
            "Date": "2021-06-13",
            "Time": "09:35",
            "Km": 19975
          },
          "CheckIn":{
            "OfficeCode": "HUBUD14",
            "Date": "2021-06-14",
            "Time": "15:50",
            "Km": 21560
          },
          "PlannedKm": 1500
        }
      ],
      "Drivers":[
        {
          "Name": "Teszt Elek",
          "Email": "test@example.com"
        },
        {
          "Name": "Teszt Elekné"
        }
      ]
  }
}

Invoice Head

Fieldname Datatype Constraints Description Examples
Partner partner object mandatory Invoice is issued to this parnter
Payments Array of payment objects 1 or more elements mandatory
PaymentDate date Should not be less than current date 2021-08-31
DeliveryDate date 2021-08-15
GrossValue number Gross value calculated from lines, VAT included 6337
Currency currency EUR
ExchangeRate number If currency is HUF then this value must be 1.00 1 unit of the above currency is equivalent to X HUF 348.48
Language language The language of the invoice EN
Comment text - Free text, copied into comment of invoice
InvoiceId text - unique id of the invoice RE*-1 GS*-1 RE*-2 … RE769999876-1
InvoiceAppearance enum Currently only allowed value is 'PAPER' onleszamla 2.3.5. PAPER
InvoiceLines Array of invoice lines
Contract contract object

Invoice Line

Fieldname Datatype Constraints Description Examples
Article article object
Quantity number The quantity of the article 1
NetValue number The unit price of the article 4990.00
Comment text Comment for the invoice line

Partner object

fieldname Datatype Constraints Description Examples
Id Number Positive integer, Mandatory, not changing over time for the same partner Unique key 1025
Name text 90 character The name of the partner Example Ltd.
Type enum PERSON or COMPANY The type of the partner. COMPANY
TaxNumber tax number Hungarian domestic tax number 12345678-4-23
VatGroupMembership tax number Hungarian VAT group membership 98765432-5-23
CommunityVatNumber text 20 character Community vat number DE12345678
ThirdStateTaxId text 20 character Tax id outside of EU
Address address object Address

Address object

fieldname Datatype Constraints Description Examples
Country country Mandatory Address HU
PostalCode text 10 character, mandatory Postal code 2220
City text 40 character, mandatory City Vecsés
StreetName text 60 character, mandatory Street name Kossuth Lajos
PublicPlaceCategory text 40 character The category of the Hungarian public place (eg. street, avenue, square) utca
Number text 20 character 1
Building text 40 character
Staircase text 20 character
Floor text 20 character
Door text 20 character

Article object

fieldname Datatype Constraints Description Examples
ArticleNumber text 20 character Uniqe identifier of the article in the eVIR HTZHU-28
Description text 512 character Description of the article Car renting
UnitOfMeasure text 10 character Unit of measure, existing in the eVIR db
Type enum Only supported value: SERVICE SERVICE
Vat vat type Vat code 27
LedgerAccount text 10 number Ledger account number 93130

Payment object

fieldname Datatype Constraints Description Examples
Id text numbers Payment ID for DKS 00600
Method text must exist in eVIR
see table below
VIS
Value number amount paid 127
CardNumber text card number ???
AuthorizationCode text authorization code ???

Vat type

Vat type is a text value, maximum 20 character.

Value Description Example value Meaning
Integer Vat rate is X % 27 27% VAT
Text Vat rate is 0 %, Code expresses the reason of 0% VAT according to eVIR TAM See: onlineszamla 2.2.3.2.1.

Contract object

fieldname Datatype Constraints Description Examples
ContractNumber text Identifier of contract 769999876
ReservationNumber text Identifier of reservation
TacoIata text Taco/Iata
FrequentFlyer text Frequent flyer
OfficeCode text Valid office codes Office code HUBUD14
Cost text cost code needed by Mercur Cost code 54000
Events Array of renting event objects
Drivers Array of driver objects

Renting Event Object

fieldname Datatype Constraints Description Examples
PlateNumber text Plate number ABC-123
CarModel text Opel
CarCategory text C
CheckOut checkpoint object Check out event details
CheckIn checkpoint object Check in event details
PlannedKm Number Planned Km 150

Checkpoint Object

fieldname Datatype Constraints Description Examples
OfficeCode text Value office code Office code
Date date Date 2021-06-14
Time time Time 13:50
Km number Checkpoint Km

Driver Object

fieldname Datatype Constraints Description Examples
Name text
Email text Valid email address

OnlineSzamla

Constraints and values according to NAV Onlineszamla specifications …

Types

Basic types used at text scalar values.

They are represented as JSON text values.

Type Length Text Regexp Description Examples
date 10 [0-9]{4}-[0-9]{2}-[0-9]{2} Using the syntax YYYY-MM-DD (Year-Month-Day). Must be greate than 2010-01-01 2021-06-29
time 5 [0-9]{2}:[0-9]{2} Hour 0-23 Minute 0-59 09:59
currency 3 [A-Z]{3} The currency of the invoice according to configured currencies in eVIR EUR, HUF
language 2 [A-Z]{2} The language of the invoice. Currently supported values are only 'EN' and 'HU' EN
tax_number 13 [0-9]{8}-[1-5]-[0-9]{2} Tax number format used in Hungary 12345678-1-23
country 2 [A-Z]{2} Country code in ISO-3166 HU

Number

Number are used for money values. …

C-rent -> eVIR -> DKS data export

New fields:

  • Payments.*.CardNumber
  • Payments.*.AuthorizationCode

VAT exemption codes

code description
AAM Personal tax exemption
TAM “tax-exempt activity” or tax-exempt due to being in public interest or special in nature
KBAET intra-Community exempt supply, without new means of transport
KBAUK tax-exempt, intra-Community sales of new means of transport
EAM tax-exempt, extra-Community sales of goods (export of goods to a non-EU country)
NAM tax-exempt on other grounds related to international transactions
ATK Outside the scope of VAT
EUFAD37 Based on section 37 of the VAT Act, a reverse charge transaction carried out in another Member State
EUFADE Reverse charge transaction carried out in another Member State, not subject to Section 37 of the VAT Act
EUE Non-reverse charge transaction performed in another Member State
HO Transaction in a third country

Payment methods

For information only, these payment methods currently exist in eVIR:

Method Description in eVIR
AMX American Express
VIS Visa Card
EAS Europ Assistance
CSH Cash-Eurocheque
CTW Cartrawler
HCC Hertz Cred.Card/OTTO
VCH Voucher
DIN Diners Club
CRE Bank Transfer
TRF TRF
T00 Banki átutalás
T14 átutalás(14)
T15 15 napos banki átutalás
T30 30 napos banki átutalás
T04 4 napos banki átutalás
T08 8 napos banki átutalás
EUR Eurocard/Mastercard

IVCRE table

Field Type Description Source example
CRFIR N2 System type eVIR 10: production 99:devel/test
CRBKZ C eVIR F T
CRRED D Issue date of invoice eVIR 20220401
CREVIR C8 Invoice number eVIR S0000001
CRART C2 eVIR RA GS ZA
CRZKS C/N Payer customer id C-Rent 00600
CRZKH C/N Income customer id C-Rent 214183
CRKDN C/N Customer id C-Rent 214183
CRSAK N Ledger account number C-Rent 93130
CRZAC C3 HUF eVIR HUF
CRGSN N HUF Net amount eVIR
CRGSS N HUF VAT amount eVIR
CGGSB N HUF Gross Amount eVIR
CRZAF C3 Currency C-Rent EUR
CRKUR N Exchange rate C-Rent 348.48
CFGFN N Net amount C-Rent
CFGFS N VAT amount eVIR
CFGFB N Gross amount eVIR
CRSTC C3 VAT code C-Rent F27
CRFAD D Payment date C-Rent 20220415
CRFAT N days between payment and invoice issue date eVIR 14
CRKOS C/N Cost code C-Rent 54000
CRKZ1 C Plate number C-Rent XMPL01
CRTEX C Free text C-Rent
CREVIRO C Modified invoice number C-Rent
CRCCZM C Payment method? C-Rent
CRAUTOR C Authorization code? C-Rent
CRCRNUM C Contract number C-Rent RE866711746-1
CRDKUKZ C -
CRDKUDT N - 0
Abbreviation Type
Cn Character with length (n)
Nn Numeric with length (n)
D Date in format YYYYMMDD
Keyword
eVIR generated by eVIR
C-Rent C-Rent provide

spec/crent.txt · Utolsó módosítás: 2022/11/30 23:13 szerkesztette: royal