Data import

Kraken provides a series of API end-points to allow accounts and products to be migrated into Kraken from another energy platform.

Authentication

All API end-points require authentication using your data-import secret key as the API key.

Core Concepts

This section provides an introduction to the core concepts for migrations into Kraken.

Account Import Process

The Account Import Process is the central unit for an account migrating into Kraken. It contains the payload that is used to generate the account as well as other metadata. Once an account is created from the import payload, a link is stored between the two, so it is always possible to see the original data from which the account was created.

Import Supplier

The Import Supplier groups Account Import Process’s together and can be thought of as a representation of the source system, or a cohort of accounts in the source system. The import_supplier field in the import payload maps to the code associated with the Import Supplier.

An Import Supplier has a configuration associated with it that controls certain behaviour to do with the migration, for example, whether an email comm should be sent on account creation to the customer. Kraken devs will work with the client in determining the correct Import Supplier Config for the migration.

Process

API end-points

Validating account data

Use this end-point to validate a JSON payload of account information.

Note

Providing an unrecognised field will not raise an error, instead it will be omitted from the payload entirely.

Request:

POST /v1/data-import/validate-account/

Sample payloads:

Domestic account

{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "1234", "unknown_occupier": false, "customers": [ { "given_name": "Bob", "family_name": "Jabłoński", "email": "bob@jablonski.com", "mobile": "07123456789", "landline": "02072343456", "date_of_birth": "1989-01-11", "title": "Mr", "salutation": "Hi", "psr": [ { "elec_industry_code": "01", "effective_from": "2012-01-01" }, { "gas_industry_code": "01", "effective_from": "2012-01-01" } ], "customer_preferences": { "opted_into_sms": true, "opted_into_recommended": true, "opted_into_updates": true, "opted_into_third_parties": true, "opted_into_offers": true, "is_user_psr_consent_obtained": true } } ], "billing_name": "Robert Jabłoński", "billing_address1": "123 Fake Street", "billing_address2": "", "billing_address3": "", "billing_address4": "", "billing_address5": "", "billing_postcode": "W1F 9DE", "is_business": false, "sales_channel": "DIRECT", "sales_subchannel": "", "supply_addresses": [ { "supply_address1": "123 Fake Street", "supply_address2": "", "supply_address3": "", "supply_address4": "", "supply_address5": "", "supply_postcode": "W1F 9DE", "is_landlord": false, "customer_at_supply_address_from_date": "2019-01-01", "meter_points": [ { "mpxn": "1200060176720", "mpid": "TENT", "supply_start_date": "2019-01-01", "meters": [ { "meter_serial_number": "0000000001", "installed_on": "2001-01-01", "registers": [ { "register_id": "1", "tpr": "00001", "number_of_digits": 5 }, { "register_id": "X", "tpr": "00043", "number_of_digits": 5, "is_settlement": false } ], "transfer_readings": [ { "register_id": "1", "reading_date": "2019-08-01", "reading_value": "1000.00", "reading_type": "CUSTOMER" } ], "reading_history": [ { "register_id": "1", "reading_date": "2019-06-20", "reading_value": "980.00", "reading_type": "CUSTOMER", "billed": true }, { "register_id": "1", "reading_date": "2019-05-20", "reading_value": "960.00", "reading_type": "ROUTINE", "billed": true } ], "prepay_details": { "debt_balance": "10.1", "credit_balance": "11.2", "transfer_vend_read_date": "2020-03-26" } } ], "et_in_progress": false, "dr_in_progress": false, "smart_refusal_interest": { "type": "NOT_INTERESTED_AT_THE_MOMENT", "date": "2020-04-01", "refusal_reason": "WORRIED_SECURITY", "source": "EMAIL", }, "eac_history": [ { "effective_from": "2019-10-01", "tpr": "00001", "consumption": "1500", "source": "D0019" }, { "effective_from": "2019-09-01", "tpr": "00001", "consumption": "1300", "source": "D0019" } ] }, { "mpxn": "9353824109", "mpid": "TEN", "supply_start_date": "2019-04-10", "meters": [ { "meter_serial_number": "54BV", "installed_on": "2002-01-01", "gas_number_of_digits": 5, "smart_type": "SMETS1", "transfer_readings": [ { "reading_date": "2019-08-01", "reading_value": "500.00", "reading_type": "CUSTOMER" } ], "prepay_details": { "debt_balance": "21.3", "credit_balance": "12.3", "transfer_vend_read_date": "2020-03-26", "gas_debt_repayment_options": { "weekly_min": "3.00", "weekly_max": "3.50" } } } ], "et_in_progress": false, "dr_in_progress": false, "aq_history": [ { "effective_from": "2019-01-01", "consumption": "8720" }, { "effective_from": "2018-01-01", "effective_to": "2018-12-31", "consumption": "8712" }, { "effective_from": "2017-01-01", "effective_to": "2017-12-31", "consumption": "8716" } ] } ], "property_administrators": [ { "given_name": "Groundskeeper", "family_name": "Willie", "email": "groundskeeper@willie.com", "mobile": "07712354321", "landline": "+442076543210", "date_of_birth": "1955-23-02", "title": "Mr", "salutation": "Hi", "address1": "114A East Road", "address2": "Kirkwall", "address3": "Orkney", "address4": "", "address5": "", "postcode": "KW15 5LL", "effective_from": "2019-01-01", "effective_to": "2019-12-31", } ] } ], "contracts": [ { "mpxn": "1200060176720", "tariff_code": "ELEC-1234-J", "effective_from": "2019-06-01" }, { "mpxn": "9353824109", "tariff_code": "GAS-1234-J", "effective_from": "2019-06-01" } ], "last_statement_balance": "20.00", "last_statement_issue_date": "2019-08-01", "last_billed_to_date": "2019-08-01", "transfer_balance": "30.00", "current_statement_transactions": [ { "transaction_id": "1", "transaction_date": "2019-08-04", "amount": "10.00", "type": "REPAYMENT", "reason": "Customer refund", "payment_type": "" }, { "transaction_id": "2", "transaction_date": "2019-08-05", "amount": "20.00", "type": "PAYMENT", "reason": "Card payment" } ], "historical_statement_transactions": [ { "transaction_id": "3", "transaction_date": "2018-08-05", "amount": "10.00", "type": "PAYMENT", "reason": "Card payment" }, { "transaction_id": "4", "transaction_date": "2018-07-05", "amount": "10.00", "type": "CREDIT", "reason": "IMPORTED_CREDIT" } ], "payment_schedules": [ { "amount": "6.00", "day_of_month": 10, "frequency": "MONTHLY", "means": "DD", "start_date": "2018-01-01", "debt_repayment_element": "2.00", "debt_repayment_end_date": "2020-03-26" }, { "amount": "60.00", "day_of_month": 2, "frequency": "MONTHLY", "means": "DD", "start_date": "2018-01-01", } ], "references": [ { "namespace": "tentacle-energy.allpay-client-reference-numbers", "value": "1234567890" } ], "notes": [ { "created_at": "2018-10-10T10:20:00Z", "body": "This is a note", "document_paths": [ { "document_path": "/notes/1234/attachment.jpg" } ] } ], "statements": [ { "bill_period_from_date": "2019-06-01", "bill_period_to_date": "2019-07-01", "statement_path": "/EXTERNAL-1234/2019-06-01-to-2019-07-01.pdf" }, { "bill_period_from_date": "2019-07-01", "bill_period_to_date": "2019-08-01", "statement_path": "/EXTERNAL-1234/2019-07-01-to-2019-08-01.pdf" } ], "warm_home_discount": [ { "tax_year": "2017/18", "account_type": "CREDIT", "group": "CORE" } ], "dunning_path": [ { "path_name": "dunning.path.name", "start_date": "2020-03-26" } ], "debt": { "agency_name": "Debt R Us", "start_date": "2019-03-26", "is_insolvent": false, "cais_reference": "12345", "aged_debt": [ { "debt_amount": "123.00", "due_date": "2020-12-01" } ] }, "last_payment_review_date": "2019-06-01", "next_bill_due_date": "2019-09-20", "smart_read_frequency": "HALF_HOURLY", "smart_read_cycle_day": 10, "communication_preference": "ONLINE", "document_accessibility": "LARGE_PRINT", "account_campaigns": [ { "campaign_name": "Super Account", "campaign_note": "Campaign note" } ], "metadata": [ { "key": "metadata_key", "value": { "some_data": "some_value" } } ] }


Business account

{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "1234", "unknown_occupier": false, "customers": [ { "given_name": "Bob", "family_name": "Jabłoński", "email": "bob@jablonski.com", "mobile": "07123456789", "landline": "02072343456", "date_of_birth": "1989-01-11", "title": "Mr", "salutation": "Hi", "customer_preferences": { "opted_into_sms": true, "opted_into_recommended": true, "opted_into_updates": true, "opted_into_third_parties": true, "opted_into_offers": true, "is_user_psr_consent_obtained": true } } ], "billing_name": "Robert Jabłoński", "billing_address1": "123 Fake Street", "billing_address2": "", "billing_address3": "", "billing_address4": "", "billing_address5": "", "billing_postcode": "W1F 9DE", "is_business": true, "company_number": "12345678", "business_type": "LTD", "sales_channel": "DIRECT", "sales_subchannel": "", "supply_addresses": [ { "supply_address1": "123 Fake Street", "supply_address2": "", "supply_address3": "", "supply_address4": "", "supply_address5": "", "supply_postcode": "W1F 9DE", "is_landlord": false, "customer_at_supply_address_from_date": "2019-01-01", "meter_points": [ { "mpxn": "1200060176720", "mpid": "TENT", "supply_start_date": "2019-01-01", "meters": [ { "meter_serial_number": "0000000001", "installed_on": "2001-01-01", "registers": [ { "register_id": "1", "tpr": "00001", "number_of_digits": 5 }, { "register_id": "X", "tpr": "00043", "number_of_digits": 5, "is_settlement": false } ], "transfer_readings": [ { "register_id": "1", "reading_date": "2019-08-01", "reading_value": "1000.00", "reading_type": "CUSTOMER" } ], "reading_history": [ { "register_id": "1", "reading_date": "2019-06-20", "reading_value": "980.00", "reading_type": "CUSTOMER", "billed": true }, { "register_id": "1", "reading_date": "2019-05-20", "reading_value": "960.00", "reading_type": "ROUTINE", "billed": true } ] } ], "et_in_progress": false, "dr_in_progress": false, "ccl_exemptions": [ { "rate": "0.2", "effective_from": "2020-03-26" "effective_to": "2021-03-26" } ] "vat_exemptions": [ { "rate": "0.2", "effective_from": "2020-03-26" } ], "eac_history": [ { "effective_from": "2019-10-01", "tpr": "00001", "consumption": "1500", "source": "D0019" }, { "effective_from": "2019-09-01", "tpr": "00001", "consumption": "1300", "source": "D0019" } ] } ] } ], "contracts": [ { "mpxn": "1200060176720", "tariff_code": "ELEC-1234-J", "effective_from": "2019-06-01", "agreed_at": "2019-05-31T12:30:00Z" "bespoke_tariff_rates": [ { "meter_serial_number": "Z16N389556", "standing_charge": "3.25", "registers": [ { "register_id": "1", "unit_rate": "15.6" } ] } ] } ], "last_statement_balance": "20.00", "last_statement_issue_date": "2019-08-01", "last_billed_to_date": "2019-08-01", "transfer_balance": "30.00", "current_statement_transactions": [ { "transaction_id": "5", "transaction_date": "2019-08-04", "amount": "10.00", "type": "REPAYMENT", "reason": "Customer refund", "payment_type": "" }, { "transaction_id": "6", "transaction_date": "2019-08-05", "amount": "20.00", "type": "PAYMENT", "reason": "Card payment" } ] "payment_schedules": [ { "amount": "60.00", "day_of_month": 2, "frequency": "MONTHLY", "means": "DD", "start_date": "2018-01-01", } ], "references": [ { "namespace": "tentacle-energy.allpay-client-reference-numbers", "value": "1234567890" } ], "statements": [ { "bill_period_from_date": "2019-06-01", "bill_period_to_date": "2019-07-01", "statement_path": "/EXTERNAL-1234/2019-06-01-to-2019-07-01.pdf" }, { "bill_period_from_date": "2019-07-01", "bill_period_to_date": "2019-08-01", "statement_path": "/EXTERNAL-1234/2019-07-01-to-2019-08-01.pdf" } ], "dunning_path": [ { "path_name": "dunning.path.name", "start_date": "2020-03-26" } ], "debt": { "agency_name": "Debt R Us", "start_date": "2019-03-26", "is_insolvent": false, "cais_reference": "12345", "aged_debt": [ { "debt_amount": "123.00", "due_date": "2020-12-01" } ] }, "last_payment_review_date": "2019-06-01", "next_bill_due_date": "2019-09-20" }


The request payload must be a single account object containing the following fields:

import_supplier (string, required)

Code of the import supplier where the account is meant to be imported to. The import supplier code will be provided to you.

external_account_number (string, required)

Original customer identifier. Can’t be longer than 128 characters.

unknown_occupier (bool, required)

Whether the account belongs to an unknown occupier. If the value True, no customers will be expected in the payload.

billing_name (string, optional)

Optional billing name to be used in the account. If provided, it’ll be used for producing statements. If not, the customer names will be used. Can’t be longer than 510 characters.

billing_address1 (string, optional)

Customer billing address. Can’t be longer than 512 characters.

billing_address2 (string, optional)

Customer billing address. Can’t be longer than 512 characters.

billing_address3 (string, optional)

Customer billing address. Can’t be longer than 512 characters.

billing_address4 (string, optional)

Customer billing address. Can’t be longer than 512 characters.

billing_address5 (string, optional)

Customer billing address. Can’t be longer than 512 characters.

billing_postcode (string, optional)

Valid UK postcode of the billing address

is_business (bool, optional)

Whether the account is a business account.

account_billing_options (dict, optional)

Billing options for an account. Only available for business customers.

period_start_day (integer, optional)

The day of the month that a billing period starts.

period_length (string, optional)
One of

MONTHLY or QUARTERLY

dunning_path (dict, optional)

Fields related to the dunning path that this account should go onto.

path_name (string, required)

Name of the dunning path to set this account onto. This must be agreed upon before migration and is client specific.

start_date (string, optional)

Date on which to start the dunning path. If no date is provided, the dunning path will be restarted on migration.

debt (dict, optional)

Fields related to debt on the account.

agency_name (string, optional)

Name of the debt agency.

start_date (date, optional)

Start date of the debt proceeding. If an agency_name is provided but no start_date, the migration date is used.

is_insolvent (boolean, optional)

Is the account currently in insolvency.

cais_reference (string, optional)

The CAIS reference for this account.

aged_debt (list, optional)

List of aged debt on this account.

This is essentially the debt position of the account. Typically we report this based on a grouping by date. We can then report on the delinquency at 30+ or 60+ days etc. As such we need to know when the debt was generated.

The data we receive will be converted into a historic record of the debt, which we will continue to age within Kraken.

How you report it to Kraken is up to you, the more granular you provide it, the more accurate the debt ageing will be. If you group debt, it will result in sharp changes as the group transitions across a reporting boundary. But if that’s all you can provide, it is better than nothing.

For example, if debt is £150 and the customer has not paid us £50 a month then we could expect the following:

  • £50 - 2022-11-01

  • £50 - 2022-10-01

  • £50 - 2022-09-01

We would aggregate in our reporting to:

  • £50 (0-30 days)

  • £50 (31-60 days)

  • £50 (61-365 days)

  • £0 (365+ days)

In 2 months time (assuming they continue to not pay) this would be:

  • £50 (0-30 days)

  • £50 (31-60 days)

  • £150 (61-365 days)

  • £0 (365+ days)

debt_amount (decimal, optional)

Value of the aged debt.

due_date (date, optional)

Date on which the aged debt is due.

sales_channel (string, optional)
If provided must be one of:

DIRECT or PRICE_COMPARISON or TELESALES or DIGI_TELESALES or EVENTS or FIELD_SALES or AGGREGATOR or PARTNERSHIPS or NEW_TENANT or WORKPLACE_POP_UP or BROKER or PARENT_POWER or SUPPLIER_OF_LAST_RESORT or ACQUISITION

A default sales_channel can also be set on the import supplier - this is done by a member of the Kraken tech team when setting up an import supplier. These are the rules around how the sales channel gets assigned:

  • If a default is set on the import supplier, and the import supplier is configured to override the value in the payload, the override will be used.

  • If a default is provided on the import supplier, but the import supplier is configured not to override the value in the payload, then default will only be used if the sales_channel value in the payload is not provided or is an empty string.

  • If no default sales channel is set on the import supplier and the import supplier is set to override the value in the payload, then we default to using ACQUISITION as the sales_channel.

  • If a default is not set on the import supplier and the import supplier is not set to override the value in the payload and there is no value in the payload, then the sales channel will be set to an empty string.

sales_subchannel (string, optional)

Free text to be used as sales information of the account.

If the import supplier is set to override the value in the payload, then the import supplier name will be used as the value for the sales_subchannel.

transfer_balance (decimal, optional)

The balance that will be transferred over to Kraken, in pounds. Credit balances must be positive, debit balances must be negative. Note that any transactions related to a prepay meter (i.e. those with a to_prepay_meter_serial_number) should not be included in this balance.

last_statement_balance (decimal, optional)

The balance of the latest statement, in pounds, issued by the previous supplier. Credit balances must be positive, debit balances must be negative. Note that, as for the transfer_balance, any transactions related to a prepay meter should not be included in this balance.

last_billed_to_date (date, optional)

Date up to which consumption has been billed to. This is optional but must appear at either the account level or for all on-supply (i.e. don’t have a removed_on date on the meter) individual gas meters and electricity registers, or both. If a value is provided on both the account and the meter/register then the meter/register last_billed_to_date’s will be used for the purposes of validating consumption against the meter point.

If the account has never been billed before, this should be the supply start date for the account and Kraken will bill from then.

This value is also used for the last_statement_closing_date and last_statement_issue_date when those values are not provided. In that case, if it is provided at the meter and register level, the earliest such value is used.

last_statement_closing_date (date, optional)

Date when the last statement was closed.

Kraken will create an initial closed statement for all historical transactions, and will use this value for its closing date. This also means that Kraken will bill any transactions (but not necessarily consumption) from the day after this date.

For backwards compatibility, when this value is omitted the importer will tolerate either current or historical transactions (but not both!) being on the last_billed_to_date and adjust appropriately. However, if last_statement_closing_date is supplied, historical transactions can be on or before this date, but any current transactions must be strictly after this date.

last_statement_issue_date (date, optional)

Date when the last statement was issued. If this date is not given, last_billed_to_date will be used as the issue and close date of the initial statement. This field is required if historical transactions are supplied

next_bill_due_date (date, optional)

Date of when it’s expected to issue the next bill.

smart_read_frequency (string, optional)

One of MONTHLY or DAILY or HALF_HOURLY or DENIED.

smart_read_cycle_day (integer, optional)

Smart meter billing day of the month. Values between 1 to 28.

complaints (array, optional)

Open complaints that have been raised by the customer.

created_at (datetime, required)

The datetime the complaint was created at.

type_of_complaint (string, required)

The type of the complaint. One of: B10_FEED_IN, B11_PAYMENT, B12_PRICING, B13_BILLING_METER_UNRELATED, B14_BILLING_SMART_METER, B15_SWITCHING_METER_UNRELATED, B16_SWITCHING_SMART_CREDIT, B17_SWITCHING_SMART_PREPAY, B18_METER_CLASSIC_CREDIT, B19_METER_SMART_CREDIT, B20_METER_CLASSIC_PREPAY, B21_METER_SMART_PREPAY, B22_OTHER, B5_DEBT_NON_PREPAY, B6_DEBT_PREPAY, B7_SALES_DIRECT, B8_SALES_THIRD_PARTY, B9_CUSTOMER_SERVICE

subtype_of_complaint (string, required)

The subtype of the complaint. One of: B10_DELAY_IN_PAYMENT, B10_DELAY_IN_REGISTRATION, B10_DISPUTED_READING, B11_DD_INSTRUCTIONS, B11_DD_SCHEDULE, B11_MISSED_DD, B11_ONE_OFF_PAYMENT, B11_OUTGOING_PAYMENTS, B11_PAYMENT_ADEQUACY, B11_REFERRAL, B12_TARIFF_FLEX_INCREASE, B12_TARIFF_INCORRECT, B12_TARIFF_RENEWAL, B13_ACQUISITION_BILLING, B13_BACK_BILLING, B13_CATCH_UP_BILLING, B13_DISPUTED_READING, B13_ESTIMATED, B13_FINAL_BILL, B13_INCORRECT_BILLING, B13_LATE_BILL, B13_NO_BILLS_ISSUED, B13_REFUND, B13_WHD, B14_BACK_BILLING, B14_CATCH_UP_BILLING, B14_DISPUTED_READING, B14_ESTIMATED, B14_FINAL_BILL, B14_INCORRECT_BILLING, B14_LATE_BILL, B14_NO_BILLS_ISSUED, B14_REFUND, B14_SMART_READINGS_NOT_TAKEN, B14_WHD, B15_CANCELLED_CONTRACT_NOT_ACTIONED, B15_CROSSED_METER, B15_DISPUTED_READING, B15_ERRONEOUS_TRANSFER, B15_INCORRECT_MPAN, B15_INCORRECT_MPRN, B15_OBJECTED, B15_REJECTION, B15_SWITCH_NOT_ACTIONED, B16_CANCELLED_CONTRACT_NOT_ACTIONED, B16_DISPUTED_READING, B16_ERRONEOUS_TRANSFER, B16_INCORRECT_MPAN, B16_INCORRECT_MPRN, B16_INCORRECT_MTD, B16_OBJECTED, B16_REJECTION, B16_SWITCH_NOT_ACTIONED, B17_CANCELLED_CONTRACT_NOT_ACTIONED, B17_DISPUTED_READING, B17_ERRONEOUS_TRANSFER, B17_INCORRECT_MPAN, B17_INCORRECT_MPRN, B17_INCORRECT_MTD, B17_OBJECTED, B17_REJECTION, B17_SWITCH_NOT_ACTIONED, B18_METER_FAULT_ACCURACY, B18_METER_READINGS_INCORRECT, B18_METER_READINGS_TMA, B18_NEW_CONNECTION, B18_SITEWORKS_APPOINTMENT_ERROR, B18_SITEWORKS_CUSTOMER_SERVICE, B18_SITEWORKS_METER_FAULT, B18_SITEWORKS_MISSED_APPOINTMENT_MOP, B18_SITEWORKS_MISSED_APPOINTMENT_OPS, B19_IN_HOME_DISPLAY, B19_METER_FAULT_ACCURACY, B19_METER_READINGS_INCORRECT, B19_METER_READINGS_TMA, B19_NEW_CONNECTION, B19_OUTGOING, B19_SITEWORKS_APPOINTMENT_ERROR, B19_SITEWORKS_CUSTOMER_SERVICE, B19_SITEWORKS_METER_FAULT, B19_SITEWORKS_MISSED_APPOINTMENT_MOP, B19_SITEWORKS_MISSED_APPOINTMENT_OPS, B19_SMART_READINGS_NOT_TAKEN, B19_SMART_TARIFF, B20_KEY_CARD_NOT_RECEIVED, B20_KEY_CARD_NOT_WORKING, B20_METER_FAULT_ACCURACY, B20_METER_READINGS_INCORRECT, B20_METER_READINGS_TMA, B20_NEW_CONNECTION, B20_SITEWORKS_APPOINTMENT_ERROR, B20_SITEWORKS_CUSTOMER_SERVICE, B20_SITEWORKS_METER_FAULT, B20_SITEWORKS_MISSED_APPOINTMENT_MOP, B20_SITEWORKS_MISSED_APPOINTMENT_OPS, B21_IN_HOME_DISPLAY, B21_KEY_CARD_NOT_RECEIVED, B21_KEY_CARD_NOT_WORKING, B21_METER_FAULT_ACCURACY, B21_METER_READINGS_INCORRECT, B21_METER_READINGS_TMA, B21_NEW_CONNECTION, B21_SITEWORKS_APPOINTMENT_ERROR, B21_SITEWORKS_CUSTOMER_SERVICE, B21_SITEWORKS_METER_FAULT, B21_SITEWORKS_MISSED_APPOINTMENT_MOP, B21_SITEWORKS_MISSED_APPOINTMENT_OPS, B21_SMART_READINGS_NOT_TAKEN, B22_OTHER, B5_ACQUISITION_DEBT, B5_DEBT_RECOVERY, B5_DISCONNECTIONS, B5_DISPUTING_DEBT, B5_PAYMENT_PLAN, B6_ACQUISITION_DEBT, B6_DEBT_RECOVERY, B6_DISCONNECTIONS, B6_DISPUTING_DEBT, B6_DISPUTING_DEBT_LIABILITY, B6_PAYMENT_PLAN, B6_PPM_WARRANT_ISSUES, B6_PP_REMOTE_SWITCH, B6_SELF_DISCONNECTION, B7_MIS_SELLING_ONLINE, B7_MIS_SELLING_PHONE, B8_CUSTOMER_SERVICE, B8_MIS_SELLING_FACE_TO_FACE, B8_MIS_SELLING_ONLINE, B8_MIS_SELLING_PHONE, B9_CUSTOMER_SERVICE, B9_GDPR_BREACH, B9_WAIT_TIME, B9_WEBSITE_ISSUES,

official_reference_number (string, optional)

The official reference number of the complaint if it is an official complaint.

official_entity (string, optional)

The official entity of the complaint if it is an official complaint. One of: EHU, OMBUDSMAN

official_status (string, optional)

The official status of the complaint if it is an official complaint. One of: CASE CLOSED, CASE CLOSED (FCR), DECISION ACCEPTED, DECISION APPEALED, DECISION ISSUED, DECISION ISSUED (CUSTOMER RESPONSE NEEDED), DISPUTE RAISED, PREPARE CASE, PROPOSAL ACCEPTED (FCR), PROPOSAL ISSUED (FCR), SUCCESSFUL DISPUTE, UNDER INVESTIGATION

complainant_name (string, required)

The name of the complainant. This should be the name of a customer related to the account unless the complaint was raised by another person.

complainant_email (string, required)

The email address of the complainant. This should be the email address of a customer related to the account unless the complaint was raised from a different email address.

has_chsr_letter_been_sent (bool, required)

Whether the customer has been sent a CHSR letter for the complaint.

has_eight_week_letter_been_sent (bool, required)

Whether the customer has been sent an eight week letter for the complaint.

complaint_contacts (array, required)

The customer contacts related to the complaint.

created_at (datetime, required)

The datetime the complaint contact was created at.

communication_method (string, required)

The method of communication used to contact regarding the complaint. One of LANDLINE, MOBILE, EMAIL, POST

communication_source (string, required)

The source of communication used to contact regarding the complaint. One of TELEPHONE, ONLINE, PERSON, POST, SOCIAL_MEDIA, CUSTOMER_SURVEY

status (string, required)

The status of the complaint at the time the contact was made to track status changes, e.g. resolution. One of OPEN, NO_CONTACT, REOPENED, DEADLOCK

body (string, required)

The body of text or a summary of the contact regarding the complaint.

company_number (string, optional)

Company number for a business account. Can’t be longer than 8 characters.

business_type (string, optional)

Business type of a business account. One of SOLE_TRADER or LTD or PARTNERSHIP or CHARITY or PLC or LLP or TRUST or TRADING_AS or GOVERNMENT or NON_PROFIT or CHURCH

communication_preference (string, optional)

One of ONLINE or PRINT. The default is ONLINE.

document_accessibility (string, optional)

One of LARGE_PRINT or BRAILLE or SPOKEN.

account_campaigns (array, optional)

Campaign to add to an account. This is a category an account can be in which will be highlighted on the main account view.

campaign_name (string, required)

Name of the campaign. Options need to be passed to the Kraken Technologies team beforehand.

campaign_note (string, optional)

This will create an account note, and will link it from the account campaign.

expiry_date (date, optional)

Date from which the campaign is no longer valid.

contracts (array, optional)

Only contracts valid since last billed (including future ones where notified).

Given historical contracts will only be imported into Kraken as “import agreements” if there are no gaps or overlaps on their effective dates.

mpxn (string, required)

MPAN or MPRN of the meter point this contract is for.

tariff_code (string, required)

Code of the contract tariff. Must match an existing tariff code of an active product.

effective_from (date, required)

Date the contract is valid from (inclusive).

effective_to (date, optional)

Date the contract is valid to (exclusive).

agreed_at (datetime, optional)

Datetime the contract was agreed at.

is_hh (bool, optional)

Set to true if the contract is billed half-hourly

bespoke_tariff_rates (array, optional)

Details on a bespoke tariff, if applicable. Usually only relevant for business accounts.

meter_serial_number (string, required)

Meter serial number to which the bespoke tariff applies

standing_charge (decimal, required)

The value in pence per day of the charge (excluding VAT).

unit_rate (decimal, optional)

The value in pence per kWh of the charge (excluding VAT). This field should be used for gas meters.

payment_method (string, optional)

The payment method for the bespoke rate. Only used for payment price switching enabled bespoke rates. One of DD (Direct debit) or NDD (Non-direct debit) or PP (Prepayment).

registers (array, optional)

For elec meters, the unit rates are provided on a per register basis in this array

register_id (string, optional)

The identifier of the register to which this unit rate applies.

rate_type (string, optional)

The rate type of the unit rate. One of STANDARD or ECO7_DAY or ECO7_NIGHT. If the register_id is not provided, the rate type must be provided instead.

unit_rate (decimal, required)

The value in pence of the charge (excluding VAT).

start_time (time, optional)

The time of day at which this rate comes into force for HH billed contracts. N/A for NHH and optional for single rate HH.

commission_contracts (array, optional)

Commission contract (TPI) per meter point.

mpxn (string, required)

MPAN or MPRN of the meter point this contract is for.

effective_from (date, required)

Date the contract is valid from (inclusive).

effective_to (date, required)

Date the contract is valid to (exclusive).

affiliate_organisation_name (string, required)

Name of the affiliate organisation this contract is with.

commission_type (str, optional)

Type of commission. Defaults to UNIT_RATE_UPLIFT.

value (decimal, required)

The value of the commission (e.g. unit rate uplift) in pence.

status (string, required)

Whether a contract is fully paid up or still needs payment (is payable). One of PAID or PAYABLE

current_statement_transactions (array, optional)

Transactions that are meant to be billed by Kraken. These could be the transactions that took place after the last statement was issued or all of the transactions that have taken place since the account was created if it has never been billed before.

The value of these transactions, plus the last_statement_balance, must add up to the transfer_balance. Note that any transactions related to a prepay meter are not included in the above check.

A note on prepay consumption charges:

Transactions of type CHARGE with a consumption reason (Electricity or Gas) that are marked as being “to a prepay meter” indicate a consumption charge that is known to have been carried out _by_ the prepay meter (i.e. a meter-driven charge); Such a transaction definition is _not_ appropriate for migrating a consumption charge carried out by the supplier that was/will be reconciled against the meter’s behaviour (i.e. an account-driven charge). The latter are not expected to be explicitly migrated, as they should always be included in both an issued bill and the balances reported in the set of prepay_details for the relevant prepay meter.

transaction_id (string, required)

Unique internal identifier for this transaction.

transaction_date (date, required)

Date when the transaction was effective.

amount (decimal, required)

Number to 2 decimal places (pounds) e.g. if the customer has a consumption charge worth £23.43, this equates to a transaction of type CHARGE of £23.43. Payments and repayments must be positive numbers. Generally charges and credits are also positive, but may be negative to represent reversed charges or credits, or if an incorrect estimated reading has resulted in a negative consumption charge.

type (string, required)

One of CHARGE or CREDIT or PAYMENT or REPAYMENT or TRANSFER.

The amount of a CHARGE or REPAYMENT transaction is subtract from the last_statement_balance when validating the transfer_balance.

The amount of a CREDIT or PAYMENT transaction is added to the last_statement_balance when validating the transfer_balance.

TRANSFER transactions are neutral, as they represent transfers between different ledgers in a single (Kraken) account; they have no impact on the validation of the transfer_balance.

reason (string, optional)

If the transaction is of PAYMENT type, one of the following: ACCOUNT_CHARGE_PAYMENT or BALANCE_ADJUSTMENT or GENERAL_CREDIT or SSD_PAYMENT or DEBT_REPAYMENT.

If the transaction is of REPAYMENT type, one of the following: FULL_CREDIT_REFUND or PARTIAL_CREDIT_REFUND or ET_REFUND or FINAL_BALANCE_SETTLEMENT or MISTAKEN_PAYMENT_TAKEN or COMPLAINT_COMPENSATION or INDEMNITY_CLAIM or FAILED_PAYMENT.

If the transaction is of CREDIT type, one of the following: ACCURACY_TEST_ADJUSTMENT or CUSTOMER_SERVICE_GESTURE or DISC_WARM_HOME_DISCOUNT or EXIT_FEE_REFUND or FEED_IN_TARIFF_PAYMENT or GAS_NETWORK_COMPENSATION or JOINING_REWARD or LOYALTY_REWARD or MISSED_SAVINGS or REFERRAL_REWARD or RETURNED_BUSINESS_PREPAYMENT or SALES_COMPENSATION or EXPORT_TARIFF_PAYMENT or WRITE_OFF_BANKRUPTCY or WRITE_OFF_DECEASED or WRITE_OFF_DRO or WRITE_OFF_IVA or WRITE_OFF_NEGLIGIBLE_VALUE or WRITE_OFF_UNRECOVERABLE_DEBT or WRITE_OFF_PAST_BILLABLE or WRITE_OFF_RECOVERY_DISCOUNT or WITHDRAWAL_NOT_ACTIONED or STAFF_DISCOUNT or DIRECT_DEBIT_DISCOUNT or STANDARDS_OF_PERFORMANCE_ET_COMMS_OVERDUE or STANDARDS_OF_PERFORMANCE_ET_LOSS_UNRESOLVED or STANDARDS_OF_PERFORMANCE_ET_GAIN_UNRESOLVED or STANDARDS_OF_PERFORMANCE_CUSTOMER_NOT_RETURNED or ADDITIONAL_SOP_PAYMENT_ET_COMMS_OVERDUE or ADDITIONAL_SOP_PAYMENT_ET_LOSS_UNRESOLVED or ADDITIONAL_SOP_PAYMENT_ET_GAIN_UNRESOLVED or ADDITIONAL_SOP_PAYMENT_CUSTOMER_NOT_RETURNED or STANDARDS_OF_PERFORMANCE_APPOINTMENTS_STANDARD_VISIT_ELEC or STANDARDS_OF_PERFORMANCE_APPOINTMENTS_FAULTY_METER_ELEC or STANDARDS_OF_PERFORMANCE_APPOINTMENTS_PREPAY_METER_ELEC or STANDARDS_OF_PERFORMANCE_APPOINTMENTS_RECONNECTION_ELEC or STANDARDS_OF_PERFORMANCE_APPOINTMENTS_STANDARD_VISIT_GAS or STANDARDS_OF_PERFORMANCE_APPOINTMENTS_FAULTY_METER_GAS or STANDARDS_OF_PERFORMANCE_APPOINTMENTS_PREPAY_METER_GAS or STANDARDS_OF_PERFORMANCE_APPOINTMENTS_RECONNECTION_GAS or STANDARDS_OF_PERFORMANCE_REFUND_ISSUED_LATE or STANDARDS_OF_PERFORMANCE_FINAL_BILL_ISSUED_LATE or ADDITIONAL_SOP_PAYMENT_APPOINTMENTS or BALANCE_ADJUSTMENT or BALANCE_TRANSFER or BANK_TRANSFER or CUSTOMER_REIMBURSEMENT or DISPUTED_CARD_PAYMENTS or IMPORTED_CREDIT or MARKET_RESEARCH_CLUB_REWARD or OFFSET or PREPAY_DEBT_ADJUSTMENT or REINSTATED_DIRECT_DEBIT or REVERSED_ACCOUNT_CHARGE or DATA_IMPORT_BALANCE_TRANSFER or BALANCE_TRANSFER_FOR_FINAL_BILLED_ACCOUNT or SUPPLEMENTARY_LEDGER_BALANCE_TRANSFER or SHARE_OF_PROFITS or GOODWILL_PAYMENT or DEPOSIT_REFUND or ERRONEOUS_TRANSFER_REFUND or DEBIT_BALANCE_TRANSFER or TARIFF_PRICE_ADJUSTMENT_GOODWILL or ECONOMY_7_DIFFERENCE or WRITE_OFF_BACK_BILLING or WRITE_OFF_MISSED_PAYMENT_DELETION or TARIFF_DISCOUNT or STANDARDS_OF_PERFORMANCE_ERRONEOUS_TRANSFER or ADDITIONAL_SOP_PAYMENT_ERRONEOUS_TRANSFER or EBSS_CREDIT

If the transaction is of CHARGE type, one of the following: DEFAULT or BALANCE_TRANSFER or SUPPLEMENTARY_LEDGER_BALANCE_TRANSFER or CREDIT_BALANCE_DONATED_TO_CHARITY or DIRECT_DEBIT_REFUND_BALANCING or METERING_JOB_BUSINESS or METERING_JOB_NATIONAL_GRID or METERING_JOB_SMS or NEST_LEARNING_THERMOSTAT_RENTAL or PENALTY_CHARGE or PREPAY_DEBT_ADJUSTMENT or REVERSED_ACCOUNT_CREDIT or BUSINESS_PREPAYMENT or WRITE_BACK or EARLY_EXIT_FEE or DCA_CHARGE or EBSS_CHARGE_REVERSAL or Electricity or Gas.

If the transaction is of TRANSFER type, one of the following: PREPAY_DEBT_ADJUSTMENT

If a reason other than the above is given for transaction types CHARGE and CREDIT, this will be displayed in Kraken and to the customer.

reference (string, optional)

Transaction reference. Could be an external id to help identify this transaction

to_prepay_meter_serial_number (string, optional)

The serial number of the prepay meter to which this transaction relates. Transactions not related to a prepay meter should not provide this field.

Note that only certain types of prepay-related transactions are valid. These are:

  • Prepay vends that occurred since the last statement. These must have a type of PAYMENT and payment type of CASH. Additionally, they may only be included in current_statement_transactions.

  • Prepay financial imbalances, which represent any discrepancy between the balance on the meter and the balance in the pre-migration billing system. These must have a type of CREDIT or CHARGE and a reason of DATA_IMPORT_BALANCE_TRANSFER. Additionally, they may only be included in historical_statement_transactions. As an example, if the billing system contains a debt of £100 that has not yet been loaded onto the meter, this should be represented as a charge of £100 (with the reason listed above).

payment_type (string, optional)

If the transaction is of PAYMENT type, one of the following: DD_FIRST_COLLECTION or DD_REGULAR_COLLECTION or DD_RE_PRESENTATION or DD_FINAL_COLLECTION or CREDIT_CARD or DEBIT_CARD or CHEQUE or BACS_DEPOSIT or ALLPAY_CASH or ALLPAY_CARD or ALLPAY_CHEQUE or PAYPOINT_CASH or PAYPOINT_CARD or PAYPOINT_CHEQUE or PAYZONE or POST_OFFICE_CASH or POST_OFFICE_CHEQUE or POST_OFFICE_SAVINGS_STAMPS or POST_OFFICE_CARD or DCA_COLLECTION or BRISTOL_POUND or CASH or FUEL_DIRECT.

If the transaction is of REPAYMENT type, one of the following: DIRECT_CREDIT or CARD_REFUND or BACS or CHEQUE.

If the PAYMENT was a prepayment top-up vend, payment_type should be CASH.

display_note (string, optional)

If the transaction is of CREDIT or CHARGE type, the customer-facing note that can be displayed in a statement or email to the customer.

note (string, optional)

For internal use only. Note is displayed on the support site and not visible in the bills.

customers (array, optional)

given_name (string, optional)

Required for business accounts. Can’t be longer than 255 characters.

family_name (string, optional)

Optional for business accounts but required for domestic accounts. If not provided for Business accounts, Business will be used as a default value. Can’t be longer than 255 characters.

email (string, optional)

Customer’s email they’ll use for logging into the online portal. Can’t be longer than 254 characters.

role (string, optional)

Role for the customer to have on the provided account. For details of the available choices and default value, see Customer roles.

mobile (string, optional)

Customer’s personal mobile number. Can’t be longer than 32 characters.

landline (string, optional)

Customer’s landline phone number. Can’t be longer than 32 characters.

date_of_birth (date, optional)

title (string, optional)

Preferred title by the customer. Can’t be longer than 20 characters.

salutation (string, optional)

Preferred salutation by the customer. Can’t be longer than 128 characters.

deceased (string, optional)

One of Reported or Confirmed.

unable_to_read_meters (bool, optional)

Whether the customer is unable to read their meters themselves. It will be False by default.

credit_score (integer, optional)

A number between 0 and 9999 representing the customers credit score.

credit_risk_bracket (string, optional)

One of LOW, MID, HIGH or UNKNOWN.

psr (array, optional)

Priority service register. Includes fields shown below in green.

elec_industry_code (string, optional)

Must be a valid electricity industry code.

gas_industry_code (string, optional)

Must be a valid gas industry code.

effective_from (date, optional)

Date the PSR entry is effective from.

effective_to (date, optional)

Date the PSR entry is effective to.

additional_information (string, optional)

Additional information for this PSR entry, e.g. a language in case the customer does not speak English.

customer_preferences (dict, optional)

opted_into_sms (bool, optional)

Whether the customer is opted into sms communications. It will be False by default.

opted_into_recommended (bool, optional)

Whether the customer is opted into non-critical such as Direct Debit and meter reading reminders. It will be True by default.

opted_into_updates (bool, optional)

Whether the customer is opted into non-critical emails other than the recommended ones. It will be False by default.

opted_into_third_parties (bool, optional)

Whether the customer is opted into third party partner companies. It will be False by default.

opted_into_offers (bool, optional)

Whether the customer is opt into offers. It will be False by default.

opted_into_associated_companies (bool, optional)

Whether the customer is opted in to messages from associated companies. It will be False by default.

is_user_psr_consent_obtained (bool, optional)

Whether the customer consented to PSR data being used.

partner_password (string, optional)

PSR password for the customer. Cannot be more than 10 characters.

metadata (array, optional)

An array of key value pairs for storing generic metadata relating to a customer.

key (string, required)

Key on which the metadata will be stored on.

value (dict, required)

A json object containing any arbitrary piece of data to store in relation to the customer.

historical_statement_transactions (array, optional)

If historical transactions are given, their value must add up to the given last_statement_balance. Note that any transactions related to a prepay meter are not included in the above check.

For a description of the fields, see current_statement_transactions.

payment_schedules (array, optional)

List of active payment schedules linked to the account.

means (string, required)

One of DD or CARD or MANUAL This corresponds to the 3 different types of payment schedules Kraken supports: Card, Direct Debit, or manual payments, i.e. those where the customer initiates the payment. The actual means are unknown, but could be cash/cheque or bank transfers.

frequency (string, optional)

One of MONTHLY or QUARTERLY or WEEKLY or FORTNIGHTLY. Required for fixed schedules.

start_date (date, required)

The payment schedule start date. If WEEKLY or FORTNIGHTLY is chosen as the frequency the start_date determines the day of the week the payment is taken.

end_date (date, optional)

The payment schedule end date. This field should be empty if the payment schedule is ongoing.

day_of_month (integer, optional)

Integer, between 1 and 28. Defaults to null. Required for fixed schedules.

amount (decimal, optional)

Positive number with 2 decimal places (pounds). Required for schedules with no trigger, or where the trigger is REGULAR. Defaults to "0.0" if not provided.

If a debt_repayment_element is given, the amount must contain the regular schedule amount + the debt_repayment_element.

trigger (string, optional)

Either BILL or REGULAR. If not provided we create a fixed schedule, i.e. trigger = REGULAR. A BILL triggered schedule creates a ledger balance clearing payment when a statement or invoice is issued.

paid_by (string, optional)

FUEL_DIRECT or CUSTOMER. Defaults to the CUSTOMER if not provided.

debt_repayment_element (decimal, optional)

The contribution to the amount in addition to the regular fixed schedule payment amount.

debt_repayment_element = amount - fixed schedule amount

If passed in, debt_repayment_end_date must also be passed in.

debt_repayment_end_date (date, optional)

Date on which the debt repayment will no longer be taken in addition to the regular payment.

payment_instructions (array, optional)

List of payment instructions to create for the account.

vendor (str, required)

Please contact the tech team for the names of the vendors available to you.

reference (str, required)

The reference of the mandate as known by the vendor. Can’t be longer than 512 characters.

customer_reference (str, optional)

Although not required for payment instructions to take payments, if provided it keeps Kraken’s data in sync with customer’s account in the payment vendor’s systems.

type (str, required)

One of DIRECT_DEBIT and CARD.

valid_from (date, optional)

Defaults to today if not provided.

contribution_agreements (array, optional)

Contribution Agreements

scheme (string, required)

Scheme code

interval (string, required)

Charge Interval. Options are: - MONTHLY - QUARTERLY

amount (decimal, required)

Amount as a decimal. Eg. 10.00. The amount to contribute.

active_period_start_date (date, required)

Date the agreement is valid from.

active_period_end_date (date, optional)

Date the agreement is valid to.

periods (array, optional)

Previous and current contribution periods.

start_date (date, required)

Date the period is valid from.

end_date (date, required)

Date the period is valid to.

fulfilled_at (datetime, optional)

Datetime the amount was charged for

deposit_agreements (array, optional)

Deposit Agreements. Only allow to migrate 1 deposit agreement atm

deposit_amount (decimal, required)

Amount as a decimal. Eg. 500.00.

reason (string, required)

Deposit reason.

accepted_at (datetime, optional)

Datetime when the customer accepted to pay the deposit.

fulfilled_at (datetime, optional)

Datetime when the customer fulfilled the deposit.

last_interest_date (date, optional)

Date when the last interest was calculated. Only allowed when agreement is fulfilled. fulfilled_at cannot be greater than last_interest_date.

payment_plans (array, optional)

Active payment plans.

strategy_name (string, required)

The name of the strategy the plan uses. Please discuss with the tech team to determine the strategy to use.

payments (array, required)

The payments that form the payment plan.

payment_date (date, required)

The date the payment should be made.

total_amount (integer, required)

The total amount the payment is for in pence.

amount_components (array, required)

The components of the payment that form the total amount. Can be an empty array if the payment is not broken into components. The amounts must sum up to the total_amount.

component_type (string, required)

The type of the component. The options will depend on the strategy so please discuss with the tech team to determine the correct values.

amount (integer, required)

The amount of the component in pence.

accepted_at (datetime, required)

The datetime (with timezone) the payment plan was accepted.

schedule_means (string, required)

One of DD or CARD or MANUAL. The payment type of the schedule used to generate the planned payments. This corresponds to the 3 different types of payment schedules Kraken supports.

last_payment_review_date (date, optional)

Date when the last payment review took place, must be in the past. If this is provided then payment_adequacy_changes below must not be included in the payload. Providing this date will create a single payment adequacy change against the account for this date. Default values will be entered for the other fields on the payment review as follows:

  • last_payment_review_date - 0

  • new_direct_debit - 0

  • existing_direct_debit_payment - 0

  • current_balance - 0

  • target_balance - 0

  • balance_adjustment - 0

  • average_monthly_charge - 0

  • average_monthly_elec_charge - 0

  • average_monthly_gas_charge - 0

  • applied_at - midnight of the last_payment_review_date

  • should_not_be_applied_reason - Historical record created as part of the migration of this account into Kraken. No value other that of the last payment review date was provided. This item serves as a historical record that a PA review took place in the previous system.

  • created_at - midnight of the last_payment_review_date

payment_adequacy_changes (array, optional)

List of completed payment adequacy reviews for this account. If this is provided then the last_payment_review_date must not be provided.

new_direct_debit (integer, required)

The recommended new credit card or Direct Debit payment amount in pence.

existing_direct_debit_payment = (integer, required)

The credit card or Direct Debit amount in pence at the time of review.

current_balance (integer, required)

Account balance in pence at the date of the payment adequacy run.

target_balance (integer, required)

The target balance for the account in pence after 12 months.

balance_adjustment (integer, required)

The adjustment in pence on top of the average monthly charge, to be used as the new direct debit payment. This can be 0 if the difference between current and target balance is small enough to not act on.

average_monthly_charge (integer, required)

The average monthly charge for this account in pence, if we sum all yearly charges and divide them by 12.

average_monthly_elec_charge (integer, required)

The average monthly electricity charge for this account in pence, if we sum all yearly electricity charges and divide them by 12.

average_monthly_gas_charge (integer, required)

The average monthly gas charge for this account in pence, if we sum all yearly gas charges and divide them by 12.

applied_at (datetime, optional)

The datetime the payment adequacy change was applied and the customer was notified. This should be None if payment adequacy change was not applied.

should_not_be_applied_reason (str, optional)

The reason why this payment adequacy change was not applied. This should be None if it was applied.

created_at (datetime, required)

The datetime the payment adequacy change was created.

references (array, optional)

List of account references for a variety of use cases.

namespace (str, required)

The namespace refers to the particular context the reference exists in. For example, tentacle-energy.allpay-client-reference-numbers.

value (str, required)

The unique identifier for the account.

notes (array, optional)

List of notes linked to the account. A body or a document_path must be provided.

body (string, optional)

Should include who/what created the note if this is required.

document_paths (array, optional)

A list of paths to documents attached to the note.

document_path (string, required)

S3 relative path of document attached to the note.

created_at (datetime, optional)

is_pinned (boolean, optional)

If set to true, this will make the note a pinned note.

unpin_at (datetime, optional)

When the pinned note should be unpinned. Has to be later than created_at` if this is provided. Has no effect if the note is not pinned.

statements (array, optional)

List of historical statements.

statement_path (string, required)

S3 relative path of the statement PDF file.

bill_period_from_date (date, required)

The statement start date.

bill_period_to_date (date, required)

The statement end date.

statement_id (string, required)

The ID of the statement.

number (string, optional)

The external customer facing statement number.

gross_amount (integer, optional)

The statement gross amount, in pence.

warm_home_discount (array, optional)

List of warm home discount related data items.

tax_year (string, optional)

Tax year that the warm home discount was paid. Should be in the format YYYY/YY e.g. 2019/20.

account_type (string, optional)

Type of account for the purpose of paying out the credit. One of CREDIT or PREPAY. Defaults to CREDIT.

group (string, optional)

Whether the customer falls into the core or broader group. One of CORE or BROADER. Defaults to CORE.

supply_addresses (array, optional)

List of active supply addresses linked to the account.

supply_address1 (string, required)

First line of the supply address. Can’t be longer than 512 characters.

supply_address2 (string, optional)

Supply address. Can’t be longer than 512 characters.

supply_address3 (string, optional)

Supply address. Can’t be longer than 512 characters.

supply_address4 (string, optional)

Supply address. Can’t be longer than 512 characters.

supply_address5 (string, optional)

Supply address. Can’t be longer than 512 characters.

supply_postcode (string, required)

Valid UK postcode of the supply address. Can’t be longer than 8 characters.

is_landlord (bool, optional)

Denote that account holder is the landlord of the property.

landlord_details (array, optional) DEPRECATED

This is a legacy field. If possible the property_administrators field below should be used instead.

Details of any persons who are considered administrators of the supply address.

Only one entry is currently permitted - additional users need to be added via the support site.

This user will be granted admin access to all accounts within the same portfolio.

given_name (string, optional)

Required for business accounts. Can’t be longer than 255 characters.

family_name (string, optional)

If not provided for Business accounts, Business will be used as a default value. Can’t be longer than 255 characters.

email (string, optional)

Customer’s email they’ll use for logging into the online portal. Can’t be longer than 254 characters.

mobile (string, optional)

Customer’s personal mobile number. Can’t be longer than 32 characters.

landline (string, optional)

Customer’s landline phone number. Can’t be longer than 32 characters.

date_of_birth (date, optional)

title (string, optional)

Preferred title by the customer. Can’t be longer than 20 characters.

salutation (string, optional)

Preferred salutation by the customer. Can’t be longer than 128 characters.

deceased (string, optional)

One of Reported or Confirmed.

address1 (string, optional)

Landlord address. Can’t be longer than 512 characters.

address2 (string, optional)

Landlord address. Can’t be longer than 512 characters.

address3 (string, optional)

Landlord address. Can’t be longer than 512 characters.

address4 (string, optional)

Landlord address. Can’t be longer than 512 characters.

address5 (string, optional)

Landlord address. Can’t be longer than 512 characters.

postcode (string, optional)

Valid UK postcode of the billing address.

property_administrators (array, optional)

Details of any persons who are considered administrators of the supply address.

Only one entry is currently permitted - additional users need to be added via the support site.

This user will be granted admin access to all accounts within the same portfolio.

given_name (string, optional)

Required for business accounts. Can’t be longer than 255 characters.

family_name (string, optional)

If not provided for Business accounts, Business will be used as a default value. Can’t be longer than 255 characters.

email (string, optional)

Customer’s email they’ll use for logging into the online portal. Can’t be longer than 254 characters.

mobile (string, optional)

Customer’s personal mobile number. Can’t be longer than 32 characters.

landline (string, optional)

Customer’s landline phone number. Can’t be longer than 32 characters.

date_of_birth (date, optional)

title (string, optional)

Preferred title by the customer. Can’t be longer than 20 characters.

salutation (string, optional)

Preferred salutation by the customer. Can’t be longer than 128 characters.

deceased (string, optional)

One of Reported or Confirmed.

address1 (string, optional)

Landlord address. Can’t be longer than 512 characters.

address2 (string, optional)

Landlord address. Can’t be longer than 512 characters.

address3 (string, optional)

Landlord address. Can’t be longer than 512 characters.

address4 (string, optional)

Landlord address. Can’t be longer than 512 characters.

address5 (string, optional)

Landlord address. Can’t be longer than 512 characters.

postcode (string, optional)

Valid UK postcode of the billing address.

effective_from (date, required)

The date at which this person starts being an administrator of the property (inclusive).

effective_to (date, optional)

The date at which this person stops being an administrator of the property (exclusive).

customer_at_supply_address_from_date (date, optional)

The date when the customer started being on supply at the given address.

customer_at_supply_address_to_date (date, optional)

The date when the customer stopped being on supply at the given address, e.g. when they moved out.

meter_points (array, required)

List of meter points linked to the property.

mpxn (string, required)

MPAN or MPRN of this meter point.

mpid (string, required)

The market participant ID for this meter point.

shipper_mpid (string, optional)

The shipper market participant ID for this meter point. This is a gas only field and an error will be thrown if this is provided for electricity meter points.

supply_start_date (date, required)

Supply start date for current supply with source MPID.

supply_end_date (date, optional)

Supply end date for current supply with source MPID.

dc_to_appoint (string, optional)

The data collector to appoint for the meter point. This value can only be set for electricity meter points and should only be provided for an on-market switch.

da_to_appoint (string, optional)

The data aggregator to appoint for the meter point. This value can only be set for electricity meter points and should only be provided for an on-market switch.

mop_to_appoint (string, optional)

The meter operator to appoint for the meter point. This value can only be set for electricity meter points and should only be provided for an on-market switch.

is_customer_appointed (boolean, optional)

Whether agents for this meter point are appointed by the customer. This value can only be set for electricity meter points and should only be provided for an on-market switch.

mam_to_appoint (string, optional)

The meter asset manager to appoint for the meter point. This value can only be set for gas meter points and should only be provided for an on-market switch.

measurement_class (string, optional)

The meter point’s measurement class. Only applicable to electricity meter points.

Can only be one of

  • “A” (Non half hourly metered)

  • “B” (Non half hourly unmetered)

  • “C” (Half hourly metered in 100kW premises)

  • “D” (Half hourly unmetered)

  • “E” (Half hourly metered in sub-100kW premises)

  • “F” (Half hourly metered in sub-100kW domestic premises)

  • “G” (Half hourly metered in sub-100kW non-domestic premises)

These codes are defined by the Elexon Market Domain Data (MDD): https://www.elexon.co.uk/glossary/measurement-classes/

export_type (string, optional)

If the meter point is an export meter point, this value indicates whether the meters belonging to it are only used for export or for import as well. If the meter point is not an export meter point, this value should not be provided. It is also only applicable to electricity meter points.

If the meter point contains export-only meters, its export type should be set to EXPORT_ONLY. For import/export meters, it should be set to IMPORT_EXPORT, and the import meters should be provided separately in the payload with the same serial number but belonging to a different meter point (and with no export type provided).

One of IMPORT_EXPORT or EXPORT_ONLY.

et_in_progress (bool, optional)

If an erroneous transfer is in progress, a validation error will be raised saying it should be sorted out before importing the account.

dr_in_progress (bool, optional)

If a disputed reading is in progress, a validation error will be raised saying it should be sorted out before importing the account.

is_deenergised (bool, optional)

If a meter point is de-energised. Defaults to False.

regular_reading_cycle (string, optional)

The regular reading cycle of meter point, as it should be passed to agents via flows. For electricity this can be one of A or or B or D or E or H or M or N or O or Q or S or T or W or Z.

For gas this can be one of CYYY or CYQS or CYSS or CYLM or CYSM or CYNM.

ldz (string, optional)

The Local Distribution Zone code for a gas meter point. This will be superseded by any data received from industry at a later date, but allows faster progress in the short term if provided. Can be one of: SC or LC or LO or LS or LT or LW or NO or NE or NW or WM or EM or EA or WN or WS or NT or SO or SE or SW

Cannot be specified for electricity meter points.

smart_refusal_interest (dict, optional)

type (string, required)

Whether the customer indicated interest or refusal towards a smart meter installation. One of NOT_INTERESTED or INTERESTED or NOT_AT_THE_MOMENT.

date (date, required)

Date the customer informed of interest or refusal of a smart meter install.

refusal_reason (string, optional)

Reason for why a customer refused to have a smart meter installed. One of DO_NOT_OWN_HOME or TECHNOLOGY_SCEPTICAL or WORRIED_SECURITY or WORRIED_HEALTH_SAFETY or NEGATIVE_PUBLICITY or WORRIED_ABOUT_USAGE_COST or ALREADY_HAS_SMART_METER or HOUSE_MOVE_IMMINENT or SWITCH_IMMINENT or MORE_INFORMATION_REQUIRED or IS_LANDLORD or CANNOT_SEE_BENEFIT or WAIT_UNTIL_IT_IS_COMPULSORY or VULNERABILITY or WORRIED_ABOUT_SMART_METERS or WORRIED_ABOUT_INSTALLATION or PROPERTY_NOT_OCCUPIED or CANNOT_ATTEND_APPOINTMENT

source (string, optional)

How the customer got in touch about their interest/refusal. One of WEBSITE or EMAIL or OTHER

ccl_exemptions (array, optional)

List of CCL exemptions for property. Must only be provided for business accounts.

rate (decimal, required)

The normalised proportion of energy use on the meter point that qualifies for CCL exemption. (eg 1.0 for 100% exemption).

effective_from (date, required)

Date this CCL exemption entry is valid from.

effective_to (date, optional)

Date this CCL exemption entry is valid to.

vat_exemptions (array, optional)

List of VAT exemptions for property. Must only be provided for business accounts.

rate (decimal, required)

The normalised proportion of energy use on the meter point that qualifies for VAT exemption. (eg 1.0 for 100% exemption).

effective_from (date, required)

Date this VAT exemption entry is valid from.

effective_to (date, optional)

Date this VAT exemption entry is valid to.

meters (array, optional)

List of active and exchanged meters on the meter point.

meter_serial_number (string, required)

Serial number of the meter. Can’t be longer than 32 characters.

installed_on (date, optional)

Meter installation date.

removed_on (date, optional)

Meter removal date, if this was an exchanged meter.

gas_number_of_digits (integer, optional)

Number of digits of the meter, if it’s a gas meter. Must be between 1 and 15.

units_of_measure (string, optional)

Units of measure for gas meters. Must be either SCMH (Standard Cubic Metres per Hour) or SCFH (Standard Cubic Feet per Hour, in hundreds).

Defaults to SCMH (cubic metres).

smart_type (str, optional)

The type of smart meter, or NONE if it is not a smart meter. Defaults to NONE. SMETS1 meters that have been through the E&A process should be marked as SMETS1_ENROLLED. One of NONE or SMETS1 or SMETS1_ENROLLED or SMETS2.

smart_device_id (str, optional)

Device ID of the smart meter (e.g. “01-23-45-67-89-AB-CD-EF”). Optional if the meter is a smart meter, and should not be provided otherwise.

smart_commissioned_on (date, optional)

Date on which the smart meter was commissioned. Optional if the meter is a smart meter, and should not be provided otherwise.

is_prepay (bool, optional)

Whether the meter is a prepay meter or not. Defaults to false.

prepay_customer_reference_number (string, optional)

Customer reference number for the prepay meter as required for communication with the meter provider. Required if the is_prepay flag is set to True for an electricity meter and migration involves no on-market switch. Max 20 characters.

last_billed_to_date (date, optional)

Date up to which consumption has been billed to for gas meter. This is optional but must appear if not present at the account level or if the meter is not on-supply.

For more info see last_billed_to_date documentation at the account level above.

registers (array, optional)

List of the current registers on the meter. Registers are only required on electricity meters.

register_id (string, required)

This should be the value as provided in MTDs, including leading zeros. Can’t be longer than 32 characters.

tpr (string, required)

Time Pattern Regime code for the register. Can’t be longer than 16 characters.

number_of_digits (integer, required)

Number of digits of the register. Must be between 1 and 15.

last_billed_to_date (date, optional)

Date up to which consumption has been billed to for electricity meter. This is optional but must appear if not present at the account level or if the meter is not on-supply..

For more info see last_billed_to_date documentation at the account level above.

is_settlement (boolean, optional)

Whether the register should be used for billing, and so whether it needs a transfer read, an EAC and “last billed to” date. Defaults to true.

transfer_readings (array, optional)

Only the last reading (or readings, if the meter is ECO7 or ECO10) the account has been billed up to.

If the account has never been billed, the SSD reading(s) must be on this list.

It’s expected that a transfer reading will be given per register on an active meter in the case of electricity and a reading per active gas meter.

It’s expected that all transfer reading dates will match the last_billed_to_date.

register_id (string, optional)

This should be the value as provided in MTDs, including leading zeros. This register id must make reference to an existing register under this meter. This field is required for electricity readings. Can’t be longer than 32 characters.

reading_date (date, required)

Date of the reading.

reading_type (string, required)

One of ESTIMATE or SMART or REGULAR or CUSTOMER.

reading_value (decimal, required)

Value of the reading.

reading_history (array, optional)

List of historical readings. Generally these are readings prior to the one(s) provided under transfer_readings. It is possible to provide readings in the reading_history after the transfer_reading date but these must unbilled.

register_id (string, optional)

This should be the value as provided in MTDs, including leading zeros. This register id must make reference to an existing register under this meter. This field is required for electricity readings. Can’t be longer than 32 characters.

reading_date (date, required)

Date of the reading.

reading_type (string, required)

One of ESTIMATE or SMART or REGULAR or CUSTOMER or ROUTINE.

reading_value (decimal, required)

Value of the reading.

billed (bool, required)

Whether the reading has been billed.

validation_status (string, optional)

One of VALIDATED or UNVALIDATED or FAILED. Defaults to VALIDATED.

prepay_details (dict, optional)

A record of details regarding financial information of the prepayment meter. Applicable only on prepay meters. Not applicable if the below values do not in anyway contribute to the last_statement_balance: This is because, in Kraken, the state of the meter’s ledgers is independent of the account balance, and can be ascertained from the first flows received.

debt_balance (decimal, required)

The meter’s debt balance, in pounds, as of the closing date of the last statement. Must be positive.

credit_balance (decimal, required)

The meter’s credit balance, in pounds, as of the closing date of the last statement.

transfer_vend_read_date (date, required)

The date that the transfer vend read was taken.

It’s expected that this date will be exactly one day earlier than the last_billed_to_date, due to billing occurring as of midnight the day after the final reading on a given bill.

gas_debt_repayment_options (dict, optional)

Debt repayment options that are used when sending SQO1 flows. Optional for gas meters, and not applicable for electricity meters.

weekly_min (decimal, optional)

The minimum amount, in pounds, that a customer needs to pay towards their debt each week. Must be positive. Defaults to "0.0".

weekly_max (decimal, optional)

The maximum amount, in pounds, that a customer needs to pay towards their debt each week. Must be positive. Defaults to "0.0".

eac_history (array, optional)

History of electricity Estimated Annual Consumption entries for this meter point. It’s expected to get an EAC entry per different TPR given in the meter point meter registers.

effective_from (date, required)

Start date of the EAC entry.

tpr (string, required)

Time Pattern Regime code for the EAC entry. Can’t be longer than 16 characters.

consumption (decimal, required)

Value in KWh.

source (string, optional)

Source of the EAC entry. This would ordinarily be from a flow file, in which case this should be the value of the field. In other cases this may have come from another source, in which case that can be entered here too.

aq_history (array, optional)

History of gas Annual Quantity entries for this meter point. It’s expected that at least one AQ entry will be provided for the current period if there’s an active gas meter. Gaps and overlapping on the given entry dates will raise validation errors.

effective_from (date, required)

Start date of the AQ entry.

effective_to (date, optional)

End date of the AQ entry. Leave empty for an open ended AQ entry.

consumption (decimal, required)

Value in KWh.

source (string, optional)

Source of the AQ entry. This would ordinarily be from a flow file, in which case this should be the value of the field. In other cases this may have come from another source, in which case that can be entered here too.

smart_site_visit (array, optional)

A record of site visit appointments on the meter point for installing a smart meter.

reference_number (str, required)

A reference number for the appointment.

date (date, required)

The date the appointment took place.

metering_agent (str, required)

The metering agent performing the appointment. One of OES or AES or SMS or PROVIDOR or EON_METERING or MDS or LOWRI_BECK or METERPLUS or ENTERPRISE_MANAGED or MIDS_ELEC or N_POWERGRID or ELEC_NW or NATIONAL_GRID or the four-character MPID of one of the above or the three-character Short Code of one of the above

status (str, required)

Status of the appointment. One of SUCCESSFUL or ABORTED or CANCELLED.

appointment_notes (str, optional)

Notes on the appointment.

additional_data (dict, optional)

Any additional data to be stored for the appointment, e.g. the asset condition code or additional recorded information on the outcome.

fit (dict, optional)

payment_method (string, required)

One of BACS or CHEQUE. Note that Kraken requires a DD instruction with the payment vendor for carrying out BACS repayments. Please check with the tech team whether CHEQUE is supported for FIT in you Kraken installation if you are considering using it.

vendor_name (string, optional)

Please contact the tech team for the names of the vendors available to you. Required if the payment_method is BACS.

instruction_reference (string, optional)

The reference of the mandate as known by the vendor. Can’t be longer than 512 characters. Required if the payment_method is BACS.

vat_number (string, optional)

Pass this for VAT-registered customers to whom we should pay VAT on export payments.

installations (array, required, min length 1)

Each installation in this list will be imported into Kraken from CFR and attached to the account described by the parent payload. All installations under a single generator in CFR must be in the same payload. The installations here _must_ be accessible by the supplier’s licensee in CFR.

fit_id (string, required)

CFR installation FIT ID.

address (dict, optional)

Use this to override the address we would import from CFR.

line1 (string, required) line2 (string, optional) town (string, optional) county (string, optional) postcode (string, required)

non_eligible_extensions (array, optional)

Use this to tell us that this installation has extensions that aren’t eligible for FIT payments.

reference_number (integer, required)

The number of the extension.

installed_capacity (decimal, optional)

The extension’s installed capacity in kWh.

credit_hold (dict, optional)

Use this to indicate that we should hold payments for this installation.

reason (string, required)

The reason why payments should be held for this installation. One of HAS_NOMINATED_RECIPIENT or INVOLVED_IN_COO or SWITCH_LOSS or LINKED_TO_WRONG_ACCOUNT or PAID_INCORRECTLY or MIGRATED_IN_DISPUTE or NEEDS_MANUAL_PAYMENT or OTHER.

notes (string, optional)

Free text shown in the Kraken UI that can be used to give additional information as to why payments should be held for this installation.

active_from (date, optional)

The date from which the payment hold should apply to this account. Defaults to the time the account is imported.

meters (array, required, min length 1)

Use this to give us information about each of the customer’s meters. Note this sits alongside the installations object because meters can be shared across installations and, although it’s rare, we need to accommodate for that.

type (string, required)

The meter type. Must be one of either GENERATION or EXPORT

mpan (string, optional)

The 13-digit MPAN core. Optional for export and generation meters.

serial_number (string, required)

The meter’s serial number.

make (string, optional)

The make of the meter.

model (string, optional)

The meter model.

extensions (array[string], required, min length 1)

The references of the extensions that this meter is attached to. E.g. [“FIT00123456-1”]. These IDs must match what is found in CFR as this is where we get the extension data from. This list of IDs looks up the existing extensions in Kraken to link to the meter.

transfer_reading (dict, required)

A transfer reading is required for all meters and represents the reading that Kraken will start paying the customer from.

reading_date (date, required)

The date the reading was taken from the meter.

reading_value (decimal, required)

The reading in kWh, with up to 2 decimals.

metadata (array, optional)

An array of key value pairs for storing generic metadata relating to an account.

key (string, required)

Key on which the metadata will be stored on

value (dict, required)

A json object containing any arbitrary piece of data to store in relation to the account.

If the payload is valid, a 200 OK response will be returned with the validated data as its body.

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors.

Sample response of a field being missing from the request:

{ "external_account_number": [ "external_account_number field is required" ] }

Example JSON request with invalid data

{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "EXTERNAL-1234", "unknown_occupier": false, "customers": [ { "given_name": "Homer", "family_name": "Simpson", "email": "homer@simpson.com", "mobile": "07123456789", "landline": "+442072343456", "date_of_birth": "1959-01-01", "title": "Mr", "salutation": "Hi", "psr": [ { "elec_industry_code": "02", "gas_industry_code": "02", "effective_from": "2000-01-01 00:00:00", "effective_to": "2019-11-20T00:00:00Z" }, { "elec_industry_code": "01", "gas_industry_code": "01", "effective_from": "2012-01-01" } ], "customer_preferences": { "opted_into_sms": true, "opted_into_recommended":true, "opted_into_updates": true, "opted_into_third_parties":true, "opted_into_offers": true, "is_user_psr_consent_obtained": true } }, { "given_name": "Marge", "family_name": "Simpson", "email": "marge@simpson.com", "mobile": "07123478956", "landline": "+442072343456", "date_of_birth": "1960-01-01", "title": "Mrs", "salutation": "Oh hai", "deceased": "Reported", "unable_to_read_meters": true }, { "given_name": "Lisa", "family_name": "Simpson", "email": "marge@simpson.com", "mobile": "07123478956", "landline": "+442072343456", "title": "Miss", "salutation": "Hello" }, { "given_name": "The", "family_name": "Occupier", "email": null, "mobile": null, "landline": null, "date_of_birth": null, "title": null, "salutation": null } ], "billing_name": "The Simpsons", "billing_address1": "11 Queen's Road", "billing_address2": "FLAT 1", "billing_address3": "", "billing_address4": "", "billing_address5": "", "billing_postcode": "NW4 2TH", "is_business": false, "sales_channel": "DIRECT", "sales_subchannel": "Disney", "supply_addresses": [ { "supply_address1": "11 Queen's Road", "supply_address2": "FLAT 1", "supply_address3": "", "supply_address4": "", "supply_address5": "", "supply_postcode": "NW4 2TH", "is_landlord": true, "property_administrators": [ { "given_name": "Mick", "family_name": "Jagger", "email": "mick.jager@rollingstones.com", "mobile": "07732546635", "landline": "+442076543210", "date_of_birth": "1955-02-23", "title": "Mr", "salutation": "Hi", "address1": "114A East Road", "address2": "Kirkwall", "address3": "Orkney", "address4": "", "address5": "", "postcode": "KW15 5LL", "effective_from": "2019-01-01", "effective_to": "2019-11-20" } ], "customer_at_supply_address_from_date": "2019-04-01", "meter_points": [ { "mpxn": "1013004420117", "mpid": "TENT", "supply_start_date": "2019-01-01", "supply_end_date": "2019-04-01", "measurement_class": "A", "meters": [ { "meter_serial_number": "12KD", "installed_on": "2001-01-01", "removed_on": "2014-01-01", "registers": [ {"register_id": "1", "tpr": "00040", "number_of_digits": 5}, {"register_id": "2", "tpr": "00206", "number_of_digits": 5} ] }, { "meter_serial_number": "AB1234", "installed_on": "2014-01-01", "removed_on": "2016-01-01" }, { "meter_serial_number": "Z16N389556", "registers": [ {"register_id": "1", "tpr": "00001", "number_of_digits": 5} ], "transfer_readings": [ { "register_id": "1", "reading_date": "2019-08-01", "reading_value": "1000.00", "reading_type": "CUSTOMER" } ], "reading_history": [ { "register_id": "1", "reading_date": "2019-06-20", "reading_value": "980.00", "reading_type": "CUSTOMER", "billed": true }, { "register_id": "1", "reading_date": "2019-05-20", "reading_value": "960.00", "reading_type": "ESTIMATE", "billed": true }, { "register_id": "1", "reading_date": "2019-04-20", "reading_value": "950.00", "reading_type": "ROUTINE", "billed": true } ] } ], "et_in_progress": false, "dr_in_progress": false, "eac_history": [ { "effective_from": "2019-10-01", "tpr": "00001", "consumption": "1500", "source": "D0019" }, { "effective_from": "2019-09-01", "tpr": "00001", "consumption": "1300", "source": "D0019" } ] }, { "mpxn": "3406086401", "mpid", "TEN", "supply_start_date": "2019-04-10", "supply_end_date": "2019-04-01", "meters": [ { "meter_serial_number": "E6S04460871456", "installed_on": "2015-01-01", "gas_number_of_digits": 4, "transfer_readings": [ { "reading_date": "2019-08-01", "reading_value": "500.00", "reading_type": "CUSTOMER" } ], "reading_history": [ { "reading_date": "2019-06-20", "reading_value": "480.00", "reading_type": "CUSTOMER", "billed": true }, { "reading_date": "2019-05-20", "reading_value": "460.00", "reading_type": "ESTIMATE", "billed": true }, { "reading_date": "2019-04-20", "reading_value": "450.00", "reading_type": "ROUTINE", "billed": true } ] }, { "meter_serial_number": "54BV-12828", "installed_on": "2002-01-01", "removed_on": "2015-01-01", "gas_number_of_digits": 4 } ], "et_in_progress": false, "dr_in_progress": false, "ldz": "NT", "aq_history": [ { "effective_from": "2019-01-01", "consumption": "8720" }, { "effective_from": "2018-01-01", "effective_to": "2018-12-31", "consumption": "8712" }, { "effective_from": "2017-01-01", "effective_to": "2017-12-31", "consumption": "8716" } ] }, { "mpxn": "2239644005", "mpid": "TEN", "supply_start_date": "2016-04-10", "supply_end_date": "2019-04-09", "meters": [ { "meter_serial_number": "54BV-12828-111", "installed_on": "2002-01-01", "gas_number_of_digits": 4 } ], "et_in_progress": false, "dr_in_progress": false, "smart_site_visit": [ { "reference_number": "123456789", "date": "2019-11-11", "metering_agent": "SMS", "status": "ABORTED", "appointment_notes": "Couldn't install the meter", "additional_data": { "asset_condition_code": "A01", "internal_outcome_code": "006" } } ] } ] } ], "contracts": [ { "mpxn": "1013004420117", "tariff_code": "E-1R-QC-1234-J", "effective_from": "2019-04-01", "effective_to": "2019-05-01" }, { "mpxn": "1013004420117", "tariff_code": "E-1R-QC-1234-J", "effective_from": "2019-06-01", "effective_to": "2019-12-01" }, { "mpxn": "1013004420117", "tariff_code": "E-1R-QC-5678-J", "effective_from": "2019-12-01", "effective_to": "9999-01-01" }, { "mpxn": "3406086401", "tariff_code": "G-1R-QC-1234-J", "effective_from": "2019-06-01" }, { "mpxn": "3406086401", "tariff_code": "G-1R-QC-1234-J", "effective_from": "2019-04-10", "effective_to": "2019-06-01" } ], "transfer_balance": "50.00", "current_statement_transactions": [ { "transaction_id": "1", "transaction_date": "2019-08-04", "amount": "10.00", "type": "REPAYMENT", "reason": "Customer refund", "payment_type": "CHEQUE" }, { "transaction_id": "2", "transaction_date": "2019-08-03", "amount": "20.00", "type": "PAYMENT", "reason": "Card payment", "payment_type": "DD_FINAL_COLLECTION" }, { "transaction_id": "3", "transaction_date": "2019-08-02", "amount": "20.00", "type": "CREDIT", "reason": "IMPORTED_CREDIT" } ], "historical_statement_transactions": [ { "transaction_id": "4", "transaction_date": "2019-06-01", "amount": "10.00", "type": "PAYMENT", "reason": "Card payment", "payment_type": "CREDIT_CARD" }, { "transaction_id": "5", "transaction_date": "2019-07-01", "amount": "10.00", "type": "PAYMENT", "reason": "Card payment", "payment_type": "DEBIT_CARD" } ], "payment_schedules": [ { "amount": "6.00", "day_of_month": 10, "frequency": "MONTHLY", "means": "DD", "start_date": "2018-01-01", }, { "amount": "60.00", "day_of_month": 2, "frequency": "MONTHLY", "means": "DD", "start_date": "2018-01-01", } ], "payment_instructions": [ { "vendor": "GOCARDLESS", "reference": "SUPPLIER-142755174", "type": "DIRECT_DEBIT", "valid_from": "2022-06-15", "customer_reference": "CU-431432213" } ], "contribution_agreements": [ { "scheme": "RFDS", "active_period_start_date": "2023-07-01", "active_period_end_date": "2023-10-03", "interval": "MONTHLY", "amount": "10.00", "periods": [ { "start_date": "2023-07-01", "end_date": "2023-10-03", "fulfilled_at": "2023-10-041T16:48:46+10:00", }, ], }, { "scheme": "RFDS", "active_period_start_date": "2023-10-04", "active_period_end_date": null, "interval": "MONTHLY", "amount": "2.50", }, ], "deposit_agreements": [ { "deposit_amount": "500.0000000000", "reason": "Security deposit", "created_at": "2023-10-15T00:00:00+10:00", "accepted_at": "2023-10-16T00:00:00+10:00", "fulfilled_at": "2023-10-17T00:00:00+10:00", "last_interest_date": "2023-10-31" } ], "notes": [ { "created_at": "2018-10-10T10:20:00Z", "body": "This is a note", "document_paths": [ { "document_path": "/notes/1234/attachment.jpg" } ] } ], "statements": [ { "bill_period_from_date": "2019-06-01", "bill_period_to_date": "2019-07-01", "statement_path": "EXTERNAL-1234/2019-06-01-to-2019-07-01.pdf", "statement_id": "1" }, { "bill_period_from_date": "2019-07-01", "bill_period_to_date": "2019-08-01", "statement_path": "EXTERNAL-1234/2019-07-01-to-2019-08-01.pdf", "statement_id": "2" } ], "last_statement_balance": "30.00", "last_billed_to_date": "2020-08-01", "last_statement_issue_date": "2019-08-01", "last_payment_review_date": "2019-06-01", "next_bill_due_date": "2019-11-20", "smart_read_frequency": "DENIED" }


And the example response:

{ "non_field_errors": [ "Given transfer balance: 50.00; After adding charges and payments (30.00) to the last statement balance (30.00), the expected transfer balance was: 60.00.", "Account must have at least one billable meter point.", "The final balance of all historical statement transactions, 20.00, must match the last statement balance, 30.00.", "All current statement transactions must have a date on or after 2020-08-01.", "All transfer reading dates must match the last_billed_to_date, 2020-08-01", "All meter points with a contract should be billable." ] }

Non field errors can be presented in the JSON either on the top level, or within certain fields.

Top level validation errors are:

  • Given transfer balance: {transfer_balance}; After adding charges and payments ({transactions_value}) to the last statement balance ({last_statement_balance}), the expected transfer balance was: {expected_transfer_balance}.

  • A given name is required for each customer

  • Account must have at least one billable meter point.

  • last_billed_to_date is required.

  • Last billed to date not given on either the account or the gas meter for meterpoint {mpxn}. Last billed to date can be either at the account level or must appear on all active gas meters.

  • Last billed to date not given on either the account or the electricity register for meterpoint {mpxn}. Last billed to date can be either at the account level or must appear on all active electricity registers.

  • Last billed to date for an electricity meter point provided on the meter for meter point {mpxn}. Electricity meter points must have their last_billed_to_date provided on the register or at the top level account.

  • There cannot be a current statement transaction that happened before {last_billed_to_date}

  • There cannot be a historical transaction on the same day or after a current transaction

  • All historical transactions must have a date on or before {last_statement_closing_date} (or {last_billed_to_date} if not provided)

  • The final balance of all historical statement transactions, {initial_balance}, must match the last statement balance, {last_statement_balance}.

  • All current statement transactions must have a date on or after {last_billed_to_date}

  • Prepay meters {to_prepay_meter_serial_numbers} must have initialisation prepayment details in order to also be sent transactions.

  • All transfer reading dates must match the last_billed_to_date, {last_billed_to_date}

  • The transfer vend read date must precede the last_billed_to_date, {last_billed_to_date}, by one day.

  • The billed reading taken on {reading_date} is after the last_billed_to_date, {last_billed_to_date}.

  • All supply meter points must be covered by a contract

  • All meter points with a contract should be billable.

  • Meter point {mpxn} is billable but has no active meters.

  • Contract dates on the account don’t match up (there are gaps or overlaps)

  • Contract for {mpxn} starts before SSD {supply_start_date}.

  • There are multiple open ended payment schedules.

  • There are date overlaps in the payment schedules around the dates {start_date} and {expected_start_date}.

  • Cannot have multiple payment schedules starting on the same date - {start_date}

  • There is a gap in the payment schedules between the dates {predecessor_end_date} and {start_date}.

  • statement_id is required.

  • There cannot be any customers if the unknown_occupier flag is True.

  • A transfer reading is required for active gas meters.

  • There should be exactly one transfer reading per register.

  • Meter {meter_serial_number} fully billed by a transfer reading on or after its removal. The transfer reading for this case should be the first reading on replacement meter, if there is one; else no transfer reading should be provided.

  • Couldn’t find an AQ entry currently valid

  • Couldn’t find an EAC entry for the TPRs {tprs}

  • Please, resolve the open complaint in progress before proceeding with the import of this account.

  • No supplier found with code {import_supplier_code}

  • A last_billed_to_date or last_statement_issue_date must be provided if a last_statement_balance is given.

  • For debt collection proceedings, both agency name and start date must be provided.

  • If a debt collection proceeding start date is given, the agency_name must also be given.

  • {tariff} is an {‘import’|’export’} tariff but {mpxn} is an {‘export’|’import’} meter point.

  • Meter point {mpxn} has profile class {profile_class} and should therefore be on an Economy 7 tariff.

  • Meter point {mpxn} has profile class {profile_class} and SSC {ssc} and should therefore be on a standard tariff.

  • Meter point {mpxn} has profile class {profile_class}, SSC {ssc}, and a register with TPR {tpr}, and should therefore be on a {tariff_type} tariff.

  • A contract covering the last billed to date must exist for meter point {mpxn}.

  • A reason should only be given when the smart interest refusal type is one of NOT_INTERESTED or NOT_AT_THE_MOMENT

  • The fields business_type or company_number should only be provided for business accounts

  • Bespoke tariff rates can only be provided for business accounts.

  • Agents supplied when not performing on-market switch on meter point {mpxn}.

  • No campaign found for {campaign_name}

  • {path_name} is not a supported dunning path.

  • CCL/VAT rates should not be provided for domestic accounts.

  • Active prepay meters require an active prepay contract.

  • An occupier account should only have a single supply address.

  • An account must not have duplicate supply addresses.

  • billing_address1 and billing_postcode must be provided for all but occupier accounts.

  • Twin fuel accounts should only have a single supply address.

  • There are existing customers on different portfolios.

  • Existing portfolio has a different brand.

  • Metadata cannot have duplicate keys.

  • The account cannot be in the process of switching away.

  • Expected an import and export meter point for meter {meter_serial_number}.

  • Corresponding import meter not found for export meter {meter_serial_number}.

  • Duplicate meters with the serial number {meter_serial_number} were provided under different meter points. This is only allowed in the case of an import/export meter with export_type set appropriately.

  • The meter point with MPXN {mpxn} is duplicated under different supply addresses.

In other cases, non field errors would be returned nested under certain field. For example, the “meter_points” section would be shown as:

{ "supply_addresses": { "0": { "meter_points": { "0": { "non_field_errors": [ "Couldn't find an EAC entry for the TPRs {'00001'}" ] } } } } }

“meter_points” validation errors are:

  • Please, resolve the Erroneous Transfer in progress before proceeding with the import of this account.

  • Please, resolve the Disputed Read in progress before proceeding with the import of this account.

  • Invalid LDZ: {ldz}

  • ldz is only expected for gas meter points

  • aq_history is only expected for gas meter points

  • There is more than one register with the same register id on the meter {serial_number}.

  • A register id must be provided for the reading {reading}.

  • The register id {reading_register_id} for a given transfer reading is not on the list of given register ids for the meter {serial_number}.

  • A register id must be provided for the reading with value {reading_value}.

  • There shouldn’t be repeated EAC entries for a TPR with the same effective_from.

  • A register id must be provided for the reading {reading}.

  • There are multiple open ended AQ entries in the meter point {mprn} aq_history.

  • There are gaps or overlaps in the meter point {mprn} aq_history.

  • gas_number_of_digits is required for gas meters

  • eac_history is only expected for electricity meter points

  • Couldn’t find an AQ entry currently valid

  • No market participant found with code {value}

  • A customer reference number must be provided for an active electricity prepay meter

  • Active electricity meter {serial_number} must have at least one register.

  • All registers for non-half hourly electricity meter {serial_number} must have a register id.

  • All registers for non-half hourly electricity meter {serial_number} must have a TPR.

  • Meter point {mpxn} has active meters but not transfer readings

  • DC or DA to appoint can only be provided for electricity meter points.

  • MAM to appoint can only be provided for gas meter points.

  • Gas option for regular_reading_cycle provided for electricity meter point.

  • Electricity option for regular_reading_cycle provided for gas meter point.

  • Off supply meter points must have a reading for supply end date.

  • Meter points must have supply start date in the past.

  • Unknown meter point measurement class.

  • Gas shipper MPID not allowed for electricity meter point {mpxn}.

  • Duplicate meter points with the MPXN {mpxn} were provided.

  • Multiple meters with serial number {serial_number} were provided. This is only valid if they are all part of a series of dummy meter exchanges.

“meters” validation errors are:

  • Smart meter details should only be provided if the meter is a smart meter.

  • prepay_details: {meter_serial_number} is not a prepay meter.

  • prepay_customer_reference_number: {meter_serial_number} is not a prepay meter.

“prepay_details” validation errors are: * Gas debt repayment options should only be provided if the meter is a gas meter.

“registers” validation errors are:

  • A time pattern regime with id {value} has not been found

“contracts” validation errors are:

  • No {fuel_name} tariff found for the tariff code {tariff_code}

  • Contract effective_to date {effective_to} cannot be earlier than contract effective_from date {effective_from}

  • A bespoke tariff rate for a gas meter needs to have a unit rate provided

  • Registers should not be provided for a bespoke tariff for a gas meter

  • A bespoke tariff rate for an electricity meter needs to have registers provided

  • Unit rates for bespoke tariffs on electricity meters need to be provided in the registers array

  • A bespoke half-hourly tariff can only be given on electricity tariffs.

  • If multiple bespoke half-hourly rates are provided, all must have start times.

  • One of register_id and rate_type must be provided for bespoke electricity

  • Duplicate bespoke rates received for {mpxn}

  • Contract for variable product cannot start before product is available.

“commission_contracts” validation errors are: * Affiliate organisation with name {name} does not exist

“customer_preferences” validation errors are:

  • An answer must be provided for the given question

“customer” validation errors are:

  • This email address looks like a test email address - if this is a spaceholder email, please remove it.

  • Cannot have contact details with an account identified as The Occupier.

  • Metadata cannot have duplicate keys.

“aq_history” validation errors are:

  • {effective_from} can’t be later than {effective_to}

“payment_schedules” validation errors are:

  • {start_date} can’t be later than {end_date}

  • Fixed schedule cannot have an amount of 0.0

  • Debt repayment end date of {debt_repayment_end_date} must be before schedule end date.

“debt” validation errors are:

  • Storage of CAIS reference not supported at this time. (This needs to be enabled, please contact Kraken.)

  • CAIS reference already saved on another account.

  • Debt collection agency {debt_collection_agency_name} is not supported.

  • If a debt collection proceeding start date is given, the agency_name must also be given.

“psr” validation errors are:

  • No electricity PSR record found with code {value}

  • No gas PSR record found with code {value}

  • No PSR record found with description {value}

“smart_site_visit” validation errors are:

  • One of date and site_visit_date must be provided

  • Site visit must have an associated metering_agent from the documented list, or their MPID (as a MOP) or short code (as a MAM).

“supply_addresses” validation errors are:

  • If customer_at_supply_address_to_date is provided, a from date must also be given

“ccl_exemptions” and “vat_exemptions” validation errors are:

  • Effective to date of {effective_to} must be after the effective from date of {effective_from} for VAT and CCL exemptions.

  • {tax_type} exemptions should only be provided for business accounts.

  • Multiple open ended {tax_type} exemptions provided for meter point.

  • Date overlaps in the {tax_type} exemptions provided for meter point.

“transactions” validation errors are:

  • The payment_type {payment_type} is not a valid type for a Payment.

  • The payment_type {payment_type} is not a valid type for a Repayment.

  • Transactions of type {transaction_type} should not have negative values. (NOTE: This would be for payment or repayment transaction types)

  • Historical statement transactions provided with no last_statement_issue_date

  • Transaction date of {transaction_date} cannot be in the future.

“warm_home_discount” validation errors are:

  • Incorrect format for tax_year. Must be YYYY/YY.

“references” validation errors are:

  • Not a valid namespace

“notes” validation errors are:

  • At least a note body or document path should be given

“dunning_path” validation errors are:

  • start date of {start_date} cannot not be earlier than today.

List imported meterpoint statuses by external account number

Use this end-point to list all meterpoint statuses by import supplier code and external account number.

Request:

GET /v1/data-import/meterpoint-statuses-for-account/<import-supplier-code>/<external_account_number> GET /v1/data-import/meterpoint-statuses-for-account/TENTACLE_ENERGY/7654321/

If an account import process, account application or meterpoints cannot be found for the given import supplier code and external account number, a 404 Not Found response will be returned. If the supplied MPxN is invalid a 400 Bad Request response will be returned.

If the request is valid, a 200 OK response will be returned with a list of MPxNs and their Kraken status.

[ {"mpxn":"9349409806","status":"PRE_REGISTRATION"} ]

Send registration flows

Use this end-point to submit registration flows for meter points on an existing Kraken account.

Request:

POST /v1/data-import/send-registration-flows/<import-supplier-code>/<external-account-number>/ POST /v1/data-import/send-registration-flows/TENTACLE_ENERGY/1234/

If an account import process or an account cannot be found, or if there are no meter points for which to submit registration flows, a 404 Not Found response will be returned like so:

{ "error_detail": "Account import process not found for 1234", "import_supplier_code": "TENTACLE_ENERGY", "external_account_number": "1234" }

Possible error_detail’s returned for a 404 response are as follows:

  • Account import process not found for {external_account_number}

  • Account not found for {external_account_number}.

  • No meter points found for register for {external_account_number}.

If the request is successful, a 200 OK response will be returned with an array of objects detailing the status of each of the meter points marked for enrolment. If a meter point was successfully marked for enrolment then a REGISTRATION_FLOW_SUCCESS status will be returned along with the MPAN or MPRN (mpxn). If there was en error in marking the meter point for enrolment then a REGISTRATION_FLOW_ERROR status will be returned along with the MPAN or MPRN and an additional error_detail field with more information on the reason for failure.

{ "import_supplier_code": "TENTACLE_ENERGY", "external_account_number": "1234", "meter_points": [ { "mpxn": "1013004420117", "status": "REGISTRATION_FLOW_SUCCESS" }, { "mpxn": "3406086401", "error_detail": "TEN not current supplier", "status": "REGISTRATION_FLOW_ERROR" } ] }

Possible validation errors are:

  • Meter point {mpxn} is already on supply.

  • Meter point should have the PRE_REGISTRATION status, but instead has {meter_point_status}.

  • Meter point {mpxn} is marked to not send registration flows.

  • Meter point {mpxn} has already had registration flows sent.

  • No MPID found for meterpoint {mpxn}. MPID must be either supplied as part of the meter point data, or exist on the import supplier.

  • Rate limit reached for sending registration flows since 5pm.

  • {mpid} not current supplier.

Products

Validating product data

Use this end-point to validate a JSON payload of product and tariff information.

Request:

POST /v1/data-import/validate-products/

Sample payload:

{ "brand": "TENTACLE_ENERGY", "code": "SUPER-PROD-V1", "full_name": "Super product - v1", "display_name": "Super product", "description": "This product is super", "available_from_date": "2019-03-26", "available_to_date": "2019-06-01", "is_hidden": false, "is_variable": true, "is_prepay": false, "is_green": true, "is_business": false, "is_default": false, "client_params": { "some_param": "some_value" }, "tag_codes": ["some.tag", "some.other_tag"], "tariffs": [ { "fuel": "ELECTRICITY", "gsp": "_A", "tariff_code": "E-1R-SUPER-PROD-V1-A", "payment_method": "DD", "tariff_type": "STANDARD", "unit_rates": [ { "value": "1000", "valid_from_date": "2019-03-26", "rate_type": "STANDARD" } ], "standing_charges": [ { "value": "500", "valid_from_date": "2019-03-26" } ] }, { "fuel": "ELECTRICITY", "gsp": "_B", "tariff_code": "E-2R-SUPER-PROD-V1-B", "payment_method": "DD", "tariff_type": "ECONOMY7", "unit_rates": [ { "value": "1000", "valid_from_date": "2019-03-26", "rate_type": "ECO7_DAY" }, { "value": "500", "valid_from_date": "2019-03-26", "rate_type": "ECO7_NIGHT" } ], "standing_charges": [ { "value": "500", "valid_from_date": "2019-03-26" } ] }, , { "fuel": "ELECTRICITY", "gsp": "_B", "tariff_code": "E-FLAT2R-SUPER-PROD-V1-B", "payment_method": "DD", "tariff_type": "FLAT_ECONOMY7", "unit_rates": [ { "value": "1000", "valid_from_date": "2019-03-26", "rate_type": "ECO7_DAY" }, { "value": "1000", "valid_from_date": "2019-03-26", "rate_type": "ECO7_NIGHT" } ], "standing_charges": [ { "value": "500", "valid_from_date": "2019-03-26" } ] }, { "fuel": "GAS", "gsp": "_C", "tariff_code": "G-1R-SUPER-PROD-V1-B", "payment_method": "DD", "unit_rates": [ { "value": "1000", "valid_from_date": "2019-03-26", }, ], "standing_charges": [ { "value": "500", "valid_from_date": "2019-03-26" } ] }, ] }

The request payload is either a single product object as shown above or a list of product objects. The product object has the following fields:

brand (string, required)

The brand code this product belongs to.

code (string, required)

A unique code for the product.

full_name (string, required)

A unique name for the product.

display_name (string, required)

A customer-friendly name for the product.

description (string, optional)

A description of the product.

available_from_date (date, required)

Date product was available from for new registrations (inclusive).

available_to_date (date, optional)

Date product was available up to for new registrations (exclusive). Omit if the product is still available.

term (integer, optional)

For many months agreements on this product should last for. For fixed-term products only.

end_date (date, optional)

The date when agreements on this product end.

is_hidden (bool, optional)

Whether the product is shown in direct registration. Default: false.

is_variable (bool, optional)

Whether the product has variable charges. Default: false.

is_prepay (bool, optional)

Whether the product is for prepay meter-points. Default: false.

is_green (bool, optional)

Whether the product is a “green” product. Default: false.

is_business (bool, optional)

Whether the product is for business accounts. Default: false.

is_default (bool, optional)

Whether the product is a default (rollover) product. Default: false.

is_occupier (bool, optional)

Whether the product is restricted to Occupier accounts. Default: false.

is_charged_half_hourly (bool, optional)

Whether the product is charged half hourly. Default: false.

availability_status (string, optional)

One of PUBLIC or RESTRICTED. “Public” products will be available to any customer, whereas “Restricted” products will only be available to be selected through Kraken.

client_params (object, optional)

Additional fields that are relevant only to specific clients. Only use this field if agreed in advance.

tag_codes (array, optional)

An array of strings that are used to tag products. Tags need to be set up in Kraken before they can be used. Only use this field if agreed in advance.

tariffs (array, required)

Each object in the list should have these fields:

fuel (string, required)

One of ELECTRICITY or GAS.

gsp (string, required)

The GSP group ID that this tariff applies to (eg “_A”).

tariff_code (string, required)

A unique code for the tariff. It normally makes sense for this to be an extension of the parent product code.

payment_method (string, required)
One of

DD (monthly Direct Debit) or QC (quarterly Direct Debit) or PP (prepayment) or POROB (non-DD). or VAR (varying).

tariff_type (string, optional)

Required for electricity tariffs where it has to be one of STANDARD, ECONOMY7, FLAT_ECONOMY7, THREE_RATE or FLAT_THREE_RATE.

unit_rates (array, required)

An array of objects with these fields:

value (decimal, required)

The value in pence of the charge (excluding VAT).

valid_from_date (date, required)

The date from which this charge applied (inclusive).

valid_to_date (date, optional)

The date up to which this charge applied (exclusive). Omit if the charge is still in effect.

rate_type (string, optional)

Required for electricity tariffs where it has to be one of STANDARD, ECO7_DAY, ECO7_NIGHT or OFF_PEAK.

payment_method (string, optional)

Required for tariffs with a payment method of VAR (Varying). One of DD (Direct debit) or NDD (Non-direct debit) or PP (Prepayment).

standing_charges (array, required)

An array of objects with these fields:

value (decimal, required)

The value in pence of the charge (excluding VAT).

valid_from_date (date, required)

The date from which this charge applied (inclusive).

valid_to_date (date, optional)

The date up to which this charge applied (exclusive). Omit if the charge is still in effect.

payment_method (string, optional)

Required for tariffs with a payment method of VAR (Varying). One of DD (Direct debit) or NDD (Non-direct debit) or PP (Prepayment).

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors.

If the payload is valid, a 200 OK response will be returned with the validated data as its body.

Possible validation errors are:

  • A product with code {product_code} already exists

  • A product with full_name ‘{full_name}’ already exists

  • Available from date must be before available to date.

  • Fixed products must have either an end date or a term.

  • Product contains multiple electricity tariffs with tariff type {tariff_type} and gsp {gsp_group_id}.

  • Product contains multiple gas tariffs with gsp {gsp_group_id}.

  • Product contains multiple tariffs with code {tariff_code}.

  • This product would conflict with the existing product {conflicting_product_code}. Only one default variable product is allowed for {account_type} accounts.

“tariff” level validation errors are:

  • A tariff with code {tariff_code} already exists.

  • Flat unit rates for the same time period must match.

  • Standing charges validity periods are not continuous.

  • Stepped TOU unit rates must have start and end times.

  • Unit rate type and tariff type must match.

  • Unit rates for electricity tariffs must specify a rate type.

  • Unit rates on non-varying payment method tariffs should not have a payment method provided.

  • Unit rates on varying payment method tariffs must have a payment method provided.

  • Unit rates validity periods are not continuous.

Creating a product

Use this end-point to create new energy products.

Request:

POST /v1/data-import/products/

The expected payload is the same as a single product from the validate product end-point.

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors.

If the payload is valid, a 201 Created response will be returned with the newly created product code, eg:

{ "code": "SUPER-PROD-V1" }

Import processes for accounts

An import process is how we collect data for an account and then create an account within Kraken from that data.

Create or update an account import process

Use this endpoint to create or update an account import process. An account import process is an entity that can later be processed and transformed into a Kraken account. An account import process can be uniquely identified by the import_supplier_code and external_account_number passed in the payload.

Request:

POST /v1/data-import/account-import-process/create-or-update/

The expected payload is the same as a single account from the validate account end-point.

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors, the same as the validate account end-point.

If the payload is valid and an account import process does not already exist then a 201 Created response will be returned with the newly created account import process external_account_number and import_supplier_code.

If the payload is valid and an account import process does already exist then a 200 OK response will be returned with the updated account import process external_account_number and import_supplier_code.

The response payload looks like:

{ "import_supplier_code": "TENTACLE_ENERGY", "external_account_number": "1234", }

Retrieving account import process data

Use this end-point to get the data of an existing account import process.

Request:

GET /v1/data-import/account-import-process/<import-supplier-code>/<external-account-number>/ GET /v1/data-import/account-import-process/TENTACLE_ENERGY/1234/

If an account import process cannot be found for the given import supplier code and external account number, a 404 Not Found response will be returned.

If the account import process exists, a 200 OK response will be returned with the account import process data as its body.

Retrieve status of imported account

Use this end-point to get the status and Kraken account number (if it exists) for a given migrated account.

Request:

GET /v1/data-import/account-transfer-status/<import-supplier-code>/<external-account-number>/ GET /v1/data-import/account-transfer-status/TENTACLE_ENERGY/1234/

If an account import process cannot be found for the given import supplier code and external account number, a 404 Not Found response will be returned.

If the account import process exists, a 200 OK response will be returned with the Kraken account number, if applicable. The response has the following format

{ "status": "COMPLETED", "kraken_account_number": "A-12AB34CD" }

If the import process is configured to return user data for created users, the 200 response will be returned with the account user emails and ids for any of the active users assigned to the account.

{ "status": "COMPLETED", "kraken_account_number": "A-12AB34CD", "account_users": [ { "user_id": 56815, "email": "56815@example.com" } ] }

for more detail on the possible values of status see Account transfer statuses.

List all existing account import processes

Use this end-point to list all existing account import process external account numbers.

Request:

GET /v1/data-import/all-account-import-processes/<import-supplier-code>/ GET /v1/data-import/all-account-import-processes/TENTACLE_ENERGY/

If any account import processes are found for the given import supplier code, a 200 OK response will be returned with a list of the existing import process external account numbers, Kraken account numbers and account created at datetimes (the latter two will be null if the import process has not been imported yet).

[ { "external_account_number": "1234", "kraken_account_number": null, "account_created_at": null }, { "external_account_number": "5678", "kraken_account_number": "A-56785678", "account_created_at": "2020-01-01T12:00:00Z" } ]

List all pending account import processes

Use this end-point to list all account import process external account numbers that are pending import.

Request:

GET /v1/data-import/pending-account-import-processes/<import-supplier-code>/ GET /v1/data-import/pending-account-import-processes/TENTACLE_ENERGY/

If any pending account import processes are found for the given import supplier code, a 200 OK response will be returned with a list of the existing import process external account numbers. For consistency with the other APIs, the Kraken number and account created at fields are also returned but will always be null.

[ { "external_account_number": "1234", "kraken_account_number": null, "account_created_at": null, } ]

List all imported account import processes

Use this end-point to list all account import process external account numbers that have been imported and now have Kraken accounts.

Request:

GET /v1/data-import/imported-account-import-processes/<import-supplier-code>/ GET /v1/data-import/imported-account-import-processes/TENTACLE_ENERGY/

If any imported account import processes are found for the given import supplier code, a 200 OK response will be returned with a list of the existing import process external account numbers, Kraken account numbers and account created at datetimes.

[ { "external_account_number": "5678", "kraken_account_number": "A-56785678", "account_created_at": "2020-01-01T12:00:00Z" } ]

Creating an account from an account import process

Use this end-point to create a new account from an existing account import process.

Request:

POST /v1/data-import/account-import-process/process/

Sample payload:

{ "external_account_number": "1234", "import_supplier_code": "TENTACLE_ENERGY", "operations_team_name": "A" }

The expected payload contains the primary key of an account import process, which is composed by an external account number and an import supplier code, and the operations team name where the account portfolio is meant to be created. In order for this to work, an import process with the given external_account_number and import supplier and an operations team with the given name must exist.

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors. In the case of an account having already been imported, two additional fields will be present in the response detailing the external_account_number and kraken_account_number:

{ "non_field_errors": [ "The account import process with the account number EXTERNAL-1234 has already been imported." ], "external_account_number": "EXTERNAL-1234", "kraken_account_number": "A-E8981832" }

If the import process is configured to return user data for created users, the 400 response will be returned with the account user emails and ids for any of the active users assigned to the account.

{ "non_field_errors": [ "The account import process with the account number EXTERNAL-1234 has already been imported." ], "external_account_number": "EXTERNAL-1234", "kraken_account_number": "A-E8981832", "account_users": [ { "user_id": 56855, "email": "56855@example.com" } ] }

If the payload is valid, a 201 Created response will be returned with the newly created account number.

{ "kraken_account_number": "A-E8981832" }

If the import process is configured to return user data for created users, the response will be returned with the account user emails and ids for any of the active users assigned to the account.

{ "kraken_account_number": "A-E8981832", "account_users": [ { "user_id": 27, "email": "test@example.com" }, { "user_id": 28, "email": "test_2@example.com" } ] }

Post-import actions

Importing account notes

Use this end-point to add notes to an account.

Request:

POST /v1/data-import/notes/create/

Sample payload:

{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "7654321", "notes": [ { "created_at": "2020-01-01T12:00:00Z", "body": "Something very important to import.", "document_paths": [ { "document_path": "path/to/s3/document1.pdf" } ] "is_pinned": true }, { "created_at": "2020-01-01T12:00:00Z", "body": "Something very important to import.", "document_paths": [ { "document_path": "path/to/s3/document2.pdf" }, { "document_path": "path/to/s3/document3.pdf" }, { "document_path": "path/to/s3/document4.pdf" } ], "is_pinned": true } ] }

The expected payload contains the primary key of an account import process, which is composed of an external account number and an import supplier code, and a list of objects containing the note information. A note must contain at least one of a body or document_paths and an optional created_at datetime. The document_paths refer to the locations in S3 where attached documents are stored, for example documents/note_attachments/attachment.pdf. The notes bucket is stored as a Kraken setting meaning that the full path would resolve to s3://notes_bucket/documents/note_attachments/attachment.pdf. If a created_at datetime is not provided, this will default to the current localtime. An optional is_pinned boolean can be passed in the payload to denote whether this note will be pinned to the top of the Kraken account support site page.

Note that document_path (singular) is being deprecated, please use document_paths (plural) which is a list of document_path elements.

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors. If an account import process or account is not found then a 404 Not Found response will be returned.

If the payload is valid, a 201 Created response will be returned containing a list of the posted notes and their creation status. A new note will only be created if a note on the account with the same body (and created_at if provided) does not already exist.

[ { "created_at": "2020-01-01T12:00:00Z", "body": "Something very important to import." "document_paths": [ { "document_path": "path/to/s3/document.pdf" } ] "status": "NOTE_CREATION_SUCCESS" }, { "created_at": "2020-02-01T12:00:00Z", "body": "Something else very important to import." "document_paths": [ { "document_path": "path/to/s3/document.pdf" } ] "status": "NOTE_ALREADY_EXISTS" } ]

Possible validation errors are:

  • At least a note body or document path should be given

Importing historic emails

Use this end-point to import historic emails to an account.

Request:

POST /v1/data-import/historic-emails/create/

Sample payload:

{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "7654321", "emails": [ { "from_address": "Bob@email.com", "subject": "Hello", "html_body": "<p>I am an outbound email sent to the customer in the old system.</p>", "vendor_id": "efdr345455398", "occurred_at": "2023-05-24T15:45:30.0+0000", "is_inbound": true, "attachments": [ { "filename": "abc.pdf", "s3_bucket": "staging-message-attachments", "s3_key": "unique/s3/key/for/abc.pdf" } ] }, { "from_address": "hello@not-octopus.com", "to_addresses": ["Bob@email.com", "Alice@email.com"], "subject": "Re: Issue", "text_body": "I am an outbound email sent to the customer in the old system.", "vendor_id": "efq58345534324", "occurred_at": "2023-05-24T15:45:30.0+0000", "is_inbound": false } ], "notes": [ { "content": "This is a note about the conversation, or the account.", "occurred_at": "2023-05-24T15:45:30.0+0000", } ], "is_open": true }

The payload expects the following components:

import_supplier (string, required)

Code of the import supplier that was used to import the account into Kraken.

external_account_number (string, required)

The account number of the account in the old system which was provided during the account’s initial import.

emails (array, required)

to_addresses (array, optional)

A list of recipient email addresses. This field is required if is_inbound is set to false.

cc_addresses (array, optional)

from_address (string, required)

The email address the email was sent from.

subject (string, optional)

text_body (string, optional)

At least one of text_body and html_body has to be provided.

html_body (string, optional)

At least one of text_body and html_body has to be provided. html_body should only be provided if it is not possible to provide the text_body and the html has been sanitised. HTML that contains scripts will be blocked due to security concerns.

vendor_id (string, required)

The unique reference of the email in the source system.

in_reply_to (string, optional)

The ‘vendor_id’ of the email that this email is in direct response to.

references (array, optional)

The vendor_id’s of all messages that are linked to the given email.

occurred_at (datetime, required)

The date time with timezone the email was received or sent at (format: %Y-%m-%dT%H:%M:%S.%f%z).

is_inbound (boolean, required)

The direction of the email. Set to true if the email was sent by the customer, false if sent to the customer.

attachments (array, optional)

The attachments that the email was sent with.

filename (string, required)

The filename of the attachment.

s3_bucket (string, required)

The staging s3 bucket that contains the attachment that Kraken has access to.

s3_key (string, required)

The s3 key for the attachment file. This must be unique and a validation error will be raised if an attachment has already been imported with the same s3 key.

notes (array, optional)

content (string, required)

The text content of the note.

occurred_at (datetime, required)

The date time with timezone the note was created at (format: %Y-%m-%dT%H:%M:%S.%f%z).

is_open (boolean, required)

States whether the conversation with the customer is currently on going. If set to true the conversation status in INK will be set to open, otherwise it will be set to closed. A conversation in this context is the collection of all emails linked to a given account.

200 Ok response is returned if the payload is valid and the email creation was successfully initiated. 400 Bad Request response is returned if there are validation errors. 404 Not Found response is returned if an account import process or account is not found. 500 Internal Server Error response is returned if the process errors at the stage of creation.

The email creation happens asynchronously, so the result of this process can’t be returned immediately. Furthermore, the tasks creating each email for the given account will execute sequentially in date order, with the oldest email being create first. This is independent of the order they are provided in in the payload. This means that if the creation of an email fails, the process is interrupted and no further email are created.

To verify that the email import process has completed, we log migration tracker events on the account’s import process. Upon initiation a HISTORIC_EMAIL_CREATION_STARTED tracker event is created, if there is a failure this will be logged as HISTORIC_EMAIL_CREATION_FAILED. When the process completes successfully we log HISTORIC_EMAIL_CREATION_COMPLETED.

The process has protection against duplication: emails provided a second time will be skipped, and don’t cause a failure. The conversation status and its most recent contact date will only be updated if the latest email provided in a given batch is later than the conversation’s latest email if one exists. This means it is safe to upload further batches of email for a given account, even if the emails are older than those previously imported.

Financials

Creating transactions post-import

Once it has been imported, use this end-point to add transactions to an account import process and the resulting account.

Request:

POST /v1/data-import/transactions/create/ POST /v1/data-import/transactions/create/?check_previously_added=true&force_add_to_current_statement=true

Sample payload:

{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "7654321", "transactions": [ { "transaction_id": "1", "transaction_date": "2019-10-01", "amount": "71.00", "type": "PAYMENT", "reason": "GENERAL_CREDIT", "reference": "reference 1", "payment_type": "DEBIT_CARD" } ] }

The requests payload is a single object containing the account information and a list of transaction objects:

import_supplier (string, required)

Code of the import supplier where the account is meant to be imported to. The import supplier code will be provided to you.

external_account_number (string, required)

Original customer identifier. Can’t be longer than 128 characters.

transactions (array, required)

Transactions are a list of objects with the following fields.

A note on prepay consumption charges:

Transactions of type CHARGE with a consumption reason (Electricity or Gas) that are marked as being “to a prepay meter” indicate a consumption charge that is known to have been carried out _by_ the prepay meter (i.e. a meter-driven charge); Such a transaction definition is _not_ appropriate for migrating a consumption charge carried out by the supplier that was/will be reconciled against the meter’s behaviour (i.e. an account-driven charge). The latter are not expected to be explicitly migrated, as they should always be included in both an issued bill and the balances reported in the set of prepay_details for the relevant prepay meter.

transaction_id (string, required)

Unique internal identifier for this transaction.

transaction_date (date, required)

Date when the transaction was effective.

amount (decimal, required)

Number to 2 decimal places e.g. if the customer has a consumption charge worth 23.43, this equates to a transaction of type CHARGE of 23.43. Payments and repayments must be positive numbers. Generally charges and credits are also positive, but may be negative to represent reversed charges or credits, or if an incorrect estimated reading has resulted in a negative consumption charge.

type (string, required)

One of CHARGE or CREDIT or PAYMENT or REPAYMENT or TRANSFER.

The amount of a CHARGE or REPAYMENT transaction is subtracted from the account’s balance.

The amount of a CREDIT or PAYMENT transaction is added to the account’s balance.

TRANSFER transactions are neutral, as they represent transfers between different ledgers in a single (Kraken) account; they have no impact on the overall account balance.

reason (string, optional)
If the transaction is of PAYMENT type, one of the following:
  • ACCOUNT_CHARGE_PAYMENT

  • BALANCE_ADJUSTMENT

  • GENERAL_CREDIT

  • SSD_PAYMENT

  • DEBT_REPAYMENT

If the transaction is of REPAYMENT type, one of the following:
  • FULL_CREDIT_REFUND

  • PARTIAL_CREDIT_REFUND

  • ET_REFUND

  • FINAL_BALANCE_SETTLEMENT

  • MISTAKEN_PAYMENT_TAKEN

  • COMPLAINT_COMPENSATION

  • INDEMNITY_CLAIM

  • FAILED_PAYMENT

If the transaction is of CREDIT type, one of the following:
  • ACCURACY_TEST_ADJUSTMENT

  • CUSTOMER_SERVICE_GESTURE

  • DISC_WARM_HOME_DISCOUNT

  • EXIT_FEE_REFUND

  • FEED_IN_TARIFF_PAYMENT

  • GAS_NETWORK_COMPENSATION

  • JOINING_REWARD

  • LOYALTY_REWARD

  • MISSED_SAVINGS

  • REFERRAL_REWARD

  • RETURNED_BUSINESS_PREPAYMENT

  • SALES_COMPENSATION

  • EXPORT_TARIFF_PAYMENT

  • WRITE_OFF_BANKRUPTCY

  • WRITE_OFF_DECEASED

  • WRITE_OFF_DRO

  • WRITE_OFF_IVA

  • WRITE_OFF_NEGLIGIBLE_VALUE

  • WRITE_OFF_UNRECOVERABLE_DEBT

  • WRITE_OFF_PAST_BILLABLE

  • WRITE_OFF_RECOVERY_DISCOUNT

  • WITHDRAWAL_NOT_ACTIONED

  • STAFF_DISCOUNT

  • DIRECT_DEBIT_DISCOUNT

  • STANDARDS_OF_PERFORMANCE_ET_COMMS_OVERDUE

  • STANDARDS_OF_PERFORMANCE_ET_LOSS_UNRESOLVED

  • STANDARDS_OF_PERFORMANCE_ET_GAIN_UNRESOLVED

  • STANDARDS_OF_PERFORMANCE_CUSTOMER_NOT_RETURNED

  • ADDITIONAL_SOP_PAYMENT_ET_COMMS_OVERDUE

  • ADDITIONAL_SOP_PAYMENT_ET_LOSS_UNRESOLVED

  • ADDITIONAL_SOP_PAYMENT_ET_GAIN_UNRESOLVED

  • ADDITIONAL_SOP_PAYMENT_CUSTOMER_NOT_RETURNED

  • STANDARDS_OF_PERFORMANCE_APPOINTMENTS_STANDARD_VISIT_ELEC

  • STANDARDS_OF_PERFORMANCE_APPOINTMENTS_FAULTY_METER_ELEC

  • STANDARDS_OF_PERFORMANCE_APPOINTMENTS_PREPAY_METER_ELEC

  • STANDARDS_OF_PERFORMANCE_APPOINTMENTS_RECONNECTION_ELEC

  • STANDARDS_OF_PERFORMANCE_APPOINTMENTS_STANDARD_VISIT_GAS

  • STANDARDS_OF_PERFORMANCE_APPOINTMENTS_FAULTY_METER_GAS

  • STANDARDS_OF_PERFORMANCE_APPOINTMENTS_PREPAY_METER_GAS

  • STANDARDS_OF_PERFORMANCE_APPOINTMENTS_RECONNECTION_GAS

  • STANDARDS_OF_PERFORMANCE_REFUND_ISSUED_LATE

  • STANDARDS_OF_PERFORMANCE_FINAL_BILL_ISSUED_LATE

  • ADDITIONAL_SOP_PAYMENT_APPOINTMENTS

  • BALANCE_ADJUSTMENT

  • BALANCE_TRANSFER

  • BANK_TRANSFER

  • CUSTOMER_REIMBURSEMENT

  • DISPUTED_CARD_PAYMENTS

  • IMPORTED_CREDIT

  • MARKET_RESEARCH_CLUB_REWARD

  • OFFSET

  • PREPAY_DEBT_ADJUSTMENT

  • REINSTATED_DIRECT_DEBIT

  • REVERSED_ACCOUNT_CHARGE

  • DATA_IMPORT_BALANCE_TRANSFER

  • BALANCE_TRANSFER_FOR_FINAL_BILLED_ACCOUNT

  • SUPPLEMENTARY_LEDGER_BALANCE_TRANSFER

  • SHARE_OF_PROFITS

  • GOODWILL_PAYMENT

  • DEPOSIT_REFUND

  • ERRONEOUS_TRANSFER_REFUND

  • DEBIT_BALANCE_TRANSFER

  • TARIFF_PRICE_ADJUSTMENT_GOODWILL

  • ECONOMY_7_DIFFERENCE

  • WRITE_OFF_BACK_BILLING

  • WRITE_OFF_MISSED_PAYMENT_DELETION

  • TARIFF_DISCOUNT

  • STANDARDS_OF_PERFORMANCE_ERRONEOUS_TRANSFER

  • ADDITIONAL_SOP_PAYMENT_ERRONEOUS_TRANSFER

If the transaction is of CHARGE type, one of the following:
  • DEFAULT

  • BALANCE_TRANSFER

  • SUPPLEMENTARY_LEDGER_BALANCE_TRANSFER

  • CREDIT_BALANCE_DONATED_TO_CHARITY

  • DIRECT_DEBIT_REFUND_BALANCING

  • METERING_JOB_BUSINESS

  • METERING_JOB_NATIONAL_GRID

  • METERING_JOB_SMS

  • NEST_LEARNING_THERMOSTAT_RENTAL

  • PENALTY_CHARGE

  • PREPAY_DEBT_ADJUSTMENT

  • REVERSED_ACCOUNT_CREDIT

  • BUSINESS_PREPAYMENT

  • WRITE_BACK

  • EARLY_EXIT_FEE

  • DCA_CHARGE

  • Electricity

  • Gas

If the transaction is of TRANSFER type, one of the following: PREPAY_DEBT_ADJUSTMENT

If a reason other than the above is given for transaction types CHARGE and CREDIT, this will be displayed in Kraken and to the customer.

reference (string, optional)

Transaction reference. Could be an external id to help identify this transaction

to_prepay_meter_serial_number (string, optional)

The serial number of the prepay meter that this transaction has been “sent to” (via a PPMIP).

In the case of prepay vends, this “sending” was carried out by the customer paying at an outlet; as such, this field should always be populated for prepay vend transactions.

In the case of credits and non-consumption charges applied to the customer’s account pre-migration, this field should be populated only where a request to add the corresponding credit or debt to the prepay meter has been sent and accepted by the PPMIP.

payment_type (string, optional)
If the transaction is of PAYMENT type, one of the following:
  • DD_FIRST_COLLECTION

  • DD_REGULAR_COLLECTION

  • DD_RE_PRESENTATION

  • DD_FINAL_COLLECTION

  • CREDIT_CARD

  • DEBIT_CARD

  • CHEQUE

  • BACS_DEPOSIT

  • ALLPAY_CASH

  • ALLPAY_CARD

  • ALLPAY_CHEQUE

  • PAYPOINT_CASH

  • PAYPOINT_CARD

  • PAYPOINT_CHEQUE

  • DCA_COLLECTION

  • BRISTOL_POUND

  • CASH

  • FUEL_DIRECT

If the transaction is of REPAYMENT type, one of the following:
  • DIRECT_CREDIT

  • CARD_REFUND

  • BACS

  • CHEQUE

These optional query parameters are available:

  • check_previously_added - boolean flag indicating whether to check if a transaction has already been added. Defaults to true

  • force_add_to_current_statement - boolean flag. If set to true this will modify the payment date of a transaction so that it is within the currently open statement period, if it is not when passed in. This then allows the transaction be be added to the statement instead of throwing an error. A description is added to the payment explain this and a note is pinned to the account. Defaults to true.

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors. This will look something like:

{ "transactions": { "0": { "reason": [ "Not a valid string." ] } } }

If the payload is valid, and there were no errors while importing the transactions, a 201 Created response will be returned containing an object with a list transactions that were passed in along with their creation statuses. The following statuses are available:

  • TRANSACTION_ADDED_TO_ACCOUNT - the transaction has been added to both the account import process and the account

  • TRANSACTION_ALREADY_EXISTS - the transaction has already been added previously, and so was skipped

{ "results": [ { "status": "TRANSACTION_ALREADY_EXISTS", "transaction_data": { "transaction_id": "1", "transaction_date": "2019-10-01", "amount": "71.00", "type": "PAYMENT", "reason": "GENERAL_CREDIT", "reference": "reference 1", "payment_type": "DEBIT_CARD", "status": "TRANSACTION_IMPORT_SUCCESS" } }, { "status": "TRANSACTION_ADDED_TO_ACCOUNT", "transaction_data": { "transaction_id": "2", "transaction_date": "2019-10-04", "amount": "180.00", "type": "PAYMENT", "reason": "GENERAL_CREDIT", "reference": "reference 2", "payment_type": "DEBIT_CARD" } } ] }

If there were any errors while importing the transactions, a 400 Bad Request response will be returned containing the first failing transaction, along with an additional error_detail field with the reason for the failure, and the status TRANSACTION_IMPORT_ERROR.

{ "status": "TRANSACTION_IMPORT_ERROR", "error_detail": "UnableToCreateTransaction - 2019-09-28 of Payment #1 of 7100 on 2019-09-28 (ThirdParty) is not within the statement A-00000001 2019-10-01 - 2019-10-15 (OPEN) period", "transaction_data": { "transaction_id": "1", "transaction_date": "2019-09-28", "amount": "71.00", "type": "PAYMENT", "reason": "GENERAL_CREDIT", "reference": "reference 1", "payment_type": "DEBIT_CARD" } }

Possible validation errors are:

  • {payment_date} of {payment} is not within the statement {statement} period

  • {payment_date} of {repayment} is not within the statement {statement} period

  • {transaction_date} of {gross_amount} charge is not within the statement {statement} period

  • {transaction_date} of {gross_amount} credit is not within the statement {statement} period

  • Could not find meter with serial number {meter_serial_number} on account.

  • Meter {meter_serial_number} is either not a prepay meter or it has not had its ledgers initialised.

  • All transactions must have a transaction_id.

  • Received transactions with duplicate IDs: {duplicate_ids}.

Create payment instruction

Use this end-point to create a payment instruction.

Request:

POST /v1/data-import/payment-instruction/create

Sample payload:

{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "7654321", "vendor": "ACCESS_PAYSUITE", "instruction_reference": "THIS-IS-A-FAKE-REFERENCE", "type": "DIRECT_DEBIT" }

The request payload is a single object containing the account information, the instruction type, and the reference that is to be used to retrieve the correct bank or card details from the relevant payment vendor.

import_supplier (string, required)

Code of the import supplier where the account is meant to be imported to. The import supplier code will be provided to you.

external_account_number (string, required)

Original customer identifier. Can’t be longer than 128 characters.

vendor (str, required)

Please contact the tech team for the names of the vendors available to you.

instruction_reference (string, required)

The reference of the payment instruction as known by the vendor. Can’t be longer than 512 characters.

type (string, required)

The type of the payment instruction: DIRECT_DEBIT or CARD. This is used to identify the payment vendor to retrieve the instruction details to store in Kraken from.

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors. This will look something like:

{ "instruction_reference": [ "Ensure this field has no more than 512 characters." ] }

Additional errors will be returned like this

{ "reference": "THIS-IS-A-FAKE-REFERENCE", "import_supplier_code": "SOME_IMPORT_SUPPLIER", "external_account_number": "7654321", "error_detail": "Some error occurred" }

where the error can be one of the errors given below. Unexpected errors are returned in the same format but with a 500 Internal Server Error.

If the payload is valid, a 201 Created response will be returned containing the Kraken account number and the reference:

{ "kraken_account_number": "A-C90DC431", "reference": "THIS-IS-A-FAKE-REFERENCE" }

Possible errors are:

  • An account import process with the account number {external_account_number} does not exist for the import supplier {import_supplier_code}.

  • Account not found for {external_account_number}

  • {external_account_number} has no users - cannot create a payment instruction

  • Account already has an active instruction

In addition there could be errors relating to the communication with the payment vendor. We will call their API to verify the instructions existence and retrieve its details to store in Kraken. These will return a 400 Bad Request if they are final, and the request should not be retried in its current form. If they are intermittent, they are returned with a with a 500 Internal Server Error, which means the request should be retried.

Readings

Create meter reading

Use this end-point to add meter readings to a meterpoint. Unbilled readings can be added at any time, but readings that have already been billed may only be added from before Kraken became responsible for billing for the meterpoint.

Request:

POST /v1/data-import/meter-readings/create/

Sample payload:

{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "7654321", "meter_points": [ { "mpxn": "1013004420117", "meters": [ { "meter_serial_number": "Z16N389556", "readings": [ { "register_id": "1", "reading_date": "2019-06-20", "reading_value": 960, "reading_type": "ROUTINE", "billed": true }, { "register_id": "1", "reading_date": "2019-06-21", "reading_value": 980, "reading_type": "CUSTOMER", "billed": true } ] } ] }, { "mpxn": "3406086401", "meters": [ { "meter_serial_number": "E6S04460871456", "readings": [ { "reading_date": "2019-06-20", "reading_value": 500, "reading_type": "CUSTOMER", "billed": true } ] } ] } ] }

The expected payload is a single object containing the account information and a list of meterpoints containing reading data. The structure is similar to the meterpoint structure in the Validating account data API.

import_supplier (string, required)

Code of the import supplier where the account is meant to be imported to. The import supplier code will be provided to you.

external_account_number (string, required)

Original customer identifier. Can’t be longer than 128 characters.

meter_points (array, required)

List of meter points linked to the property.

mpxn (string, required)

MPAN or MPRN of this meter point.

meters (array, required)

List of active and exchanged meters on the meter point.

meter_serial_number (string, required)

Serial number of the meter. Can’t be longer than 32 characters.

readings (array, required)

List of readings to be loaded into Kraken.

register_id (string, optional)

This should be the value as provided in MTDs, including leading zeros. This register id must make reference to an existing register under this meter. This field is required for electricity readings. Can’t be longer than 32 characters.

reading_date (date, required)

Date of the reading.

reading_type (string, required)

One of ESTIMATE or SMART or REGULAR or CUSTOMER or ROUTINE.

reading_value (decimal, required)

Value of the reading.

billed (bool, required)

Whether the reading has been billed.

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors. Validation errors will occur if there are required fields missing or if a meter point, meter or register cannot be found for any of the provided readings.

{ "meter_serial_number": [ "Ensure this field has no more than 32 characters." ] }

If an account import process or account is not found then a 404 Not Found response will be returned.

If the payload is valid, a 201 Created response will be returned containing a list of the readings and their creation status. If there are errors with the creation of a particular reading, the status and error_detail will reflect this:

[ { "mpxn": "1013004420117", "status": "METER_READING_CREATION_SUCCESS", "reading": { "register_id": "1", "reading_date": "2019-06-21", "reading_type": "CUSTOMER", "reading_value": 980.0, "billed": true } }, { "mpxn": "3406086401", "status": "METER_READING_CREATION_SUCCESS", "reading": { "reading_date": "2019-06-20", "reading_type": "CUSTOMER", "reading_value": 500.0, "billed": true } }, { "mpxn": "1013004420117", "status": "METER_READING_CREATION_ERROR", "error_detail": "Billed reading on 2019-06-30 must come before the meterpoint supply start 2019-06-15 on meterpoint 1013004420117." "reading": { "register_id": "1", "reading_date": "2019-06-30", "reading_type": "ROUTINE", "reading_value": 960.0, "billed": true }, } ]

Possible validation errors are:

  • No meter found for {meter_serial_number} for meter point {mpxn}.

  • Account not found for {external_account_number}

  • Billed reading on {reading_date} must come before the meterpoint supply start on {supply_start_date} on meterpoint {mpxn}.

  • Reading already exists.

Appendix

Account transfer statuses

The status returned from the Retrieve status of imported account endpoint can be one of
  • UNKNOWN - an account has not been created yet in Kraken

  • PENDING - an account has been created in Kraken, but the switch hasn’t started yet

  • IN_PROGRESS - registration flows for all meter points have been sent

  • REJECTED - change of supplier process rejected by previous supplier

  • COMPLETED - change of supplier process successful

If no account has been created in Kraken yet, the status will be UNKNOWN with no kraken_account_number returned.

Customer roles

The role field is not yet configured for this Kraken instance, and should not be provided.