shareQuoteViaEmail method

Future<void> shareQuoteViaEmail(
  1. String quoteCode,
  2. String productId,
  3. Emails emails
)

Use this endpoint after quote creation to send a quote summary email to the specified recipients if they wish to enact the quote at a later time. A quote share record is saved to the database for each recipient’s email address. WARNING: This endpoint is only available to partner organisations.

Implementation

Future<void> shareQuoteViaEmail(
  String quoteCode,
  String productId,
  Emails emails,
) async {
  final response = await _client.post(
    Uri.https(
      authority,
      '/v1/quotes/$quoteCode/products/$productId/',
    ),
    headers: {
      'content-type': 'application/json',
    },
    body: json.encode(emails.toJson()),
  );

  OctopusEnergyApiClientException.checkIsSuccessStatusCode(response);
}