The application requires an IIS server with .NET Framework 4 installed.
The application accepts a formalized XML request in accordance with the attached schema. The XML request contains authentication information for Aviabit and a set of input parameters. After processing, the application returns an XML response in accordance with the attached schema. The web services were developed using an object-oriented approach.
The web service is intended for importing payment data from an accounting system or third-party applications into Aviabit. The complete description of the web service can be found by opening the following page:
http://<server-address>/ImportPays.asmx?wsdl.
In addition to the authentication methods, the web service contains the following methods:
The CustomerPay object is returned by the GetCustomerPays method and contains the fields listed in the table below.
| Field | Data Type | Description |
|---|---|---|
| RecordID | Number | Payment ID |
| CompanyID | Number | Customer ID |
| Company | String | Customer name |
| CompanyInn | String | Customer taxpayer identification number |
| CompanyKpp | String | Customer tax registration reason code |
| CompanyCodeAccount | String | Customer accounting code |
| CurrencyID | Number | Currency type |
| Currency | String | Currency name |
| CurrencyCode | String | Currency code |
| CurrencyCodeISO | Number | ISO currency code |
| ContractID | Number | Contract ID |
| ContractName | String | Internal contract name |
| ContractNameAlter | String | External contract name |
| DatePay | Date | Payment date, without time |
| AccountType | Number | 0 - planned transfer amount, 1 - actual amount |
| Comment | String | Additional information |
| Amount | Decimal number | Amount including VAT |
| AmountTax | Decimal number | VAT amount |
The CustomerBalance object is returned by the GetCustomerBalances method and contains the fields listed in the table below.
| Field | Data Type | Description |
|---|---|---|
| RecordID | Number | Balance ID |
| CompanyID | Number | Customer ID |
| Company | String | Customer name |
| CompanyInn | String | Customer taxpayer identification number |
| CompanyKpp | String | Customer tax registration reason code |
| CompanyCodeAccount | String | Customer accounting code |
| CurrencyID | Number | Currency type |
| Currency | String | Currency name |
| CurrencyCode | String | Currency code |
| CurrencyCodeISO | Number | ISO currency code |
| ContractID | Number | Contract ID |
| ContractName | String | Internal contract name |
| ContractNameAlter | String | External contract name |
| DateBalance | Date | Balance date, without time |
| Comment | String | Additional information |
| Amount | Decimal number | Amount including VAT |
| AccountType | Number | 0 - planned transfer amount, 1 - actual amount |
The SupplierPay object is returned by the GetSupplierPays method and contains the fields listed in the table below.
| Field | Data Type | Description |
|---|---|---|
| RecordID | Number | Payment ID |
| CompanyID | Number | Supplier ID |
| Company | String | Supplier name |
| CompanyInn | String | Supplier taxpayer identification number |
| CompanyKpp | String | Supplier tax registration reason code |
| CompanyCodeAccount | String | Supplier accounting code |
| CurrencyID | Number | Currency type |
| Currency | String | Currency name |
| CurrencyCode | String | Currency code |
| CurrencyCodeISO | Number | ISO currency code |
| ContractID | Number | Contract ID |
| ContractName | String | Internal contract name |
| ContractNameAlter | String | External contract name |
| DatePay | Date | Payment date, without time |
| AccountType | Number | 0 - planned transfer amount, 1 - actual amount |
| Comment | String | Additional information |
| Amount | Decimal number | Amount including VAT |
| AmountTax | Decimal number | VAT amount |
The SupplierBalance object is returned by the GetSupplierBalances method and contains the fields listed in the table below.
| Field | Data Type | Description |
|---|---|---|
| RecordID | Number | Balance ID |
| CompanyID | Number | Supplier ID |
| Company | String | Supplier name |
| CompanyInn | String | Supplier taxpayer identification number |
| CompanyKpp | String | Supplier tax registration reason code |
| CompanyCodeAccount | String | Supplier accounting code |
| CurrencyID | Number | Currency type |
| Currency | String | Currency name |
| CurrencyCode | String | Currency code |
| CurrencyCodeISO | Number | ISO currency code |
| ContractID | Number | Contract ID |
| ContractName | String | Internal contract name |
| ContractNameAlter | String | External contract name |
| DateBalance | Date | Balance date, without time |
| Comment | String | Additional information |
| Amount | Decimal number | Amount including VAT |
| AccountType | Number | 0 - planned transfer amount, 1 - actual amount |
The AgencyPay object is returned by the GetAgencyPays method and contains the fields listed in the table below.
| Field | Data Type | Description |
|---|---|---|
| RecordID | Number | Payment ID |
| CompanyID | Number | Supplier ID |
| Company | String | Supplier name |
| CompanyInn | String | Supplier taxpayer identification number |
| CompanyKpp | String | Supplier tax registration reason code |
| CompanyCodeAccount | String | Supplier accounting code |
| CurrencyID | Number | Currency type |
| Currency | String | Currency name |
| CurrencyCode | String | Currency code |
| CurrencyCodeISO | Number | ISO currency code |
| ContractID | Number | Contract ID from the GetTicketContracts method |
| ContractName | String | Internal contract name from the GetTicketContracts method |
| DatePay | Date | Payment date, without time |
| AccountType | Number | 0 - planned transfer amount, 1 - actual amount |
| Comment | String | Additional information |
| Amount | Decimal number | Amount including VAT |
| AmountTax | Decimal number | VAT amount |
The AgencyBalance object is returned by the GetAgencyBalances method and contains the fields listed in the table below.
| Field | Data Type | Description |
|---|---|---|
| RecordID | Number | Balance ID |
| CompanyID | Number | Supplier ID |
| Company | String | Supplier name |
| CompanyInn | String | Supplier taxpayer identification number |
| CompanyKpp | String | Supplier tax registration reason code |
| CompanyCodeAccount | String | Supplier accounting code |
| CurrencyID | Number | Currency type |
| Currency | String | Currency name |
| CurrencyCode | String | Currency code |
| CurrencyCodeISO | Number | ISO currency code |
| ContractID | Number | Contract ID from the GetTicketContracts method |
| ContractName | String | Internal contract name from the GetTicketContracts method |
| DateBalance | Date | Balance date, without time |
| Comment | String | Additional information |
| Amount | Decimal number | Amount including VAT |
| AccountType | Number | 0 - planned transfer amount, 1 - actual amount |
The ContractRequest object is returned by the GetContractRequests method and contains the fields listed in the table below.
| Field | Data Type | Description |
|---|---|---|
| RecordID | Number | Request ID |
| CompanyID | Number | Customer ID |
| Company | String | Customer name |
| CompanyInn | String | Customer taxpayer identification number |
| CompanyKpp | String | Customer tax registration reason code |
| CompanyCodeAccount | String | Customer accounting code |
| ContractID | Number | Contract ID |
| ContractName | String | Internal contract name |
| ContractNameAlter | String | External contract name |
| Name | String | Request name/number |
| DateBegin | Date | Request validity start date |
| DateEnd | Date | Request validity end date |
| Date | Date | Request date |
| Comment | String | Additional information |
The GetCompanys method returns a list of Companys objects. This object represents a company card containing the following information:
| Field | Data Type | Description |
|---|---|---|
| ID | Number | Company ID in Aviabit |
| Name | String | Name |
| NameEng | String | English name |
| FullName | String | Full name |
| FullNameEng | String | Full English name |
| Code | String | Code |
| CodeEng | String | English code |
| INN | String | Taxpayer identification number |
| CodeOKPO | String | OKPO code |
| CodeICAO | String | ICAO code |
| CodeIATA | String | IATA code |
| CodeTKP | String | TKP code |
| CodeCRT | String | CRT code |
| CodeAccount | String | Accounting code |
| ActivityType | String | Activity type, abbreviated |
The GetCurrencyTypes method returns a list of CurrencyTypes objects. This object represents a short reference directory of currency types containing the following information:
| Field | Data Type | Description |
|---|---|---|
| ID | Number | Company ID in Aviabit |
| Name | String | Name |
| NameEng | String | English name |
| Code | String | Code |
| CodeEng | String | English code |
| CodeISONumeric | Number | ISO currency code |
The GetContracts method returns a list of Contract objects. This object represents a short reference directory of contracts containing the following information:
| Field | Data Type | Description |
|---|---|---|
| ID | Number | Contract ID in Aviabit |
| CompanyID | Number | Company ID under the contract |
| CurrencyTypeID | Number | Currency type ID |
| Name | String | Internal name |
| NameAlter | String | External name |
| Comment | String | Additional information |
| DateBegin | Date | Validity start date |
| DateEnd | Date | Validity end date |
| DateIssue | Date | Signing date |
The GetTicketContracts method returns a list of TicketContract objects. The data source is the Agency Contracts reference directory (Airline Finance System → Card Files → Contracts → Transportation Sales → Sales Conditions). The object contains the following information:
| Field | Data Type | Description |
|---|---|---|
| ID | Number | Contract ID in Aviabit |
| CompanyID | Number | Company ID under the contract |
| CurrencyTypeID | Number | Revenue transfer currency type ID; may be omitted |
| Name | String | Internal name |
| Comment | String | Additional information |
| DateBegin | Date | Validity start date |
| DateEnd | Date | Validity end date |
| DateIssue | Date | Signing date |
| CompanyIDRecipient | Number | ID of the company receiving the revenue |
| ContractType | Number | Contract type: agency or carriage contract |
| ContractSign | Number | Contract sign: initial signing, amendment, or re-execution |
| Standard | Boolean | Do not use |
| StandardType | Number | Do not use |
| CodeAgent | String | Do not use |
| CodeAccount | String | Do not use |
| Mark | String | Do not use |
Methods for recording payments in the system (CreateCustomerPay, CreateSupplierPay, CreateAgencyPay) return a status as an enumeration. It can take the following values:
| Success = 0 | Successfully recorded |
| OtherError = 1 | An unexpected error occurred |
| UserUndefined = 2 | An attempt is being made to record data without prior authentication |
| ContractUndefined = 3 | Contract not found |
| ContractRequestUndefined = 4 | Request not found |
Methods for recording opening balances in the system (CreateCustomerBalance, CreateSupplierBalance, CreateAgencyBalance) return a status as an enumeration. It can take the following values:
| Success = 0 | Successfully recorded |
| OtherError = 1 | An unexpected error occurred |
| UserUndefined = 2 | An attempt is being made to record data without prior authentication |
| ContractUndefined = 3 | Contract not found |
| ContractRequestUndefined = 4 | Request not found |
Methods for deleting acts and services return the deletion status as an enumeration. It can take the following values:
| Success = 0 | Successfully deleted |
| NotFound = 1 | Record not found |
| Error = 2 | An error occurred during deletion |
The AuthHeader object has a single text property field, AuthenticatedToken, which receives a special key (session identifier) after authentication is performed. This object must be created, initialized by calling the Login method, and then passed as one of the parameters to all methods used.
Authentication on the web service is performed by calling the Login(String UserName, String Password) method, to which two text parameters are passed: the user name and password. One of the user accounts in Aviabit is used for these parameters.
!!! An important requirement is that the group to which this user account belongs must have rights to work with the web service. To do this, log in as an administrator, open the “User Groups” window, press “Enter” on the relevant group, select the “Access Rights to System Sections” menu item, and add access to “Accounting System Web Service”.
If authentication is successful, a string containing the session identifier is returned.
The session identifier must be passed as one of the parameters on each method call.
To end a session with the system, call the Logout(AuthHeader authHeader) method, passing the previously created AuthHeader object as a parameter.
Using the GetCurrencyTypes, GetCompanys, GetContracts, and GetTicketContracts methods, you can retrieve the contents of the system reference directories for further use. All listed methods accept a single input parameter: AuthHeader. The method returns the corresponding data objects (CurrencyType, Company, Contract, TicketContract).
Example call:
GetCurrencyTypes(AuthHeader authHeader)
To retrieve the list of requests, call the GetContractRequests(AuthHeader authHeader, int? contractID, int? contractRequestID, int? companyID, DateTime dateBegin, DateTime dateEnd) method.
The following objects must be passed as input: AuthHeader received as a result of authentication, and the selection period. If the contractID, contractRequestID, or companyID parameters are specified, the request will be filtered by contract, request ID, or customer respectively.
Parameter values:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| ContractID | Number | Contract ID; pass null or 0 if not required |
| ContractRequestID | Number | Request ID; pass null or 0 if not required |
| companyID | Number | Customer ID; pass null or 0 if not required |
| dateBegin | Date | Specify for exporting documents where Issue Date 1 is greater than or equal to this value |
| dateEnd | Date | Specify for exporting documents where Issue Date 1 is less than or equal to this value |
To retrieve payment information, call the GetCustomerPays(AuthHeader authHeader, int? customerPayID, DateTime dateBegin, DateTime dateEnd) method.
The following objects must be passed as input: AuthHeader received as a result of authentication, and the selection period. If the customerPayID parameter is specified, the service will return the record for a specific payment.
Parameter values:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| customerPayID | Number | Payment ID; optional parameter |
| dateBegin | Date | Specify for exporting documents where Issue Date 1 is greater than or equal to this value |
| dateEnd | Date | Specify for exporting documents where Issue Date 1 is less than or equal to this value |
The CreateCustomerPay method is intended for adding a payment to the system. The method call format is as follows:
CreateCustomerPay(AuthHeader authHeader, int CompanyID, int CurrencyTypeID, DateTime DatePay, double Amount, double AmountTax, string Comment, int? ContractID, int? ContractRequestID)
The method returns information about the addition in a SyncPay object.
Method parameter description:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| CompanyID | Number | Specify the customer ID from the Companys reference directory |
| CurrencyTypeID | Number | Specify the currency type ID from the CurrencyTypes reference directory |
| DatePay | Date | Payment date |
| Amount | Decimal number | Payment amount including VAT |
| AmountTax | Decimal number | VAT amount |
| Comment | String | Additional payment information |
| ContractID | Number | Contract ID; pass null or 0 if not required |
| ContractRequestID | Number | Request ID; pass null or 0 if not required |
All parameters are required.
If the information is successfully added, the method returns SyncPay, where the RecordID field contains the ID of the added payment (0 if the information was not added). If the payment is not created, the most likely reason is incorrect input data.
The DeleteCustomerPay method allows you to delete previously added payment information. The method allows only data created via the web service to be deleted. As a result of method execution, a DeleteStatus object is returned.
Method call format:
DeleteCustomerPay(AuthHeader authHeader, int customerPayID)
customerPayID is the ID of the added payment.
To retrieve information on “opening balances”, call the GetCustomerBalances(AuthHeader authHeader, int? customerBalanceID, DateTime dateBegin, DateTime dateEnd) method.
The following objects must be passed as input: AuthHeader received as a result of authentication, and the selection period. If the customerBalanceID parameter is specified, the service will return the record for a specific balance.
Parameter values:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| customerBalanceID | Number | Balance ID; optional parameter |
| dateBegin | Date | Specify for exporting documents where Issue Date 1 is greater than or equal to this value |
| dateEnd | Date | Specify for exporting documents where Issue Date 1 is less than or equal to this value |
The CreateCustomerBalance method is intended for adding an opening balance to the system. The method call format is as follows:
CreateCustomerBalance(AuthHeader authHeader, int CompanyID, int CurrencyTypeID, DateTime DateBalance, double Amount, string Comment, int? ContractID, int? ContractRequestID)
The method returns information about the addition in a SyncBalance object.
Method parameter description:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| CompanyID | Number | Specify the customer ID from the Companys reference directory |
| CurrencyTypeID | Number | Specify the currency type ID from the CurrencyTypes reference directory |
| DateBalance | Date | Balance date |
| Amount | Decimal number | Balance amount |
| Comment | String | Additional balance information |
| ContractID | Number | Contract ID; pass null or 0 if not required |
| ContractRequestID | Number | Request ID; pass null or 0 if not required |
All parameters are required.
If the information is successfully added, the method returns SyncBalance, where the RecordID field contains the ID of the added payment (0 if the information was not added). If the payment is not created, the most likely reason is incorrect input data.
The DeleteCustomerBalance method allows you to delete previously added balance information. The method allows only data created via the web service to be deleted. As a result of method execution, a DeleteStatus object is returned.
Method call format:
DeleteCustomerBalance(AuthHeader authHeader, int customerBalanceID)
customerBalanceID is the ID of the previously added balance.
To retrieve supplier payment information, call the GetSupplierPays(AuthHeader authHeader, int? supplierPayID, DateTime dateBegin, DateTime dateEnd) method.
The following objects must be passed as input: AuthHeader received as a result of authentication, and the selection period. If the supplierPayID parameter is specified, the service will return the record for a specific payment.
Parameter values:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| supplierPayID | Number | Payment ID; optional parameter |
| dateBegin | Date | Specify for exporting documents where Issue Date 1 is greater than or equal to this value |
| dateEnd | Date | Specify for exporting documents where Issue Date 1 is less than or equal to this value |
The CreateSupplierPay method is intended for adding a payment to the system. The method call format is as follows:
CreateSupplierPay(AuthHeader authHeader, int CompanyID, int CurrencyTypeID, DateTime DatePay, double Amount, double AmountTax, string Comment, int? ContractID)
The method returns information about the addition in a SyncPay object.
Method parameter description:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| CompanyID | Number | Specify the supplier ID from the Companys reference directory |
| CurrencyTypeID | Number | Specify the currency type ID from the CurrencyTypes reference directory |
| DatePay | Date | Payment date |
| Amount | Decimal number | Payment amount including VAT |
| AmountTax | Decimal number | VAT amount |
| Comment | String | Additional payment information |
| ContractID | Number | Contract ID; pass null or 0 if not required |
All parameters are required.
If the information is successfully added, the method returns SyncPay, where the RecordID field contains the ID of the added payment (0 if the information was not added). If the payment is not created, the most likely reason is incorrect input data.
The DeleteSupplierPay method allows you to delete previously added payment information. The method allows only data created via the web service to be deleted. As a result of method execution, a DeleteStatus object is returned.
Method call format:
DeleteSupplierPay(AuthHeader authHeader, int supplierPayID)
supplierPayID is the ID of the added payment.
To retrieve information on “opening balances”, call the GetSupplierBalances(AuthHeader authHeader, int? supplierBalanceID, DateTime dateBegin, DateTime dateEnd) method.
The following objects must be passed as input: AuthHeader received as a result of authentication, and the selection period. If the supplierBalanceID parameter is specified, the service will return the record for a specific balance.
Parameter values:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| supplierBalanceID | Number | Balance ID; optional parameter |
| dateBegin | Date | Specify for exporting documents where Issue Date 1 is greater than or equal to this value |
| dateEnd | Date | Specify for exporting documents where Issue Date 1 is less than or equal to this value |
The CreateSupplierBalance method is intended for adding an opening balance to the system. The method call format is as follows:
CreateSupplierBalance(AuthHeader authHeader, int CompanyID, int CurrencyTypeID, DateTime DateBalance, double Amount, string Comment, int? ContractID)
The method returns information about the addition in a SyncBalance object.
Method parameter description:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| CompanyID | Number | Specify the customer ID from the Companys reference directory |
| CurrencyTypeID | Number | Specify the currency type ID from the CurrencyTypes reference directory |
| DateBalance | Date | Balance date |
| Amount | Decimal number | Balance amount |
| Comment | String | Additional balance information |
| ContractID | Number | Contract ID; pass null or 0 if not required |
All parameters are required.
If the information is successfully added, the method returns SyncBalance, where the RecordID field contains the ID of the added payment (0 if the information was not added). If the payment is not created, the most likely reason is incorrect input data.
The DeleteSupplierBalance method allows you to delete previously added balance information. The method allows only data created via the web service to be deleted. As a result of method execution, a DeleteStatus object is returned.
Method call format:
DeleteSupplierBalance(AuthHeader authHeader, int supplierBalanceID)
supplierBalanceID is the ID of the previously added balance.
To retrieve payment information, call the GetAgencyPays(AuthHeader authHeader, int? agencyPayID, DateTime dateBegin, DateTime dateEnd) method.
The following objects must be passed as input: AuthHeader received as a result of authentication, and the selection period. If the agencyPayID parameter is specified, the service will return the record for a specific payment.
Parameter values:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| agencyPayID | Number | Payment ID; optional parameter |
| dateBegin | Date | Specify for exporting documents where Issue Date 1 is greater than or equal to this value |
| dateEnd | Date | Specify for exporting documents where Issue Date 1 is less than or equal to this value |
The CreateAgencyPay method is intended for adding a payment to the system. The method call format is as follows:
CreateAgencyPay(AuthHeader authHeader, int CompanyID, int CurrencyTypeID, DateTime DatePay, double Amount, double AmountTax, string Comment, int? ContractID)
The method returns information about the addition in a SyncPay object.
Method parameter description:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| CompanyID | Number | Specify the agent ID from the Companys reference directory |
| CurrencyTypeID | Number | Specify the currency type ID from the CurrencyTypes reference directory |
| DatePay | Date | Payment date |
| Amount | Decimal number | Payment amount including VAT |
| AmountTax | Decimal number | VAT amount |
| Comment | String | Additional payment information |
| ContractID | Number | Contract ID; pass null or 0 if not required; must correspond to TicketContract |
All parameters are required.
If the information is successfully added, the method returns SyncPay, where the RecordID field contains the ID of the added payment (0 if the information was not added). If the payment is not created, the most likely reason is incorrect input data.
The DeleteAgencyPay method allows you to delete previously added payment information. The method allows only data created via the web service to be deleted. As a result of method execution, a DeleteStatus object is returned.
Method call format:
DeleteAgencyPay(AuthHeader authHeader, int agencyPayID)
agencyPayID is the ID of the added payment.
To retrieve information on “opening balances”, call the GetAgencyBalances(AuthHeader authHeader, int? agencyBalanceID, DateTime dateBegin, DateTime dateEnd) method.
The following objects must be passed as input: AuthHeader received as a result of authentication, and the selection period. If the agencyBalanceID parameter is specified, the service will return the record for a specific balance.
Parameter values:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| agencyBalanceID | Number | Balance ID; optional parameter |
| dateBegin | Date | Specify for exporting documents where Issue Date 1 is greater than or equal to this value |
| dateEnd | Date | Specify for exporting documents where Issue Date 1 is less than or equal to this value |
The CreateAgencyBalance method is intended for adding an opening balance to the system. The method call format is as follows:
CreateAgencyBalance(AuthHeader authHeader, int CompanyID, int CurrencyTypeID, DateTime DateBalance, double Amount, string Comment, int? ContractID)
The method returns information about the addition in a SyncBalance object.
Method parameter description:
| Field | Data Type | Description |
|---|---|---|
| authHeader | AuthHeader | Authorization header |
| CompanyID | Number | Specify the agent ID from the Companys reference directory |
| CurrencyTypeID | Number | Specify the currency type ID from the CurrencyTypes reference directory |
| DateBalance | Date | Balance date |
| Amount | Decimal number | Balance amount |
| Comment | String | Additional balance information |
| ContractID | Number | Contract ID; pass null or 0 if not required; must correspond to TicketContract |
All parameters are required.
If the information is successfully added, the method returns SyncBalance, where the RecordID field contains the ID of the added payment (0 if the information was not added). If the payment is not created, the most likely reason is incorrect input data.
The DeleteAgencyBalance method allows you to delete previously added balance information. The method allows only data created via the web service to be deleted. As a result of method execution, a DeleteStatus object is returned.
Method call format:
DeleteAgencyBalance(AuthHeader authHeader, int agencyBalanceID)
agencyBalanceID is the ID of the previously added balance.