Skip to main content

Customer Migrations Guide: Product Import

Once you've prepared your data, and coordinated the setup of an import supplier with us, the next step is to create your products in Kraken. This is important as products must already exist in Kraken before accounts can be created that are associated with them.

During this stage, we'll walk you through the process of validating your product data and creating the product within Kraken. Here, you'll find all the fields and validation rules accepted by our API, as well as the various responses you may receive throughout this process.

Validate products

Overview

Use this endpoint to validate product data before creating the products in Kraken.

The endpoint accepts a JSON payload containing a list of product objects.

Schema

Field definitions

See here for a complete list of the fields available in the API, along with a definition and their rules for validation.

Refer to this table when preparing the data, and use it to correct any invalid data you might have inputted resulting in an error response.

POST https://api.octopus.energy/v1/data-import/validate-products/

Responses

The following responses may be returned from the API.

Status codeDescription
200 - OK

If the payload is valid, a 200 OK response will be returned with the validated data as its body. You may now move onto the next stage and create the product in Kraken.

400 - Bad Request

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

Payloads

Example 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": [ "domestic.test_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" } ] } ] } ]

Create products

Overview

Now that your data has been validated, you can go ahead and create the products in Kraken using the following endpoint.

The endpoint accepts a JSON payload containing a list of product objects, the same as the validate endpoint.

Before a product is created, it is validated according to the same rules as the validate endpoint above. This is an extra safety check to make sure nothing has changed between preparing the data and submitting it for creation in Kraken.

Schema

Field definitions

See here for a complete list of the fields available in the API, along with a definition and their rules for validation.

Refer to this table when preparing the data, and use it to correct any invalid data you might have inputted resulting in an error response.

POST https://api.octopus.energy/v1/data-import/products/

Responses

The following responses may be returned from the API.

Status codeDescription
201 - Created

If the payload is valid, and a product has been created, a 201 Created response will be returned with the body containing the code of the created product. For example:

{"code": "SUPER-PROD-V1"}
400 - Bad Request

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

Payloads

Example 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": [ "domestic.test_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" } ] } ] } ]