Connector API
Search…
Accounting items

Get all accounting items

Returns all accounting items of the enterprise that were consumed (posted) or will be consumed within the specified interval. If the Currency is specified, costs of the items are converted to that currency. Accounting items are split into Order items (consumed items such as nights or products) and Payment items (such as cash, credit card payments or invoices).

Request

[PlatformAddress]/api/connector/v1/accountingItems/getAll
1
{
2
"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
3
"AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
4
"Client": "Sample Client 1.0.0",
5
"ConsumedUtc": {
6
"StartUtc": "2020-01-05T00:00:00Z",
7
"EndUtc": "2020-01-10T00:00:00Z"
8
},
9
"ClosedUtc": {
10
"StartUtc": "2020-01-05T00:00:00Z",
11
"EndUtc": "2020-01-10T00:00:00Z"
12
},
13
"ItemIds": [
14
"cb643cb7-8b6e-48a6-b67e-ad4c0041f550",
15
"44ca12b8-f009-455e-be91-ad4c013fcbc5"
16
],
17
"Extent": {
18
"OrderItems": true,
19
"PaymentItems": true,
20
"CreditCardTransactions": false
21
},
22
"States": [
23
"Open"
24
]
25
}
Copied!
Property
Type
Contract
Description
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
ConsumedUtc
optional, max length 3 months
Interval in which the accounting item was consumed. Required if no other filter is provided.
ClosedUtc
optional, max length 3 months
Interval in which the accounting item was closed. Required if no other filter is provided.
ItemIds
array of string
optional, max 1000 items
Unique identifiers of the Accounting items. Required if no other filter is provided.
RebatedItemIds
array of string
optional, max 1000 items
Unique identifiers of the Accounting items we are finding rebates for. Required if no other filter is provided.
Currency
string
optional
ISO-4217 code of the Currency the item costs should be converted to.
Extent
required
Extent of data to be returned. E.g. it is possible to specify that together with the accounting items, credit card transactions should be also returned.
States
array of string Accounting item state
optional
States the accounting items should be in. If not specified, accounting items in Open or Closed states are returned.

Time interval

Property
Type
Contract
Description
StartUtc
string
required
Start of the interval in UTC timezone in ISO 8601 format.
EndUtc
string
required
End of the interval in UTC timezone in ISO 8601 format.

Accounting item extent

Property
Type
Contract
Description
OrderItems
bool
required
Whether the response should contain Order items (consumed items such as nights or products).
PaymentItems
bool
required
Whether the response should contain Payment items (such as cash, credit card payments or invoices).
CreditCardTransactions
bool
required
Whether the response should contain Credit card transactions of the payment items.

Accounting item state

  • Open - Accounting items which carry a non-zero value, are open, and have not been closed on a bill or invoice.
  • Closed - Accounting items which carry a non-zero value and have been closed on a bill or invoice.
  • Inactive - Accounting items which are either of zero value and have not been canceled, if the state of the payment item is Pending or Failed, or items of optional reservations. Until the reservation is confirmed, all its accounting items are Inactive.
  • Canceled - Accounting items which have been canceled, regardless of whether the item is of zero value

Response

1
{
2
"OrderItems": [
3
{
4
"Id": "cb643cb7-8b6e-48a6-b67e-ad4c0041f550",
5
"AccountId": "77673c9d-0e31-4e90-9228-ad4b00a9fcdc",
6
"OrderId": "1103b431-998a-4b78-84de-ad4b00a9fd99",
7
"BillId": null,
8
"AccountingCategoryId": "d250149e-a29d-4c70-b607-a1759faf7320",
9
"Amount": {
10
"Currency": "GBP",
11
"NetValue": 1523.81,
12
"GrossValue": 1600.00,
13
"TaxValues": [
14
{
15
"Code": "UK-2020-R",
16
"Value": 76.19
17
}
18
],
19
"Breakdown": {
20
"Items": [
21
{
22
"TaxRateCode": "UK-2020-R",
23
"NetValue": 1523.81,
24
"TaxValue": 76.19
25
}
26
]
27
}
28
},
29
"RevenueType": "Additional",
30
"ConsumedUtc": "2021-06-19T04:00:08Z",
31
"ClosedUtc": null,
32
"AccountingState": "Open",
33
"Data": {
34
"Discriminator": "CancellationFee",
35
"Value": null
36
}
37
}
38
],
39
"PaymentItems": [
40
{
41
"Id": "44ca12b8-f009-455e-be91-ad4c013fcbc5",
42
"AccountId": "5da55e5c-18e5-48d8-9a0e-ac0600704c5c",
43
"BillId": null,
44
"AccountingCategoryId": "b89345c1-2814-4750-808d-aa7900ee464a",
45
"Amount": {
46
"Currency": "GBP",
47
"NetValue": 850.00,
48
"GrossValue": 850.00,
49
"TaxValues": [],
50
"Breakdown": {
51
"Items": [
52
{
53
"TaxRateCode": null,
54
"NetValue": 850.00,
55
"TaxValue": 0.0
56
}
57
]
58
}
59
},
60
"Notes": "NORMAL0140",
61
"ConsumedUtc": "2021-06-19T19:24:20Z",
62
"ClosedUtc": null,
63
"AccountingState": "Open",
64
"State": "Charged",
65
"Data": {
66
"Discriminator": "Invoice",
67
"Value": {
68
"InvoiceId": "3c818013-d9de-47e9-bb2c-ad4c013f9ad3"
69
}
70
}
71
}
72
],
73
"CreditCardTransactions": null
74
}
Copied!
Property
Type
Contract
Description
OrderItems
array of Order item
optional
The order items (consumed items such as nights or products).
PaymentItems
array of Payment item
optional
The payment items (such as cash, credit card payments or invoices).
CreditCardTransactions
optional
The credit card payment transactions.

Order item

Property
Type
Contract
Description
Id
string
required
Unique identifier of the item.
AccountId
string
required
Unique identifier of the account (for example Customer) the item belongs to.
OrderId
string
required
Unique identifier of the order (or Reservation which is a special type of order) the item belongs to.
BillId
string
optional
Unique identifier of the Bill the item is assigned to.
AccountingCategoryId
string
optional
Unique identifier of the Accounting category the item belongs to.
Amount
required
Item's amount, negative amount represents either rebate or a payment.
RevenueType
string Revenue type
required
Revenue type of the item.
ConsumedUtc
string
required
Date and time of the item consumption in UTC timezone in ISO 8601 format.
ClosedUtc
string
optional
Date and time of the item bill closure in UTC timezone in ISO 8601 format.
AccountingState
required
Accounting state of the item.
Data
object Order item data
required
Additional data specific to particular order item.

Payment item

Property
Type
Contract
Description
Id
string
required
Unique identifier of the item.
AccountId
string
required
Unique identifier of the account (for example Customer) the item belongs to.
BillId
string
optional
Unique identifier of the Bill the item is assigned to.
AccountingCategoryId
string
optional
Unique identifier of the Accounting category the item belongs to.
Amount
required
Item's amount, negative amount represents either rebate or a payment.
Notes
string
optional
Additional notes.
ConsumedUtc
string
required
Date and time of the item consumption in UTC timezone in ISO 8601 format.
ClosedUtc
string
optional
Date and time of the item bill closure in UTC timezone in ISO 8601 format.
AccountingState
required
Accounting state of the item.
State
required
Payment state of the item.
Data
required
Additional data specific to particular payment item.

Credit card transaction

Property
Type
Contract
Description
PaymentId
string
required
Unique identifier of the Payment item.
SettlementId
string
optional
Identifier of the settlement.
SettledUtc
string
optional
Settlement date and time in UTC timezone in ISO 8601 format.
Fee
Amount
optional
Transaction fee - this includes an estimate of bank charges.
AdjustedFee
Amount
optional
Transaction fee (adjusted) - this is the final confirmed transaction fee, including confirmed bank charges.
ChargedAmount
Amount
required
Charged amount of the transaction.
SettledAmount
Amount
optional
Settled amount of the transaction.

Amount Value

Property
Type
Contract
Description
Currency
string
required
ISO-4217 code of the Currency.
NetValue
number
optional
Net value in case the item is taxed.
GrossValue
number
optional
Gross value including all taxes.
TaxValues
array of Tax value
optional
The tax values applied.
For most amounts, precision of values depends on TaxPrecision of Enterprise or Currency precision. But in some cases, precision can be higher.

Tax value

Property
Type
Contract
Description
Code
number
required
Code corresponding to tax type.
Value
number
required
Amount of tax applied.

Revenue type

  • Service
  • Product
  • Additional

Order item data

Property
Type
Contract
Description
Discriminator
required
Type of the order item (e.g. ProductOrder).
Value
object
optional
Based on order item discriminator, e.g. Product order item data or null for types without any additional data.

Order item data discriminator

  • CancellationFee - no additional data.
  • Deposit - no additional data.
  • ExchangeRateDifference - no additional data.
  • CustomItem - no additional data.
  • Surcharge - no additional data.
  • SurchargeDiscount - no additional data.
  • ProductOrder - Product order item data.
  • Other - no additional data.

Product order item data

Property
Type
Contract
Description
ProductId
string
required
Unique identifier of the Product.
AgeCategoryId
string
optional
Unique identifier of the Age Category.

Rebate order item data

Property
Type
Contract
Description
RebatedItemId
string
required
Unique identifier of Order item which has been rebated by current item.

Payment item state

  • Charged
  • Canceled
  • Pending
  • Failed
  • Verifying

Payment item data

Property
Type
Contract
Description
Discriminator
required
Type of the payment item (e.g. CreditCard).
Value
object
optional
Based on order item discriminator, e.g. Credit card payment item data or null for types without any additional data.

Payment item data discriminator

  • Cash - no additional data.
  • Unspecified - no additional data.
  • BadDebts - no additional data.
  • WireTransfer - no additional data.
  • ExchangeRateDifference - no additional data.
  • ExchangeRoundingDifference - no additional data.
  • BankCharges - no additional data.
  • Cheque - no additional data.
  • Other - no additional data.

Credit card payment item data

Property
Type
Contract
Description
CreditCardId
string
required
Unique identifier of the Credit card.

Invoice payment item data

Property
Type
Contract
Description
InvoiceId
string
required
Unique identifier of the invoice Bill.

Currency value

Property
Type
Contract
Description
Currency
string
required
ISO-4217 code of the Currency.
Value
number
optional
Amount in the currency.

Update accounting items

Updates specified accounting items. Allows to change to which account or bill the item is assigned to.

Request

[PlatformAddress]/api/connector/v1/accountingItems/update
1
{
2
"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
3
"AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
4
"Client": "Sample Client 1.0.0",
5
"AccountingItemUpdates": [
6
{
7
"AccountingItemId": "6c2897de-620a-4f48-af1e-ada8004202bd",
8
"AccountId": {
9
"Value": "182a56ee-037d-4da5-b6f8-ada8006e7d5c"
10
},
11
"BillId": {
12
"Value": "9e3791dc-95c7-439a-aa8a-ada8007de0ca"
13
}
14
}
15
]
16
}
Copied!
Property
Type
Contract
Description
ClientToken
string
required
Token identifying the client application.
AccessToken
string
required
Access token of the client application.
Client
string
required
Name and version of the client application.
AccountingItemUpdates
required
List of requested updates.

Accounting item update

Property
Type
Contract
Description
AccountingItemId
string
required
Unique identifier of the Accounting item.
AccountId
optional
Unique identifier of the account (for example Customer) the item is assigned to (or null if the assigned account should not be updated). If defined, valid account identifier must be provided.
BillId
required
Unique identifier of the Bill the items is assigned to. It's possible to assign item to bill belonging to another account, in that case both AccountId and BillId must be provided.

String update value

Property
Type
Contract
Description
Value
string
optional
Value which is to be updated.

Response

1
{
2
"OrderItems": [
3
{
4
"Id": "6c2897de-620a-4f48-af1e-ada8004202bd",
5
"AccountId": "182a56ee-037d-4da5-b6f8-ada8006e7d5c",
6
"OrderId": "f9090129-fb49-46d2-9dc5-ad9d015d43b9",
7
"BillId": "9e3791dc-95c7-439a-aa8a-ada8007de0ca",
8
"AccountingCategoryId": "d250149e-a29d-4c70-b607-a1759faf7320",
9
"Amount": {
10
"Currency": "GBP",
11
"NetValue": 95.24,
12
"GrossValue": 100.00,
13
"TaxValues": [
14
{
15
"Code": "UK-2020-R",
16
"Value": 4.76
17
}
18
],
19
"Breakdown": {
20
"Items": [
21
{
22
"TaxRateCode": "UK-2020-R",
23
"NetValue": 95.24,
24
"TaxValue": 4.76
25
}
26
]
27
}
28
},
29
"RevenueType": "Additional",
30
"ConsumedUtc": "2021-09-19T04:00:20Z",
31
"ClosedUtc": null,
32
"AccountingState": "Open",
33
"Data": {
34
"Discriminator": "CancellationFee",
35
"Value": null
36
}
37
}
38
],
39
"PaymentItems": [],
40
}
Copied!
Property
Type
Contract
Description
OrderItems
array of Order item
optional
Updated order items (consumed items such as nights or products).
PaymentItems
array of Payment item
optional
Updated payment items (such as cash, credit card payments or invoices).