Dnsimple.Certificates.purchase_letsencrypt_certificate

You're seeing just the function purchase_letsencrypt_certificate, go back to Dnsimple.Certificates module for more information.
Link to this function

purchase_letsencrypt_certificate(client, account_id, domain_id, attributes, options \\ [])

Specs

purchase_letsencrypt_certificate(
  Dnsimple.Client.t(),
  String.t() | integer(),
  String.t() | integer(),
  Keyword.t(),
  Keyword.t()
) :: {:ok | :error, Dnsimple.Response.t()}

Purchase a Let's Encrypt certificate.

This method creates a new purchase order. The order ID should be used to request the issuance of the certificate using #issue_letsencrypt_certificate.

See:

Examples

# Purchase a certificate for a single name
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", contact_id: 1, name: "www")
purchase_id     = response.data.id

# Purchase a certificate for multiple names (SAN)
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", contact_id: 1, alternate_names: ["example.com", "www.example.com", "status.example.com"])

# Enable auto-renew on purchase
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Certificates.purchase_letsencrypt_certificate(client, account_id = "1010", domain_id = "example.com", contact_id: 1, auto_renew: true)