Req-based HTTP transport. Retries GET on transient errors; no retry for mutating verbs.
All functions accept per-call opts overriding the client configuration:
:access_token- token for this request only:custom_headers- headers merged over the client'scustom_headers, overriding generated headers case-insensitively:timeout- receive timeout in milliseconds for this request only:max_retries- GET retry budget for this request only
Summary
Types
Result of an API call. {:ok, ...} carries the HTTP status and the parsed
JSON body (a map, a list, or nil for empty bodies). {:error, reason} is
returned for transport-level failures (timeouts, connection errors).
Functions
DELETE request.
GET request with optional query params and per-call opts.
POST request. Omit body or pass nil to send no body.
PUT request.
Types
@type response() :: {:ok, %{status: non_neg_integer(), response: map() | list() | nil}} | {:error, term()}
Result of an API call. {:ok, ...} carries the HTTP status and the parsed
JSON body (a map, a list, or nil for empty bodies). {:error, reason} is
returned for transport-level failures (timeouts, connection errors).
Functions
@spec delete(Mercadopago.Client.t(), String.t(), keyword()) :: response()
DELETE request.
@spec get(Mercadopago.Client.t(), String.t(), map() | nil, keyword()) :: response()
GET request with optional query params and per-call opts.
@spec post(Mercadopago.Client.t(), String.t(), map() | nil, keyword()) :: response()
POST request. Omit body or pass nil to send no body.
@spec put(Mercadopago.Client.t(), String.t(), map() | nil, keyword()) :: response()
PUT request.