Wraps a successful Stripe API response with metadata.
%LatticeStripe.Response{} holds the decoded response body (in data),
HTTP status code, response headers, and the extracted request_id from
the Request-Id header.
Bracket Access
For singular object responses, bracket access delegates to data:
{:ok, resp} = LatticeStripe.Client.request(client, req)
resp["id"] # same as resp.data["id"]
resp["object"] # same as resp.data["object"]When data is a %LatticeStripe.List{}, bracket access always returns nil.
Use resp.data.has_more, resp.data.data, etc. directly for list responses.
Request ID
The request_id field is extracted from the Request-Id response header
for convenience — it's the most common header value needed for debugging.
Use get_header/2 for any other header values.
Summary
Functions
Returns all values for the given header name (case-insensitive).
Types
@type t() :: %LatticeStripe.Response{ data: map() | LatticeStripe.List.t() | nil, headers: [{String.t(), String.t()}], request_id: String.t() | nil, status: non_neg_integer() | nil }
A successful Stripe API response with metadata.
Returned by LatticeStripe.Client.request/2 on success. The data field holds
the decoded response body — either a plain map (singular resource) or a
%LatticeStripe.List{} (list/search endpoints).
data- Decoded response body: a plain map or%LatticeStripe.List{}status- HTTP status integer (e.g.,200,201)headers- List of{name, value}string tuples from the responserequest_id- StripeRequest-Idheader value (useful for support requests)