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.
API Endpoints
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
Responses
The following responses may be returned from the API.
Status code | Description |
---|---|
200 - OK |
If the payload is valid, a |
400 - Bad Request |
If there are validation errors a |
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"
}
]
}
]
}
]
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.
Schema
Responses
The following responses may be returned from the API.
Status code | Description |
---|---|
201 - Created |
If the payload is valid, and a product has been created, a {"code": "SUPER-PROD-V1"} |
400 - Bad Request |
If there are validation errors, a |
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"
}
]
}
]
}
]