Get all billing automations
POST /api/connector/v1/billingAutomations/getAll
Returns all billing automations. Note this operation uses Pagination and supports Portfolio Access Tokens.
Request Body
Section titled “Request Body ”object
Token identifying the client application.
Access token of the client application.
Name and version of the client application.
Limitation on the quantity of data returned and optional Cursor for the starting point of data.
object
Unique identifiers of the Enterprises. If not specified, the operation returns data for all enterprises within scope of the Access Token.
Unique identifiers of Company
associated with the billing automations.
Unique identifiers of specific Billing automation
items.
Example
{ "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D", "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D", "Client": "Sample Client 1.0.0", "CompanyIds": [ "c6f5c82d-621a-4c8a-903b-1b0a9a23b71f", "956aa0f0-a090-42c8-bee2-991972d32f80" ], "BillingAutomationIds": [ "ecd64eec-4423-4c65-b844-814b9199856d", "13e6b16e-39bc-4cb1-8610-70ecdb4f91cc" ], "EnterpriseIds": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6", "4d0201db-36f5-428b-8d11-4f0a65e960cc" ]}
Responses
Section titled “ Responses ”OK
object
The list of filtered billing automations.
object
Unique identifier of the billing automation.
Unique identifier of the enterprise.
Name of the billing automation.
Description of the billing automation.
List of companies with relations to the billing automation.
object
Unique identifier of the company.
Company relations.
object
Indicates whether the billing automation will apply if the company added to a reservation is a partner company.
Indicates whether the billing automation will apply if the company added to a reservation is a travel agency.
Type of prepayment.
All (All)
Prepaid (Prepaid)
Type of target company and customer assignment behavior.
CompanyAsDetails (The company will be the associated account in the resulting routed bill, and the customer is the owner.)
CompanyAsOwner (The company will be the owner in the resulting routed bill, and the customer might be the associated account.)
NoCompany (The customer will be owner of the bill.)
Trigger type of billing automation.
Continuous (Billing automation is continuously triggered by reservation actions, such as creation, updates, and rebates.)
Recurring (Billing automation is executed monthly.)
Legacy (Billing automation is executed on reservation creation only. Items added later are not transfered to any bill.)
Type of bill aggregation.
OnePerReservation (Create a separate bill for each reservation.)
AggregateByCustomer (Create a separate bill for each reservation owner.)
AggregateAll (Group all moved items on one bill.)
AggregatePerReservationGroup (Create a separate bill for each reservation group.)
Creation date and time of the billing automation in UTC timezone in ISO 8601 format.
Processing start offset. Applicable only if the billing automation TriggerType
is set to Reccuring
.
Specifies the type of order item consumption period for the billing automation. This value is applicable only when the TriggerType
is set to Reccuring
.
MonthBefore (Only items with a consumption date within the previous month will be routed.)
SameMonthAndMonthBefore (Only items with a consumption date within this and the previous month will be routed.)
SameMonth (Only items with a consumption date within this month will be routed.)
SameMonthAndMonthAfter (Only items with a consumption date within this and the next month will be routed.)
MonthAfter (Only items with a consumption date within the next month will be routed.)
List of billing automation assignments.
object
Unique identifier of the billing automation assignment.
Unique identifier of the billing automation.
Unique identifier of the related service.
Type of items that are going to be routed.
object
Space order
City tax
All products
Deposits
Additional expenses
All custom items
Unique identifiers of Rates
used in billing automation conditions.
Unique identifiers of Product Categories
used in billing automation conditions.
Unique identifiers of Products
used in billing automation conditions.
List of accounting category assignments used in billing automation conditions.
object
Unique identifier of the accounting category.
Type of the accounting category routed item.
object
Specifies whether products under the given accounting category are routed.
Specifies whether custom items under the given accounting category are routed.
Unique identifier of the last returned billing automation. This can be used in Limitation in a subsequent request to fetch the next batch of billing automations.
Example
{ "BillingAutomations": [ { "Id": "ecd64eec-4423-4c65-b844-814b9199856d", "EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "Continuous billing automation for company XYZ", "Description": "Billing Automation for company XYZ with prepayment all, company as owner.", "CompaniesWithRelations": [ { "CompanyId": "c6f5c82d-621a-4c8a-903b-1b0a9a23b71f", "CompanyRelations": { "PartnerCompany": true, "TravelAgency": false } } ], "Prepayment": "All", "AssignmentTargetType": "CompanyAsOwner", "TriggerType": "Continuous", "BillAggregationType": "AggregateAll", "CreatedUtc": "2017-01-31T10:58:06Z", "ProcessingStartOffset": null, "OrderItemConsumptionPeriod": null, "Assignments": [ { "Id": "d6b550e9-9c4b-42dd-9daa-555312b030e6", "BillingAutomationId": "ecd64eec-4423-4c65-b844-814b9199856d", "ServiceId": "bd26d8db-86da-4f96-9efc-e5a4654a4a94", "RoutedItemTypes": { "SpaceOrder": true, "CityTax": true, "AllProducts": true, "Deposits": true, "AdditionalExpenses": false, "AllCustomItems": false }, "RateIds": [ "ab3682ba-4493-4eb0-bcdc-8d000f5bad65" ], "ProductCategoryIds": [ "599c477e-b826-4444-8ded-4fa7276ef0c1" ], "ProductIds": [ "f0184ec2-9f02-4026-9b70-0b2bed2adde7" ], "AccountingCategoryAssignments": [ { "AccountingCategoryId": "2e0f5930-605e-4a23-9994-a7701a56b576", "ItemTypes": { "Products": true, "CustomItems": false } } ] } ] } ], "Cursor": "54ec08b6-e6fc-48e9-b8ae-02943e0ac693"}
Server has successfully fulfilled the request and there is no additional information to send back.
object
Error caused by the client app, e.g. in case of malformed request or invalid identifier of a resource. In most cases, such an error signifies a bug in the client app (consumer of the API).
object
Error caused by usage of invalid ClientToken, AccessToken, or you may not have the necessary permission to use the endpoint.
object
Server error that should be reported to the end user of the client app. Happens for example when the server-side validation fails or when a business-logic check is violated.
object
Error caused by heavy request that takes too long to process (typically tens of seconds). To get around this, request data in smaller batches. For more information, see Request timeouts
object
Error caused by too many requests sent in a given amount of time. Response contains Retry-After
header indicating how long the user agent should wait before making a follow-up request. For more information, see Request limits.
object
Unexpected error on the Mews side. This may be due to a software fault. If such a situation occurs, the error will be logged and the development team notified, however you can raise an issue through GitHub on our documentation repository.