Table of Contents

Payment Import

Overview

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.

Web Service Description

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:


Data Object Description

1.1. Customer Payment Object CustomerPay

The CustomerPay object is returned by the GetCustomerPays method and contains the fields listed in the table below.

FieldData TypeDescription
RecordIDNumberPayment ID
CompanyIDNumberCustomer ID
CompanyStringCustomer name
CompanyInnStringCustomer taxpayer identification number
CompanyKppStringCustomer tax registration reason code
CompanyCodeAccountStringCustomer accounting code
CurrencyIDNumberCurrency type
CurrencyStringCurrency name
CurrencyCodeStringCurrency code
CurrencyCodeISONumberISO currency code
ContractIDNumberContract ID
ContractNameStringInternal contract name
ContractNameAlterStringExternal contract name
DatePayDatePayment date, without time
AccountTypeNumber0 - planned transfer amount, 1 - actual amount
CommentStringAdditional information
AmountDecimal numberAmount including VAT
AmountTaxDecimal numberVAT amount

1.2. Customer Opening Balance Object CustomerBalance

The CustomerBalance object is returned by the GetCustomerBalances method and contains the fields listed in the table below.

FieldData TypeDescription
RecordIDNumberBalance ID
CompanyIDNumberCustomer ID
CompanyStringCustomer name
CompanyInnStringCustomer taxpayer identification number
CompanyKppStringCustomer tax registration reason code
CompanyCodeAccountStringCustomer accounting code
CurrencyIDNumberCurrency type
CurrencyStringCurrency name
CurrencyCodeStringCurrency code
CurrencyCodeISONumberISO currency code
ContractIDNumberContract ID
ContractNameStringInternal contract name
ContractNameAlterStringExternal contract name
DateBalanceDateBalance date, without time
CommentStringAdditional information
AmountDecimal numberAmount including VAT
AccountTypeNumber0 - planned transfer amount, 1 - actual amount

1.3. Supplier Payment Object SupplierPay

The SupplierPay object is returned by the GetSupplierPays method and contains the fields listed in the table below.

FieldData TypeDescription
RecordIDNumberPayment ID
CompanyIDNumberSupplier ID
CompanyStringSupplier name
CompanyInnStringSupplier taxpayer identification number
CompanyKppStringSupplier tax registration reason code
CompanyCodeAccountStringSupplier accounting code
CurrencyIDNumberCurrency type
CurrencyStringCurrency name
CurrencyCodeStringCurrency code
CurrencyCodeISONumberISO currency code
ContractIDNumberContract ID
ContractNameStringInternal contract name
ContractNameAlterStringExternal contract name
DatePayDatePayment date, without time
AccountTypeNumber0 - planned transfer amount, 1 - actual amount
CommentStringAdditional information
AmountDecimal numberAmount including VAT
AmountTaxDecimal numberVAT amount

1.4. Supplier Opening Balance Object SupplierBalance

The SupplierBalance object is returned by the GetSupplierBalances method and contains the fields listed in the table below.

FieldData TypeDescription
RecordIDNumberBalance ID
CompanyIDNumberSupplier ID
CompanyStringSupplier name
CompanyInnStringSupplier taxpayer identification number
CompanyKppStringSupplier tax registration reason code
CompanyCodeAccountStringSupplier accounting code
CurrencyIDNumberCurrency type
CurrencyStringCurrency name
CurrencyCodeStringCurrency code
CurrencyCodeISONumberISO currency code
ContractIDNumberContract ID
ContractNameStringInternal contract name
ContractNameAlterStringExternal contract name
DateBalanceDateBalance date, without time
CommentStringAdditional information
AmountDecimal numberAmount including VAT
AccountTypeNumber0 - planned transfer amount, 1 - actual amount

1.5. Agent Payment Object AgencyPay

The AgencyPay object is returned by the GetAgencyPays method and contains the fields listed in the table below.

FieldData TypeDescription
RecordIDNumberPayment ID
CompanyIDNumberSupplier ID
CompanyStringSupplier name
CompanyInnStringSupplier taxpayer identification number
CompanyKppStringSupplier tax registration reason code
CompanyCodeAccountStringSupplier accounting code
CurrencyIDNumberCurrency type
CurrencyStringCurrency name
CurrencyCodeStringCurrency code
CurrencyCodeISONumberISO currency code
ContractIDNumberContract ID from the GetTicketContracts method
ContractNameStringInternal contract name from the GetTicketContracts method
DatePayDatePayment date, without time
AccountTypeNumber0 - planned transfer amount, 1 - actual amount
CommentStringAdditional information
AmountDecimal numberAmount including VAT
AmountTaxDecimal numberVAT amount

1.6. Agent Opening Balance Object AgencyBalance

The AgencyBalance object is returned by the GetAgencyBalances method and contains the fields listed in the table below.

FieldData TypeDescription
RecordIDNumberBalance ID
CompanyIDNumberSupplier ID
CompanyStringSupplier name
CompanyInnStringSupplier taxpayer identification number
CompanyKppStringSupplier tax registration reason code
CompanyCodeAccountStringSupplier accounting code
CurrencyIDNumberCurrency type
CurrencyStringCurrency name
CurrencyCodeStringCurrency code
CurrencyCodeISONumberISO currency code
ContractIDNumberContract ID from the GetTicketContracts method
ContractNameStringInternal contract name from the GetTicketContracts method
DateBalanceDateBalance date, without time
CommentStringAdditional information
AmountDecimal numberAmount including VAT
AccountTypeNumber0 - planned transfer amount, 1 - actual amount

1.7. Request Object ContractRequest

The ContractRequest object is returned by the GetContractRequests method and contains the fields listed in the table below.

FieldData TypeDescription
RecordIDNumberRequest ID
CompanyIDNumberCustomer ID
CompanyStringCustomer name
CompanyInnStringCustomer taxpayer identification number
CompanyKppStringCustomer tax registration reason code
CompanyCodeAccountStringCustomer accounting code
ContractIDNumberContract ID
ContractNameStringInternal contract name
ContractNameAlterStringExternal contract name
NameStringRequest name/number
DateBeginDateRequest validity start date
DateEndDateRequest validity end date
DateDateRequest date
CommentStringAdditional information

1.8. Company Object Companys

The GetCompanys method returns a list of Companys objects. This object represents a company card containing the following information:

FieldData TypeDescription
IDNumberCompany ID in Aviabit
NameStringName
NameEngStringEnglish name
FullNameStringFull name
FullNameEngStringFull English name
CodeStringCode
CodeEngStringEnglish code
INNStringTaxpayer identification number
CodeOKPOStringOKPO code
CodeICAOStringICAO code
CodeIATAStringIATA code
CodeTKPStringTKP code
CodeCRTStringCRT code
CodeAccountStringAccounting code
ActivityTypeStringActivity type, abbreviated

1.9. Currency Types Object CurrencyTypes

The GetCurrencyTypes method returns a list of CurrencyTypes objects. This object represents a short reference directory of currency types containing the following information:

FieldData TypeDescription
IDNumberCompany ID in Aviabit
NameStringName
NameEngStringEnglish name
CodeStringCode
CodeEngStringEnglish code
CodeISONumericNumberISO currency code

1.10. Contract Object Contract

The GetContracts method returns a list of Contract objects. This object represents a short reference directory of contracts containing the following information:

FieldData TypeDescription
IDNumberContract ID in Aviabit
CompanyIDNumberCompany ID under the contract
CurrencyTypeIDNumberCurrency type ID
NameStringInternal name
NameAlterStringExternal name
CommentStringAdditional information
DateBeginDateValidity start date
DateEndDateValidity end date
DateIssueDateSigning date

1.11. Agency Contract Object TicketContract

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:

FieldData TypeDescription
IDNumberContract ID in Aviabit
CompanyIDNumberCompany ID under the contract
CurrencyTypeIDNumberRevenue transfer currency type ID; may be omitted
NameStringInternal name
CommentStringAdditional information
DateBeginDateValidity start date
DateEndDateValidity end date
DateIssueDateSigning date
CompanyIDRecipientNumberID of the company receiving the revenue
ContractTypeNumberContract type: agency or carriage contract
ContractSignNumberContract sign: initial signing, amendment, or re-execution
StandardBooleanDo not use
StandardTypeNumberDo not use
CodeAgentStringDo not use
CodeAccountStringDo not use
MarkStringDo not use

1.12. Customer Payment Data Recording Status SyncPay

Methods for recording payments in the system (CreateCustomerPay, CreateSupplierPay, CreateAgencyPay) return a status as an enumeration. It can take the following values:

Success = 0Successfully recorded
OtherError = 1An unexpected error occurred
UserUndefined = 2An attempt is being made to record data without prior authentication
ContractUndefined = 3Contract not found
ContractRequestUndefined = 4Request not found

1.13. Customer Opening Balance Data Recording Status SyncBalance

Methods for recording opening balances in the system (CreateCustomerBalance, CreateSupplierBalance, CreateAgencyBalance) return a status as an enumeration. It can take the following values:

Success = 0Successfully recorded
OtherError = 1An unexpected error occurred
UserUndefined = 2An attempt is being made to record data without prior authentication
ContractUndefined = 3Contract not found
ContractRequestUndefined = 4Request not found

1.14. Deletion Status DeleteStatus

Methods for deleting acts and services return the deletion status as an enumeration. It can take the following values:

Success = 0Successfully deleted
NotFound = 1Record not found
Error = 2An error occurred during deletion

1.15. Object Containing Authorization Data AuthHeader

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.


Function Description

2.1. Web Service Authentication

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.

2.2. Ending a Session

To end a session with the system, call the Logout(AuthHeader authHeader) method, passing the previously created AuthHeader object as a parameter.

2.3. Retrieving Reference Data

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)

2.4. Retrieving the List of Requests

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
ContractIDNumberContract ID; pass null or 0 if not required
ContractRequestIDNumberRequest ID; pass null or 0 if not required
companyIDNumberCustomer ID; pass null or 0 if not required
dateBeginDateSpecify for exporting documents where Issue Date 1 is greater than or equal to this value
dateEndDateSpecify for exporting documents where Issue Date 1 is less than or equal to this value

2.5. Customer Payments and Balances

2.5.1. Retrieving the List of Payments

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
customerPayIDNumberPayment ID; optional parameter
dateBeginDateSpecify for exporting documents where Issue Date 1 is greater than or equal to this value
dateEndDateSpecify for exporting documents where Issue Date 1 is less than or equal to this value

2.5.2. Adding a Customer Payment to the System

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
CompanyIDNumberSpecify the customer ID from the Companys reference directory
CurrencyTypeIDNumberSpecify the currency type ID from the CurrencyTypes reference directory
DatePayDatePayment date
AmountDecimal numberPayment amount including VAT
AmountTaxDecimal numberVAT amount
CommentStringAdditional payment information
ContractIDNumberContract ID; pass null or 0 if not required
ContractRequestIDNumberRequest 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.

2.5.3. Deleting a Customer Payment

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.

2.5.4. Retrieving the List of Opening Balances from the System

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
customerBalanceIDNumberBalance ID; optional parameter
dateBeginDateSpecify for exporting documents where Issue Date 1 is greater than or equal to this value
dateEndDateSpecify for exporting documents where Issue Date 1 is less than or equal to this value

2.5.5. Adding a Customer Opening Balance to the System

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
CompanyIDNumberSpecify the customer ID from the Companys reference directory
CurrencyTypeIDNumberSpecify the currency type ID from the CurrencyTypes reference directory
DateBalanceDateBalance date
AmountDecimal numberBalance amount
CommentStringAdditional balance information
ContractIDNumberContract ID; pass null or 0 if not required
ContractRequestIDNumberRequest 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.

2.5.6. Deleting a Customer Opening Balance

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.

2.6. Supplier Payments and Balances

2.6.1. Retrieving the List of Supplier Payments

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
supplierPayIDNumberPayment ID; optional parameter
dateBeginDateSpecify for exporting documents where Issue Date 1 is greater than or equal to this value
dateEndDateSpecify for exporting documents where Issue Date 1 is less than or equal to this value

2.6.2. Adding a Supplier Payment to the System

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
CompanyIDNumberSpecify the supplier ID from the Companys reference directory
CurrencyTypeIDNumberSpecify the currency type ID from the CurrencyTypes reference directory
DatePayDatePayment date
AmountDecimal numberPayment amount including VAT
AmountTaxDecimal numberVAT amount
CommentStringAdditional payment information
ContractIDNumberContract 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.

2.6.3. Deleting a Supplier Payment

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.

2.6.4. Retrieving the List of Supplier Opening Balances from the System

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
supplierBalanceIDNumberBalance ID; optional parameter
dateBeginDateSpecify for exporting documents where Issue Date 1 is greater than or equal to this value
dateEndDateSpecify for exporting documents where Issue Date 1 is less than or equal to this value

2.6.5. Adding Supplier Opening Balances to the System

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
CompanyIDNumberSpecify the customer ID from the Companys reference directory
CurrencyTypeIDNumberSpecify the currency type ID from the CurrencyTypes reference directory
DateBalanceDateBalance date
AmountDecimal numberBalance amount
CommentStringAdditional balance information
ContractIDNumberContract 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.

2.6.6. Deleting Supplier Opening Balances

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.

2.7. Agent Payments and Balances

2.7.1. Retrieving the List of Payments

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
agencyPayIDNumberPayment ID; optional parameter
dateBeginDateSpecify for exporting documents where Issue Date 1 is greater than or equal to this value
dateEndDateSpecify for exporting documents where Issue Date 1 is less than or equal to this value

2.7.2. Adding a Payment to the System

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
CompanyIDNumberSpecify the agent ID from the Companys reference directory
CurrencyTypeIDNumberSpecify the currency type ID from the CurrencyTypes reference directory
DatePayDatePayment date
AmountDecimal numberPayment amount including VAT
AmountTaxDecimal numberVAT amount
CommentStringAdditional payment information
ContractIDNumberContract 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.

2.7.3. Deleting a Payment

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.

2.7.4. Retrieving the List of Opening Balances from the System

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
agencyBalanceIDNumberBalance ID; optional parameter
dateBeginDateSpecify for exporting documents where Issue Date 1 is greater than or equal to this value
dateEndDateSpecify for exporting documents where Issue Date 1 is less than or equal to this value

2.7.5. Adding an Opening Balance to the System

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:

FieldData TypeDescription
authHeaderAuthHeaderAuthorization header
CompanyIDNumberSpecify the agent ID from the Companys reference directory
CurrencyTypeIDNumberSpecify the currency type ID from the CurrencyTypes reference directory
DateBalanceDateBalance date
AmountDecimal numberBalance amount
CommentStringAdditional balance information
ContractIDNumberContract 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.

2.7.6. Deleting an Opening Balance

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.