Skip to main content

Customer Migrations Guide: Post Account Import

After an account has successfully been created you might need to import additional data. In this section we’ll walk you through the various endpoints you can use to add information to an imported account in Kraken.

Importing account notes

Overview

Use this endpoint to add notes to an account.

Some points to note:

  • A note must contain at least one of the fields body or document_paths.
  • A created_at datetime may optionally be provided. Otherwise, it will default to the current local time.
  • The document_paths refer to the locations in S3 where attached documents are stored. More details on document paths can be found here.
  • An optional is_pinned boolean can be passed in the payload to control whether this note will be pinned to the top of the Kraken account support site page.

Schema

Loading...
POST https://api.oeg-kraken.energy/v1/data-import/notes/create/

Responses

The following responses may be returned from the API.

docs--rest--api-guides--data-import--post-import-actions--account-notes--api-responses--html
Status codeDescription

Payloads

Example payload
{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "EXTERNAL-1234", "notes": [ { "body": "Some important pinned note.", "is_pinned": true, "unpin_at": "2020-06-01T12:00:00Z" }, { "created_at": "2020-02-01T12:00:00Z", "body": "Some important note with an attachment.", "document_paths": [ { "document_path": "some/path/to/a/document.pdf" } ] } ] }

Importing financial transactions

Overview

Use this endpoint to import financial transactions to an account.

The following optional URL params are available to tweak the behaviour of the API:

  • 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 and the payload contains a transaction that is outside the currently-open statement period, this will modify the transaction date so that it is within the currently-open statement period. This then allows the transaction to be added to the statement instead of throwing an error. A description is added to the transaction to explain this, and a note is pinned to the account. Defaults to true.

Schema

Loading...
POST https://api.oeg-kraken.energy/v1/data-import/transactions/create/

Responses

The following responses may be returned from the API.

docs--rest--api-guides--data-import--post-import-actions--financial-transactions--api-responses--html
Status codeDescription

Payloads

Example payload
{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "EXTERNAL-1234", "transactions": [ { "transaction_id": "1", "transaction_date": "2019-10-01", "amount": 10.0, "type": "CHARGE", "reason": "IMPORTED_CHARGE", "display_note": "Some customer facing note about the charge.", "note": "Some internal note about the charge." }, { "transaction_id": "2", "transaction_date": "2019-10-01", "amount": 10.0, "type": "CREDIT", "reason": "IMPORTED_CREDIT", "display_note": "Some customer facing note about the credit.", "note": "Some internal note about the credit." }, { "transaction_id": "3", "transaction_date": "2019-10-01", "amount": 10.0, "type": "PAYMENT", "reason": "ACCOUNT_CHARGE_PAYMENT", "reference": "payment-reference-1", "payment_type": "DD_REGULAR_COLLECTION", "note": "Some internal note about the payment." }, { "transaction_id": "4", "transaction_date": "2019-10-01", "amount": 10.0, "type": "REPAYMENT", "reason": "FULL_CREDIT_REFUND", "reference": "repayment-reference-1", "payment_type": "DIRECT_CREDIT", "note": "Some internal note about the repayment." }, { "transaction_id": "5", "transaction_date": "2019-10-01", "amount": 10.0, "type": "SUPPLY_CHARGE", "display_note": "Some customer facing note about the supply charge.", "product_code": "SOME-PRODUCT-CODE-4321", "line_items": [ { "rate_band": "CONSUMPTION_STANDARD", "start_date": "2019-10-01", "end_date": "2019-11-01", "number_of_units": 4.0, "net_amount": 44.0, "price_per_unit": 11.0, "units": [ 4.0, 8.0 ] } ], "tax_items": [ { "amount": 9.24, "tax_type": "VAT", "value_taxed": 44.0, "rate": 0.21, "unit_type": "PROPORTION" } ] } ] }

Importing historical statements

Overview

Use this endpoint to import historical PDF statements onto an account. The historical statements payload contains an optional statement_path field that points to a location for the PDF statement in S3. For more information on document path parameters, see document paths section.

Schema

Loading...
POST https://api.oeg-kraken.energy/v1/data-import/historical-statements/create/

Responses

The following responses may be returned from the API.

Status codeDescription
201 - Created

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

400 - Bad Request

If there are validation errors, a 400 Bad Request response will be returned, detailing the errors. To resolve the error, refer to the field definitions and validation rules.

Payloads

Example payload
{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "EXTERNAL-1234", "statements": [ { "bill_period_from_date": "2022-01-01", "bill_period_to_date": "2022-01-31", "statement_id": "1", "issued_date": "2022-02-02", "number": "1", "gross_amount": 100, "statement_path": "path/to/statement-1.pdf", "supply_type": "ELECTRICITY", "is_annulled": false } ] }

Importing payment instructions

Overview

Use this endpoint to create a payment instruction for an account.

Schema

Loading...
POST https://api.oeg-kraken.energy/v1/data-import/payment-instruction/create/

Responses

The following responses may be returned from the API.

docs--rest--api-guides--data-import--post-import-actions--payment-instructions--api-responses--html
Status codeDescription

Payloads

Example payload
{ "import_supplier": "TENTACLE_ENERGY", "external_account_number": "EXTERNAL-1234", "vendor": "STRIPE", "instruction_reference": "THIS-IS-A-FAKE-REFERENCE", "type": "CARD" }