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",
  "Extent": {
    "Items": false
  },
  "TimeFilter": null,
  "StartUtc": null,
  "EndUtc": null,
  "ClosedUtc": {
    "StartUtc": "2020-02-05T00:00:00Z",
    "EndUtc": "2020-02-10T00:00:00Z"
  },
  "PaidUtc": null,
  "DueUtc": null,
  "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"
  },
  "BillIds": [
    "e654f217-d1b5-46be-a820-e93ba568dfac"
  ],
  "CustomerIds": [
    "fe795f96-0b64-445b-89ed-c032563f2bac"
  ],
  "State": "Closed",
  "CorrectionState": null,
  "EnterpriseIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "4d0201db-36f5-428b-8d11-4f0a65e960cc"
  ],
  "Limitation": {
    "Count": 100,
    "Cursor": "e7f26210-10e7-462e-9da8-ae8300be8ab7"
  }
}

Bill extent

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!

Response

{
  "Bills": [
    {
      "Id": "26afba60-06c3-455b-92db-0e3983be0b1d",
      "Name": "Accommodation Charges",
      "EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "AccountId": "fe795f96-0b64-445b-89ed-c032563f2bac",
      "CustomerId": null,
      "CompanyId": null,
      "AssociatedAccountIds": [
        "26afba60-06c3-455b-92db-0e3983be0b1d"
      ],
      "CounterId": null,
      "State": "Closed",
      "Type": "Invoice",
      "Number": "29",
      "VariableSymbol": null,
      "CreatedUtc": "2017-01-31T10:48:06Z",
      "IssuedUtc": "2017-01-31T10:58:06Z",
      "TaxedUtc": null,
      "PaidUtc": null,
      "DueUtc": null,
      "LastReminderDateUtc": null,
      "UpdatedUtc": "2017-01-31T10:58:06Z",
      "PurchaseOrderNumber": "XX-123",
      "Notes": "",
      "Options": {
        "DisplayCustomer": true,
        "DisplayTaxation": true,
        "TrackReceivable": true,
        "DisplayCid": false,
        "Rebated": false
      },
      "Revenue": [],
      "Payments": [],
      "OrderItems": [],
      "PaymentItems": [],
      "AssigneeData": null,
      "OwnerData": {
        "Discriminator": "BillCompanyData",
        "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",
          "Name": "Acme, Inc.",
          "FiscalIdentifier": "Fiscal identifier",
          "AdditionalTaxIdentifier": "Additional tax identifier"
        }
      },
      "CompanyDetails": null,
      "AssociatedAccountData": [
        {
          "Discriminator": "BillCompanyData",
          "BillCustomerData": null,
          "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": "Acme, Inc.",
            "FiscalIdentifier": "Fiscal identifier",
            "AdditionalTaxIdentifier": "Additional tax identifier"
          }
        }
      ],
      "EnterpriseData": {
        "AdditionalTaxIdentifier": "XY00112233445",
        "CompanyName": "The Sample Hotel Group AS",
        "BankAccount": "CZ3808000000000012345678",
        "BankName": "CESKA SPORITELNA A.S.",
        "Iban": "CZ6508000000192000145399",
        "Bic": "GIBACZPX"
      },
      "CorrectionState": "Bill",
      "CorrectionType": null,
      "CorrectedBillId": null
    }
  ],
  "Cursor": "26afba60-06c3-455b-92db-0e3983be0b1d"
}

Bill

Bill state

  • Open

  • Closed

Bill type

  • Receipt - Default; the bill has been paid in full; only applicable after the bill is closed.

  • Invoice - Bill has not been paid in full but an invoice has been issued to request payment.

Bill options

Options of the bill.

Bill assignee data

Bill associated account data discriminator

  • BillCustomerData

  • BillCompanyData

Bill company data

Bill customer data

Bill owner data

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

Associated account bill data

Bill enterprise data

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

Bill correction state

  • Bill - Regular bill.

  • CorrectiveBill - Corrective bill, i.e. the CorrectionType is either Edit, Cancellation, or ReceivablePaymentsBalance.

Bill correction type

  • Cancellation

  • Edit

  • CreditNote

  • Reinstatement

  • ReceivablePaymentsBalance

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
}

Response

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

Bill PDF result discriminator

Bill PDF result discriminator

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

  • 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 BillPrintEvent

Bill PDF file

Bill print event

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"
    }
  ]
}

Bill parameters

Response

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

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"
}

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
      }
    }
  ]
}

Bill options parameters

Bill close account parameters

Response

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

Last updated