Bills

Get all bills

Returns all bills, optionally filtered by customers, identifiers and other filters. Note this operation uses Pagination.

Request

[PlatformAddress]/api/connector/v1/bills/getAll

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "EnterpriseIds": [
        "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "4d0201db-36f5-428b-8d11-4f0a65e960cc"
    ],
    "BillIds": [
        "e654f217-d1b5-46be-a820-e93ba568dfac"
    ],
    "CustomerIds": [
        "fe795f96-0b64-445b-89ed-c032563f2bac"
    ],
    "State": "Closed",
    "ClosedUtc": {
        "StartUtc": "2020-02-05T00:00:00Z",
        "EndUtc": "2020-02-10T00:00:00Z"
    },
    "CreatedUtc": {
        "StartUtc": "2020-02-05T00:00:00Z",
        "EndUtc": "2020-02-10T00:00:00Z"
    },
    "UpdatedUtc": {
        "StartUtc": "2020-02-05T00:00:00Z",
        "EndUtc": "2020-02-10T00:00:00Z"
    },
    "DueUtc": null,
    "PaidUtc": null,
    "Extent": {
        "Items": false
    },
    "Limitation":{
        "Cursor": "e7f26210-10e7-462e-9da8-ae8300be8ab7",
        "Count": 100
    }
}
PropertyTypeContractDescription

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.

EnterpriseIds

array of string

optional, max 1000 items

Unique identifiers of the Enterprises. If not specified, the operation returns data for all enterprises within scope of the Access Token.

BillIds

array of string

optional, max 1000 items

Unique identifiers of the Bills. Required if no other filter is provided.

CustomerIds

array of string

optional, max 1000 items

Unique identifiers of the Customers.

State

string

optional

Bill state the bills should be in. If not specified Open and Closed bills are returned.

ClosedUtc

optional, max length 3 months

Interval in which the Bill was closed.

CreatedUtc

optional, max length 3 months

Interval in which the Bill was created.

UpdatedUtc

optional, max length 3 months

Interval in which the Bill was updated.

DueUtc

optional , max length 3 months

Interval in which the Bill is due to be paid.

PaidUtc

optional, max length 3 months

Interval in which the Bill was paid.

Extent

required

Extent of data to be returned. E.g. it is possible to specify that together with the bills, payments and revenue items should be also returned. Deprecated!

Limitation

required

Limitation on the quantity of bill data returned.

Bill state

  • Open

  • Closed

Bill extent

PropertyTypeContractDescription

Items

bool

required

Whether the response should contain payments and revenue items. Deprecated!

Response

{
    "Bills": [
        {
            "Id": "26afba60-06c3-455b-92db-0e3983be0b1d",
            "EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "AccountId": "fe795f96-0b64-445b-89ed-c032563f2bac",
            "CounterId": null,
            "AssociatedAccountIds": ["26afba60-06c3-455b-92db-0e3983be0b1d"],
            "State": "Closed",
            "Type": "Invoice",
            "Number": "29",
            "VariableSymbol": null,
            "CreatedUtc": "2017-01-31T10:48:06Z",
            "IssuedUtc": "2017-01-31T10:58:06Z",
            "UpdatedUtc": null,
            "TaxedUtc": null,
            "PaidUtc": null,
            "DueUtc": null,
            "PurchaseOrderNumber": "XX-123",
            "Notes": "",
            "Options": {
                "DisplayCustomer": true,
                "DisplayTaxation": true,
                "TrackReceivable": true,
                "DisplayCid": false
            },
            "OrderItems": [],
            "PaymentItems": [],
            "OwnerData": {
                "Discriminator": "BillCustomerData",
                "Value": {
                    "Id": "26afba60-06c3-455b-92db-0e3983be0b1d",
                    "Address": {
                        "Line1": "Joe Doe street",
                        "Line2": "Very long ave",
                        "City": "Townston",
                        "PostalCode": "154 00",
                        "SubdivisionCode": "AU-NSW",
                        "CountryCode": "AU"
                    },
                    "LegalIdentifiers": {
                        "TaxIdentifier": "CZ8810310963",
                        "CityOfRegistration": "Prague"
                    },
                    "BillingCode": "Billing code value",
                    "LastName": "Doe",
                    "FirstName": "John",
                    "SecondLastName": "Vincent",
                    "TitlePrefix": "Mistress",
                    "FiscalIdentifier": "Fiscal identifier",
                    "AdditionalTaxIdentifier": "Additional tax identifier"
                }
            },
            "AssociatedAccountData": [
                {
                    "Discriminator": "BillCompanyData",
                    "BillCompanyData": {
                        "Id": "26afba60-06c3-455b-92db-0e3983be0b1d",
                        "Address": {
                            "Line1": "Joe Doe street",
                            "Line2": "Very long ave",
                            "City": "Townston",
                            "PostalCode": "154 00",
                            "SubdivisionCode": "AU-NSW",
                            "CountryCode": "AU"
                        },
                        "LegalIdentifiers": {
                            "TaxIdentifier": "CZ8810310963",
                            "CityOfRegistration": "Prague"
                        },
                        "BillingCode": "billing code value",
                        "Name": "Company Name Inc.",
                        "FiscalIdentifier": "Fiscal identifier",
                        "AdditionalTaxIdentifier": "Additional tax identifier"
                    },
                    "BillCustomerData": null
                }
            ],
            "EnterpriseData": {
                "AdditionalTaxIdentifier": "XY00112233445",
                "CompanyName": "The Sample Hotel Group AS",
                "BankAccount": "CZ3808000000000012345678",
                "BankName": "CESKA SPORITELNA A.S.",
                "Iban": "CZ6508000000192000145399",
                "Bic": "GIBACZPX"
            }
        }
    ],
    "Cursor": "8d02142f-31cf-4115-90bf-ae5200c7a1ba"
}
PropertyTypeContractDescription

Bills

array of Bill

required

The filtered bills.

Cursor

string

required

Unique identifier of the last and hence oldest bill returned. This can be used in Limitation in a subsequent request to fetch the next batch of older bills.

Bill

PropertyTypeContractDescription

Id

string

required

Unique identifier of the bill.

EnterpriseId

string

required

Unique identifier of the Enterprise.

AccountId

string

required

Unique identifier of the account (Customer or Company) the bill is issued to.

CustomerId

string

optional

Unique identifier of the Customer the bill is issued to. Deprecated!

CompanyId

string

optional

Unique identifier of the Company specified in CompanyDetails or the Company the bill is issued to. Deprecated!

AssociatedAccountIds

array of string

optional

Unique identifiers of the Customers or Companies that are associated to the bill.

CounterId

string

optional

Unique identifier of the bill Counter.

State

string Bill state

required

State of the bill.

Type

string Bill type

required

Type of the bill.

Number

string

required

Number of the bill.

VariableSymbol

string

optional

Variable symbol of the bill.

CreatedUtc

string

required

Date and time of the bill creation in UTC timezone in ISO 8601 format.

IssuedUtc

string

optional

Date and time of the bill issuance in UTC timezone in ISO 8601 format.

UpdatedUtc

string

optional

Date and time when the bill was last updated, in UTC timezone in ISO 8601 format.

TaxedUtc

string

optional

Taxation date of the bill in UTC timezone in ISO 8601 format.

PaidUtc

string

optional

Date when the bill was paid in UTC timezone in ISO 8601 format.

DueUtc

string

optional

Bill due date and time in UTC timezone in ISO 8601 format.

PurchaseOrderNumber

string

optional

Unique number of the purchase order from the buyer.

Notes

string

optional

Additional notes.

Options

required

Options of the bill.

OrderItems

array of Order item

required

The order items (consumed items such as nights or products) on the bill.

PaymentItems

array of Payment item

required

The payment items (such as cash, credit card payments or invoices) on the bill.

OwnerData

optional

Additional information about owner of the bill. Can be a Customer or Company. Persisted at the time of closing of the bill.

CompanyDetails

optional

Additional information about the company assigned to the bill. Not the same as the owner. Persisted at the time of closing of the bill. Deprecated!

AssociatedAccountData

optional

Additional information about the associated account of the bill. Can be a Customer or Company. Persisted at the time of closing of the bill. Currently only one account can be associated with a bill, but this may be extended in future.

EnterpriseData

optional

Additional information about the enterprise issuing the bill, including bank account details. Persisted at the time of closing of the bill.

Bill type

A bill is either a Receipt which means that it has been fully paid, or Invoice that is supposed to be paid in the future.

  • Receipt - the bill has already been fully paid.

  • Invoice - the bill is supposed to be paid in the future. Before closing it is balanced with an invoice payment.

Bill options

PropertyTypeContractDescription

DisplayCustomer

boolean

required

Display customer information on a bill.

DisplayTaxation

boolean

required

Display taxation detail on a bill.

TrackReceivable

boolean

required

Tracking of payments is enabled for bill, only applicable for Invoice.

DisplayCid

boolean

required

Display CID number on bill, only applicable for Invoice.

Bill owner data

PropertyTypeContractDescription

Discriminator

required

Determines type of value.

Value

object

required

Structure of object depends on Bill owner data discriminator. Can be either of type Bill customer data or Bill company data.

Bill owner data discriminator

  • BillCustomerData - Owner data specific to a Customer.

  • BillCompanyData - Owner data specific to a Company.

Bill associated account data

PropertyTypeContractDescription

Discriminator

required

Determines type of value.

BillCustomerData

object

optional

Associated account bill data of type Bill customer data.

BillCompanyData

object

optional

Associated account bill data of type Bill company data.

Bill associated account data discriminator

Bill customer data

PropertyTypeContractDescription

Id

string

required

ID of the Customer to whom the bill was assigned.

Address

optional

Address of the customer.

LegalIdentifiers

optional

The set of LegalIdentifiers for the customer.

BillingCode

string

optional

A unique code for Mews to list on invoices it sends to the customer.

LastName

string

required

Last name of the customer.

FirstName

string

optional

First name of the customer.

SecondLastName

string

optional

Second last name of the customer.

TitlePrefix

optional

Title prefix of the customer.

Bill company data

PropertyTypeContractDescription

Id

string

required

ID of the Company.

Address

optional

Address of the company.

LegalIdentifiers

optional

The set of LegalIdentifiers for the company.

BillingCode

string

optional

A unique code for Mews to list on invoices it sends to the company.

Name

string

required

Name of the company.

FiscalIdentifier

string

optional

Fiscal identifier of the company.

AdditionalTaxIdentifier

string

optional

Additional tax identifier of the company.

Bill enterprise data

PropertyTypeContractDescription

AdditionalTaxIdentifier

string

optional

Enterprise additional tax identifier.

CompanyName

string

optional

Enterprise company name.

BankAccount

string

optional

Enterprise bank account.

BankName

string

optional

Enterprise bank name.

Iban

string

optional

Enterprise IBAN (International Bank Account Number).

Bic

string

optional

Enterprise BIC (Bank Identifier Code).

Bill address

PropertyTypeContractDescription

Line1

string

optional

First line of the address.

Line2

string

optional

Second line of the address.

City

string

optional

City of the address.

Postal Code

string

optional

Postal code of the address.

SubdivisionCode

string

optional

ISO 3166-2 code of the administrative division.

CountryCode

string

optional

ISO 3166-1 code of the country.

LegalIdentifiers is a Dictionary, where the key is the type of legal identifier and the value is the corresponding value of that identifier. Keys are as follows:

  • TaxIdentifier

  • Siret

  • Siren

  • NafCode

  • RcsCode

  • LegalStatus

  • RegisteredCapital

  • CityOfRegistration

  • TradesDirectoryRegistrationNumber

  • ItDestinationCode

  • ItFiscalCode

  • ItLotteryCode

  • HungarianVatCode

  • HungarianCompanyName

  • HungarianTaxPayerIdentifier

  • ...

Add bill

Creates new empty bill assigned to specified account. Note this operation supports Portfolio Access Tokens.

Request

[PlatformAddress]/api/connector/v1/bills/add

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "Bills": [
        {
            "AccountId": "a5786a7b-a388-43cc-a838-abd7007b5ff7",
            "Name": "Bill of Joe Doe"
        }
    ]
}
PropertyTypeContractDescription

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.

EnterpriseId

string

optional

Unique identifier of the Enterprise. Required when using a Portfolio Access Token, ignored otherwise.

Bills

required, max 1000 items

Information about bills to be created.

Bill parameters

PropertyTypeContractDescription

AccountId

string

required

Unique identifier of the account (Customer or Company) the bill is issued to. Company billing may not be enabled for your integration.

Name

string

optional

Name of the newly created bill

Response

{
    "Bills": [
        {
            "Id": "177966b7-f3d9-42b7-ba49-abd80057329b",
            "AccountId": "fe795f96-0b64-445b-89ed-c032563f2bac",
            "CompanyId": null,
            "CounterId": null,
            "State": "Open",
            "Type": "Receipt",
            "Number": null,
            "VariableSymbol": null,
            "CreatedUtc": "2020-06-12T05:17:28Z",
            "IssuedUtc": null,
            "TaxedUtc": null,
            "PaidUtc": null,
            "DueUtc": null,
            "Notes": null,
            "OrderItems": [],
            "PaymentItems": []
        }
    ]
}
PropertyTypeContractDescription

Bills

array of Bill

required

The created bills.

Delete bill

Removes selected bills. Bill must be empty, otherwise it's not possible to delete it. Note this operation supports Portfolio Access Tokens.

Request

[PlatformAddress]/api/connector/v1/bills/delete

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "BillIds": [
        "177966b7-f3d9-42b7-ba49-abd80057329b"
    ],
    "EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
}
PropertyTypeContractDescription

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.

BillIds

array of string

required

Unique identifiers of the Bills to be deleted.

EnterpriseId

string

optional

Unique identifier of the Enterprise. Required when using a Portfolio Access Token, ignored otherwise.

Response

{}

Close bill

Closes a bill so no further modification to it is possible. Note this operation supports Portfolio Access Tokens.

Request

[PlatformAddress]/api/connector/v1/bills/close

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "BillId": "44eba542-193e-47c7-8077-abd7008eb206",
    "EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "Type": "Receipt",
    "BillCounterId": "84b25778-c1dd-48dc-8c00-ab3a00b6df14",
    "FiscalMachineId": null,
    "Options": {
        "DisplayCustomer": {
            "Value": false
        },
        "DisplayTaxation": null
    },
    "TaxedDate": {
        "Value": "2020-07-07"
    },
    "DueDate": {
        "Value": "2020-07-14"
    },
    "VariableSymbol": {
        "Value": "5343"
    },
    "AccountTaxIdentifier": {
        "Value": "446768"
    },
    "AccountAddress": {
        "Line1": "Astronautů 2",
        "Line2": "",
        "City": "Havířov",
        "PostalCode": "736 01",
        "CountryCode": "CZ",
        "CountrySubdivisionCode": null
    },
    "PurchaseOrderNumber": {
        "Value": "XX-123"
    },
    "Notes": {
        "Value": "Bill closing note"
    },
    "AssociatedAccountData": [
        {
            "Id": "84b25778-c1dd-48dc-8c00-ab3a00b6df14",
            "TaxIdentifier": {
                "Value": "123459" 
            },
            "Address": {
                "Line1": "Astronautů 2",
                "Line2": "",
                "City": "Havířov",
                "PostalCode": "736 01",
                "CountryCode": "CZ",
                "CountrySubdivisionCode": null
            }
        }
    ]
}
PropertyTypeContractDescription

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.

BillId

string

required

Unique identifier of the Bill to be closed.

EnterpriseId

string

optional

Unique identifier of the Enterprise. Required when using a Portfolio Access Token, ignored otherwise.

Type

string Bill type

required

Specifies the mode bill should be closed in.

BillCounterId

string

optional

Unique identifier of the Counter to be used for closing. Default one is used when no value is provided.

FiscalMachineId

string

optional

Unique identifier of the Fiscal Machine to be used for closing. Default one is used when no value is provided.

Options

optional

Options of the bill. If not provided both DisplayCustomer and DisplayTaxation are set by default.

TaxedDate

optional

Date of consumption for tax purposes. Can be used only with Bill type Invoice.

DueDate

optional

Deadline when Bill is due to be paid. Can be used only with Bill type Invoice.

VariableSymbol

optional

Optional unique identifier of requested payment. Can be used only with Bill type Invoice.

TaxIdentifier

optional

Tax identifier of account to be put on a bill. Deprecated!

AccountTaxIdentifier

optional

Tax identifier of account to be put on a bill.

PurchaseOrderNumber

optional

Unique number of the purchase order from the buyer.

Notes

optional

Notes to be attached to bill.

Address

optional

Address of the account to be displayed on bill. Overrides the default one taken from account profile. Deprecated!

AccountAddress

optional

Address of the account to be displayed on bill. Overrides the default one taken from account profile.

AssociatedAccountData

optional

Account data of the associated account on a bill. Currently one object is supported and only populated when the bill is closed.

Bill options parameters

PropertyTypeContractDescription

DisplayCustomer

required

Display customer information on a bill.

DisplayTaxation

required

Display taxation detail on a bill.

Bill close account parameters

PropertyTypeContractDescription

Id

string

required

Unique identifier of the associated account (Customer or Company) the bill is associated to.

TaxIdentifier

optional

Tax identifier of the assosicated account to be put on a bill.

Address

optional

Address of the associated account to be displayed on bill. Overrides the default one taken from account profile.

Response

{
    "Bills": [
        {
            "Id": "44eba542-193e-47c7-8077-abd7008eb206",
            "CustomerId": "7eaf9da6-7229-454a-8cb0-abd700804bd2",
            "CompanyId": null,
            "CounterId": "84b25778-c1dd-48dc-8c00-ab3a00b6df14",
            "State": "Closed",
            "Type": "Receipt",
            "Number": "84",
            "VariableSymbol": null,
            "CreatedUtc": "2020-06-11T08:39:32Z",
            "IssuedUtc": "2020-06-25T08:49:38Z",
            "TaxedUtc": "2020-06-25",
            "PaidUtc": null,
            "DueUtc": null,
            "PurchaseOrderNumber": "XX-123",
            "Notes": null,
            "Options": {
                "DisplayCustomer": false,
                "DisplayTaxation": true,
                "TrackReceivable": false,
                "DisplayCid": false
            },
            "OrderItems": [],
            "PaymentItems": []
        }
    ]
}
PropertyTypeContractDescription

Bills

array of Bill

required

The closed bill.

Get bill PDF

Creates a PDF version of the specified bill. In case it's not possible to return PDF immediately, you must retry the call later while providing the unique event identifier that is returned from the first invocation.

Request

[PlatformAddress]/api/connector/v1/bills/getPdf

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "BillId": "44eba542-193e-47c7-8077-abd7008eb206",
    "BillPrintEventId": null
}
PropertyTypeContractDescription

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.

BillId

string

required

Unique identifier of the Bill to be printed.

BillPrintEventId

string

optional

Unique identifier of the Bill print event returned by previous invocation.

Response

{
    "BillId": "44eba542-193e-47c7-8077-abd7008eb206",
    "Result": {
        "Discriminator": "BillPdfFile",
        "Value": {
            "Base64Data": "JVBER....."
        }
    }
}
PropertyTypeContractDescription

BillId

string

required

The unique identifier of printed Bill.

Result

required

The result of operation.

Bill PDF result

PropertyTypeContractDescription

Discriminator

required

Determines type of result.

Value

object

required

Structure of object depends on Bill PDF result discriminator.

Bill PDF result discriminator

  • BillPdfFile - PDF version of a Bill was successfully created, Value is Bill PDF file.

  • BillPrintEvent - PDF version of a Bill couldn't be created at this moment (for example bill haven't been reported to authorities yet), Value is Bill print event.

Bill PDF file

PropertyTypeContractDescription

Base64Data

string

required

BASE64 encoded PDF file.

Bill print event

PropertyTypeContractDescription

BillPrintEventId

string

required

Unique identifier of print event. Must be used in retry calls to retrieve the PDF.

Last updated