View Source Stripe.Climate.Order (stripity_stripe v3.2.0)

Orders represent your intent to purchase a particular Climate product. When you create an order, the payment is deducted from your merchant balance.

Summary

Types

Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set.

t()

The climate.order type.

Functions

Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds thereservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total.

Creates a Climate order object for a given Climate product. The order will be processed immediatelyafter creation and payment will be deducted your Stripe balance.

Lists all Climate order objects. The orders are returned sorted by creation date, with themost recently created orders appearing first.

Retrieves the details of a Climate order object with the given ID.

Updates the specified order by setting the values of the parameters passed.

Types

@type beneficiary() :: %{optional(:public_name) => binary()}

Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set.

@type t() :: %Stripe.Climate.Order{
  amount_fees: integer(),
  amount_subtotal: integer(),
  amount_total: integer(),
  beneficiary: term(),
  canceled_at: integer() | nil,
  cancellation_reason: binary() | nil,
  certificate: binary() | nil,
  confirmed_at: integer() | nil,
  created: integer(),
  currency: binary(),
  delayed_at: integer() | nil,
  delivered_at: integer() | nil,
  delivery_details: term(),
  expected_delivery_year: integer(),
  id: binary(),
  livemode: boolean(),
  metadata: term(),
  metric_tons: binary(),
  object: binary(),
  product: binary() | Stripe.Climate.Product.t(),
  product_substituted_at: integer() | nil,
  status: binary()
}

The climate.order type.

  • amount_fees Total amount of Frontier's service fees in the currency's smallest unit.
  • amount_subtotal Total amount of the carbon removal in the currency's smallest unit.
  • amount_total Total amount of the order including fees in the currency's smallest unit.
  • beneficiary
  • canceled_at Time at which the order was canceled. Measured in seconds since the Unix epoch.
  • cancellation_reason Reason for the cancellation of this order.
  • certificate For delivered orders, a URL to a delivery certificate for the order.
  • confirmed_at Time at which the order was confirmed. Measured in seconds since the Unix epoch.
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • currency Three-letter ISO currency code, in lowercase, representing the currency for this order.
  • delayed_at Time at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch.
  • delivered_at Time at which the order was delivered. Measured in seconds since the Unix epoch.
  • delivery_details Details about the delivery of carbon removal for this order.
  • expected_delivery_year The year this order is expected to be delivered.
  • id Unique identifier for the object.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  • metric_tons Quantity of carbon removal that is included in this order.
  • object String representing the object's type. Objects of the same type share the same value.
  • product Unique ID for the Climate Product this order is purchasing.
  • product_substituted_at Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch.
  • status The current status of this order.

Functions

Link to this function

cancel(order, params \\ %{}, opts \\ [])

View Source
@spec cancel(
  order :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds thereservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total.

#### Details * Method: `post` * Path: `/v1/climate/orders/{order}/cancel`

Link to this function

create(params \\ %{}, opts \\ [])

View Source
@spec create(
  params :: %{
    optional(:amount) => integer(),
    optional(:beneficiary) => beneficiary(),
    optional(:currency) => binary(),
    optional(:expand) => [binary()],
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:metric_tons) => binary(),
    optional(:product) => binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a Climate order object for a given Climate product. The order will be processed immediatelyafter creation and payment will be deducted your Stripe balance.

#### Details * Method: `post` * Path: `/v1/climate/orders`

Link to this function

list(params \\ %{}, opts \\ [])

View Source
@spec list(
  params :: %{
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:limit) => integer(),
    optional(:starting_after) => binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Lists all Climate order objects. The orders are returned sorted by creation date, with themost recently created orders appearing first.

#### Details * Method: `get` * Path: `/v1/climate/orders`

Link to this function

retrieve(order, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  order :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves the details of a Climate order object with the given ID.

Details

  • Method: get
  • Path: /v1/climate/orders/{order}
Link to this function

update(order, params \\ %{}, opts \\ [])

View Source
@spec update(
  order :: binary(),
  params :: %{
    optional(:beneficiary) => beneficiary() | binary(),
    optional(:expand) => [binary()],
    optional(:metadata) => %{optional(binary()) => binary()}
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Updates the specified order by setting the values of the parameters passed.

Details

  • Method: post
  • Path: /v1/climate/orders/{order}