Tutorials

Synchronize design pricing

This tutorial shows how to programmatically synchronize pricing information for a design in Aurora.

How It Works


Modify basic pricing parameters via API to keep them in sync with your own pricing engine. The process can include any of these steps:

  • Update the pricing method and amount.
  • Create new adders and discounts.
  • Delete unwanted adders and discounts.
  • Retrieve design pricing.

Getting Started


To complete this tutorial, you will need:

  • your Aurora tenant to be on a Business plan,
  • your Aurora tenant to use the current API version,
  • your Aurora bearer token,
  • your Aurora tenant_id,
  • design_id for the design to manage,

You or any Administrator for your Aurora tenant can retrieve the token and tenant id from the API Settings page.

Step 1. Update the pricing method and amount


Update the Flat Price or Price Per Watt.

💡 Only one of Flat Price or Price Per Watt can apply for a given design. Updating either one will replace any existing pricing method on the design. After the pricing mode has been changed, the response will include values for both `flat_system_price` and `price_per_watt`. The `pricing_mode` indicates which of these values is in effect.

Update Flat Price

Set the pricing mode to Flat Price and specify a flat price for the design.

//PUT https://api-sandbox.aurorasolar.com/tenants/{tenant_id}/designs/{design_id}/pricing
{
  "pricing": {
    "flat_system_price": 40000
  }
}

//HTTP 200 Response
{
  "pricing": {
    "pricing_method": "flat system price",
    "flat_system_price": 40000,
    ...
}

Update Price Per Watt

Set the pricing mode to Price Per Watt and specify a price per watt for the design.

//PUT https://api-sandbox.aurorasolar.com/tenants/{tenant_id}/designs/{design_id}/pricing
{
  "pricing": {
    "price_per_watt": 2.75
  }
}

//HTTP 200 Response
{
  "pricing": {
    "pricing_method": "price per watt",
    "price_per_watt": 2.75,
    ...
}

Step 2. Create adders and discounts


Create adders and discounts for the design. Only adder_name and adder_value are required parameters.

Create an Adder

This example creates an adder using both required and optional parameters.

//POST https://api-sandbox.aurorasolar.com/tenants/{tenant_id}/designs/{design_id}/pricing/adders
{
  "adder": {
    "adder_name": "No reason fee",
    "adder_value": 199.99,
    "quantity": 1,
    "is_discount": false,
    "is_editable": true,
    "is_hidden": false,
    "is_quantity_editable": false,
    "eligible_for_cbi": true,
    "prevent_manual_deletion": true
  }
}

//HTTP 200 Response
{
  "adder": {
    "id": "5b38a39d-fecf-4854-8df9-664bcd1b1082",
    "adder_name": "No reason fee",
    "adder_value": 199.99,
    "adder_type": "flat",
    "quantity": 1,
    "is_discount": false,
    "is_editable": true,
    "is_hidden": false,
    "is_quantity_editable": false,
    "eligible_for_cbi": true,
    "prevent_manual_deletion": true
  }
}

Create a Discount

This example creates a discount using only the required parameters.

//POST https://api-sandbox.aurorasolar.com/tenants/{tenant_id}/designs/{design_id}/pricing/adders
{
  "adder": {
    "adder_name": "Friendly homeowner",
    "adder_value": -50
  }
}

//HTTP 200 Response
{
  "adder": {
    "id": "2146d678-af87-49b0-853b-0f77a36161a6",
    "adder_name": "Friendly homeowner",
    "adder_value": -50,
    "adder_type": "flat",
    "quantity": 1,
    "is_discount": true,
    "is_editable": false,
    "is_hidden": false,
    "is_quantity_editable": false,
    "eligible_for_cbi": true,
    "prevent_manual_deletion": false
  }
}

Step 3. Delete adders and discounts


Remove any existing adders that no longer apply to the design. You can find the adder ID by examining the adders returned by the Retrieve Design Pricing endpoint (Step 4) or you can track the IDs for adders you created previously (Step 2).

//DELETE https://api-sandbox.aurorasolar.com/tenants/{tenant_id}/adders/{adder_id}

//HTTP 204 Response

Step 4. Retrieve design pricing


Retrieve the design’s existing pricing. Only the parameters related to pricing synchronization are shown here. Refer to the Aurora API documentation for a description of all pricing fields.

💡 The response includes values for both `flat_system_price` and `price_per_watt`. The `pricing_method` indicates which of these values is in effect.
//GET https://api-sandbox.aurorasolar.com/tenants/{tenant_id}/designs/{design_id}/pricing

//HTTP 200 Response
{
  "pricing": {
    "pricing_method": "flat system price",
    "flat_system_price": 40000,
    "price_per_watt": 0.0,
    "adders": [{
        "id": "4e8d388a-ac8f-4064-9060-fc51bc73223e",
        "adder_name": "No reason fee",
        "adder_value": 199.99,
        "adder_type": "flat",
        "quantity": 1,
        "is_discount": false,
        "is_editable": true,
        "is_hidden": false,
        "is_quantity_editable": false,
        "eligible_for_cbi": true,
        "prevent_manual_deletion": false
      }, {
        "id": "2146d678-af87-49b0-853b-0f77a36161a6",
        "adder_name": "Friendly homeowner",
        "adder_value": -50,
        "adder_type": "flat",
        "quantity": 1,
        "is_discount": true,
        "is_editable": false,
        "is_hidden": false,
        "is_quantity_editable": false,
        "eligible_for_cbi": true,
        "prevent_manual_deletion": false
    }],
    ...
  }
}

Considerations


  • After creating adders via the API, it may be helpful to track their IDs in your system so you can easily delete just those adders when synchronizing changes.