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": "662edc61835c6a1ad967739e",
    "billing_ruleset": "662edc61835c6a1ad9677396",
    "billing_schedule": "662edc61835c6a1ad9677388",
    "cancelled": null,
    "care_fund": null,
    "contributes_to": null,
    "contribution_type": "local_authority",
    "created": "2024-04-28 23:31:45",
    "end_date": null,
    "fee_contribution": 138554,
    "fee_contribution_unit": "week",
    "fee_fixed_until": null,
    "invoice_item_type": "662edc5a835c6a1ad9675cf0",
    "invoice_ref": null,
    "line_item_description": null,
    "location": "662edc59835c6a1ad9675cce",
    "location_contact": "662edc5a835c6a1ad9675d06",
    "modified": "2024-04-28 23:31:45",
    "notes": null,
    "service_user": "662edc5d835c6a1ad9676b78",
    "service_user_contact": null,
    "start_date": "2022-02-07",
    "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": "662edc61835c6a1ad96773a0",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676b78",
            "start_date": "2022-02-07"
        },
        {
            "_id": "662edc61835c6a1ad96773a2",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676b62",
            "start_date": "2022-04-18"
        },
        {
            "_id": "662edc61835c6a1ad96773a4",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676b62",
            "start_date": "2022-04-18"
        },
        {
            "_id": "662edc61835c6a1ad96773a6",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676b30",
            "start_date": "2022-02-19"
        },
        {
            "_id": "662edc61835c6a1ad96773aa",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676c1c",
            "start_date": "2023-09-29"
        },
        {
            "_id": "662edc61835c6a1ad96773ac",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676b5e",
            "start_date": "2022-02-15"
        },
        {
            "_id": "662edc61835c6a1ad96773b0",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676bd0",
            "start_date": "2022-03-26"
        },
        {
            "_id": "662edc61835c6a1ad96773b8",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676b2c",
            "start_date": "2022-04-06"
        },
        {
            "_id": "662edc61835c6a1ad96773ba",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676b5a",
            "start_date": "2022-03-12"
        },
        {
            "_id": "662edc61835c6a1ad96773bc",
            "end_date": null,
            "service_user": "662edc5d835c6a1ad9676c4e",
            "start_date": "2024-08-05"
        }
    ],
    "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": "662edc61835c6a1ad967739e",
    "billing_ruleset": "662edc61835c6a1ad9677396",
    "billing_schedule": "662edc61835c6a1ad9677388",
    "cancelled": null,
    "care_fund": null,
    "contributes_to": null,
    "contribution_type": "local_authority",
    "created": "2024-04-28 23:31:45",
    "end_date": null,
    "fee_contribution": 138554,
    "fee_contribution_unit": "week",
    "fee_fixed_until": null,
    "invoice_item_type": "662edc5a835c6a1ad9675cf0",
    "invoice_ref": null,
    "line_item_description": null,
    "location": "662edc59835c6a1ad9675cce",
    "location_contact": "662edc5a835c6a1ad9675d06",
    "modified": "2024-04-28 23:31:45",
    "notes": null,
    "service_user": "662edc5d835c6a1ad9676b78",
    "service_user_contact": null,
    "start_date": "2022-02-07",
    "with_self": false
}