View Source Stripe.Forwarding.Request (stripity_stripe v3.3.1)

Instructs Stripe to make a request on your behalf using the destination URL. The destination URL is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials provided during onboarding, and injects card details from the payment_method into the request.

Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers, before storing the request and response data in the forwarding Request object, which are subject to a 30-day retention period.

You can provide a Stripe idempotency key to make sure that requests with the same key result in only one outbound request. The Stripe idempotency key provided should be unique and different from any idempotency keys provided on the underlying third-party request.

Forwarding Requests are synchronous requests that return a response or time out according to Stripe’s limits.

Related guide: Forward card details to third-party API endpoints.

Summary

Types

The request body and headers to be sent to the destination endpoint.

t()

The forwarding.request type.

Functions

Creates a ForwardingRequest object.

Lists all ForwardingRequest objects.

Retrieves a ForwardingRequest object.

Types

@type created() :: %{
  optional(:gt) => integer(),
  optional(:gte) => integer(),
  optional(:lt) => integer(),
  optional(:lte) => integer()
}
@type headers() :: %{optional(:name) => binary(), optional(:value) => binary()}
@type request() :: %{optional(:body) => binary(), optional(:headers) => [headers()]}

The request body and headers to be sent to the destination endpoint.

@type t() :: %Stripe.Forwarding.Request{
  created: integer(),
  id: binary(),
  livemode: boolean(),
  metadata: term() | nil,
  object: binary(),
  payment_method: binary(),
  replacements: term(),
  request_context: term() | nil,
  request_details: term() | nil,
  response_details: term() | nil,
  url: binary() | nil
}

The forwarding.request type.

  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • 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.
  • object String representing the object's type. Objects of the same type share the same value.
  • payment_method The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
  • replacements The field kinds to be replaced in the forwarded request.
  • request_context Context about the request from Stripe's servers to the destination endpoint.
  • request_details The request that was sent to the destination endpoint. We redact any sensitive fields.
  • response_details The response that the destination endpoint returned to us. We redact any sensitive fields.
  • url The destination URL for the forwarded request. Must be supported by the config.

Functions

Link to this function

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

View Source
@spec create(
  params :: %{
    optional(:expand) => [binary()],
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:payment_method) => binary(),
    optional(:replacements) => [
      :card_cvc
      | :card_expiry
      | :card_number
      | :cardholder_name
      | :request_signature
    ],
    optional(:request) => request(),
    optional(:url) => binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a ForwardingRequest object.

Details

  • Method: post
  • Path: /v1/forwarding/requests
Link to this function

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

View Source
@spec list(
  params :: %{
    optional(:created) => created(),
    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 ForwardingRequest objects.

Details

  • Method: get
  • Path: /v1/forwarding/requests
Link to this function

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

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

Retrieves a ForwardingRequest object.

Details

  • Method: get
  • Path: /v1/forwarding/requests/{id}