Paddle.Price (paddlex v0.2.0)

Copy Markdown View Source

Retrieve prices for one or more products or subscription plans.

Summary

Functions

Retrieve prices for one or multiple products or plans

Functions

get(product_ids, opts \\ [])

@spec get([String.t()],
  customer_country: String.t(),
  customer_ip: String.t(),
  coupons: String.t()
) ::
  {:ok, map()} | {:error, Paddle.Error.t()}

Retrieve prices for one or multiple products or plans

Examples

Paddle.Price.get([123456])
{:ok, %{
  "customer_country" => "GB",
  "products" => [
    %{
      "product_id" => 123456,
      "product_title" => "My Product 3",
      "currency" => "GBP",
      "vendor_set_prices_included_tax" => true,
      "price" => %{
        "gross" => 34.95,
        "net" => 29.13,
        "tax" => 5.83
      },
      "list_price" => %{
        "gross" => 34.95,
        "net" => 29.13,
        "tax" => 5.83
      },
      "applied_coupon" => []
    }
  ]
}}