Billing contracts

A billing contract between the location and a service user / location contact to pay towards care fees for a service user.

The billing contract object

Attributes

  • _id
    string

    A unique Id for the billing contract.

  • billing_ruleset
    string

    The billing ruleset for the billing contract.

  • billing_schedule
    string

    The billing schedule for the billing contract.

  • cancelled
    string

    The date/time the billing contract was cancelled (if cancelled).

  • care_fund
    string

    The care fund the billing contract is funded by (used to track the remaining funds).

  • contributes_to
    list of strings

    A list of billing contracts that contribute fees to this billing contract.

  • contribution_type
    string

    The type of contribution this billing contract is making; local_authority, contribution, fnc, chc, lifestyle, top_up, block_bed, dta_spot, fpc. Please note that contribution relates to private contributions.

  • created
    string

    The date/time the billing contract was created.

  • end_date
    string

    The number of days that this party will be billed for if the service user dies whilst a resident is at the home.

  • fee_contribution
    string

    The amount the contact will contribute towards the fees (per day/week).

  • fee_contribution_unit
    string

    The unit the fee contribution is defined in;day, week.

  • fee_fixed_until
    string

    Date when the current billing contract fee is fixed until.

  • invoice_item_type
    string

    The invoice item type that will be used when generating a line item for this billing contract.

  • invoice_ref
    string

    The reference to use when generating an invoice for this billing contract.

  • line_item_description
    string

    An additional description that will be appended to the line item description for line items generated for this billing contract.

  • location
    string

    The Id of the location the billing contract relates to.

  • location_contact
    string

    The location contact the billing contract relates to.

  • modified
    string

    The date/time the billing contract was modified.

  • notes
    string

    Any additional information about the billing contract.

  • service_user
    string

    The service user the billing contract relates to.

  • service_user_contact
    string

    The service user contact the billing contract relates to.

  • start_date
    string

    The date the billing contract starts.

  • with_self
    boolean

    Flag indicating if the billing contract is with the service user.

The billing contract object
{
    "_id": "66bfb4d09ab4e3d6eb735f22",
    "billing_ruleset": "66bfb4d09ab4e3d6eb735f1a",
    "billing_schedule": "66bfb4d09ab4e3d6eb735f0c",
    "cancelled": null,
    "care_fund": null,
    "contributes_to": null,
    "contribution_type": "local_authority",
    "created": "2024-08-16 20:21:36",
    "end_date": null,
    "fee_contribution": 138554,
    "fee_contribution_unit": "week",
    "fee_fixed_until": null,
    "invoice_item_type": "66bfb4bb9ab4e3d6eb7348fc",
    "invoice_ref": null,
    "line_item_description": null,
    "location": "66bfb4bb9ab4e3d6eb734900",
    "location_contact": "66bfb4bc9ab4e3d6eb73492a",
    "modified": "2024-08-16 20:21:36",
    "notes": null,
    "service_user": "66bfb4c09ab4e3d6eb735790",
    "service_user_contact": null,
    "start_date": "2022-05-27",
    "with_self": false
}

List all billing contracts

Return a list of billing contracts.

Parameters

  • attributes
    optional
    default ['_id']

    A list of attributes to include for fetched objects.

  • filters-cancelled
    optional
    default unset

    A filter that allows billing contracts to be filtered by whether the contract is cancelled.

    • unset
    • yes
    • no
  • filters-contribution_type
    optional

    A filter that allows billing contracts to be filtered to a list of contribution types.

    • local_authority
    • contribution
    • fnc
    • chc
    • lifestyle
    • top_up
    • block_bed
    • dta_spot
    • fpc
  • filters-end_date
    optional

    A filter that accepts a date and filters billing contracts to those that start before the given date.

  • filters-ids
    optional

    A filter that accepts a list of Ids and filters the items returned to those with an Id in the list.

  • filters-invoice_item_type
    optional

    A filter that accepts a list of invoice item type Ids and filters billing contracts by the invoice item type they use when generating an invoice line item.

  • filters-location
    optional

    A filter that accepts a list of location Ids and filters billing contracts by the location they relate to.

  • filters-location_contact
    optional

    A filter that accepts a list of location contact Ids and filters billing contracts to those where the billing party is one of the location contacts.

  • filters-max_fee_contribution
    optional

    A filter that accepts a fee (in pence) and filters billing contracts to those with a fee contribution equal to or less than the given fee.

  • filters-min_fee_contribution
    optional

    A filter that accepts a fee (in pence) and filters billing contracts to those with a fee contribution equal to or higher than the given fee.

  • filters-modified_after
    optional

    A filter that accepts a date/time and filters the items returned to those modified after the date/time.

  • filters-modified_before
    optional

    A filter that accepts a date/time and filters the items returned to those modified before the date/time.

  • filters-q
    optional

    A case insensitive keyword filter applied to the following fields; notes.

  • filters-service_user
    optional

    A filter that accepts a list of service user Ids and filters billing contracts by the service user they are for.

  • filters-service_user_contact
    optional

    A filter that accepts a list of service user contact Ids and filters billing contracts to those where the billing party is one of the service user contacts.

  • filters-start_date
    optional

    A filter that accepts a date and filters billing contracts to those that end after the given date (including if the billing contract has no end date set).

  • filters-with_self
    optional
    default unset

    A filter that allows billing contracts to be filtered by whether the contract is with the associated service users.

    • unset
    • yes
    • no
  • page
    optional
    default 1

    The page number to fetch.

  • per_page
    optional
    default 10

    The number of items to return per page.

  • sort_by
    optional
    default _id

    A list of fields the returned items can be sorted by. Fields prefixed with minus (-) sign are sorted in descending order.

    • _id
    • created
    • end_date
    • modified
    • start_date

Response

Returns a page of billing contracts.

GET
/v1/billing-contracts
var billingContracts = apiClient.Request(
    HttpMethod.Get,
    "billing-contracts",
    new MultiValueDict()
        .Add("attributes", "service_user", "start_date", "end_date")
        .Add("filters-contribution_type", "contribution")
);
<?php

$billing_contracts = $api_client->request(
    'GET',
    'billing-contracts',
    [
        'attributes'=>['service_user', 'start_date', 'end_date'],
        'filters-contribution_type'=>'contribution'
    ]
);
billing_contracts = api_client(
    'GET',
    'billing-contracts',
    params={
        'attributes': ['service_user', 'start_date', 'end_date'],
        'filters-contribution_type': 'contribution'
    }
)
billing_contracts = api_client.request(
    'GET',
    'billing-contracts',
    params: {
        'attributes' => ['service_user', 'start_date', 'end_date'],
        'filters-contribution_type' => 'contribution'
    }
)
Response
{
    "item_count": 59,
    "items": [
        {
            "_id": "66bfb4d09ab4e3d6eb735f24",
            "end_date": null,
            "service_user": "66bfb4c09ab4e3d6eb735790",
            "start_date": "2022-05-27"
        },
        {
            "_id": "66bfb4d09ab4e3d6eb735f26",
            "end_date": null,
            "service_user": "66bfb4c09ab4e3d6eb73577a",
            "start_date": "2022-08-05"
        },
        {
            "_id": "66bfb4d09ab4e3d6eb735f28",
            "end_date": null,
            "service_user": "66bfb4c09ab4e3d6eb73577a",
            "start_date": "2022-08-05"
        },
        {
            "_id": "66bfb4d09ab4e3d6eb735f2a",
            "end_date": null,
            "service_user": "66bfb4c09ab4e3d6eb735748",
            "start_date": "2022-06-08"
        },
        {
            "_id": "66bfb4d09ab4e3d6eb735f2e",
            "end_date": null,
            "service_user": "66bfb4c19ab4e3d6eb735834",
            "start_date": "2024-01-16"
        },
        {
            "_id": "66bfb4d09ab4e3d6eb735f30",
            "end_date": null,
            "service_user": "66bfb4c09ab4e3d6eb735776",
            "start_date": "2022-06-04"
        },
        {
            "_id": "66bfb4d09ab4e3d6eb735f34",
            "end_date": null,
            "service_user": "66bfb4c09ab4e3d6eb7357e8",
            "start_date": "2022-07-13"
        },
        {
            "_id": "66bfb4d09ab4e3d6eb735f3c",
            "end_date": null,
            "service_user": "66bfb4c09ab4e3d6eb735744",
            "start_date": "2022-07-24"
        },
        {
            "_id": "66bfb4d09ab4e3d6eb735f3e",
            "end_date": null,
            "service_user": "66bfb4c09ab4e3d6eb735772",
            "start_date": "2022-06-29"
        },
        {
            "_id": "66bfb4d09ab4e3d6eb735f40",
            "end_date": null,
            "service_user": "66bfb4c19ab4e3d6eb735866",
            "start_date": "2024-11-22"
        }
    ],
    "page": 1,
    "page_count": 6,
    "per_page": 10
}

Retrieve an billing contract

Retrieve an billing contract object.

Response

Returns a billing contract object.

GET
/v1/billing-contracts/<billing_contract_id>
var billingContract = apiClient.Request(
    HttpMethod.Get,
    $"billing-contracts/{billingContractId}"
)
<?php

$billing_contract = $api_client->request(
    'GET',
    'billing-contracts/' . $billing_contract_id
);
billing_contract = api_client(
    'GET',
    f'billing-contracts/{billing_contract_id}'
)
billing_contract = api_client.request(
    'GET',
    "billing-contracts/#{billing_contract_id}"
)
Response
{
    "_id": "66bfb4d09ab4e3d6eb735f22",
    "billing_ruleset": "66bfb4d09ab4e3d6eb735f1a",
    "billing_schedule": "66bfb4d09ab4e3d6eb735f0c",
    "cancelled": null,
    "care_fund": null,
    "contributes_to": null,
    "contribution_type": "local_authority",
    "created": "2024-08-16 20:21:36",
    "end_date": null,
    "fee_contribution": 138554,
    "fee_contribution_unit": "week",
    "fee_fixed_until": null,
    "invoice_item_type": "66bfb4bb9ab4e3d6eb7348fc",
    "invoice_ref": null,
    "line_item_description": null,
    "location": "66bfb4bb9ab4e3d6eb734900",
    "location_contact": "66bfb4bc9ab4e3d6eb73492a",
    "modified": "2024-08-16 20:21:36",
    "notes": null,
    "service_user": "66bfb4c09ab4e3d6eb735790",
    "service_user_contact": null,
    "start_date": "2022-05-27",
    "with_self": false
}