Class Request

All Implemented Interfaces:
HasId, StripeActiveObject, StripeObjectInterface

public class Request extends ApiResource implements HasId
Instructs Stripe to make a request on your behalf using the destination URL and HTTP method in the config. A config is set up for each destination URL by Stripe at the time of onboarding. Stripe verifies requests with your credentials in the config, 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.

  • Constructor Details

    • Request

      public Request()
  • Method Details

    • create

      public static Request create(Map<String,Object> params) throws StripeException
      Creates a ForwardingRequest object.
      Throws:
      StripeException
    • create

      public static Request create(Map<String,Object> params, RequestOptions options) throws StripeException
      Creates a ForwardingRequest object.
      Throws:
      StripeException
    • create

      public static Request create(RequestCreateParams params) throws StripeException
      Creates a ForwardingRequest object.
      Throws:
      StripeException
    • create

      public static Request create(RequestCreateParams params, RequestOptions options) throws StripeException
      Creates a ForwardingRequest object.
      Throws:
      StripeException
    • list

      public static RequestCollection list(Map<String,Object> params) throws StripeException
      Lists all ForwardingRequest objects.
      Throws:
      StripeException
    • list

      public static RequestCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      Lists all ForwardingRequest objects.
      Throws:
      StripeException
    • list

      public static RequestCollection list(RequestListParams params) throws StripeException
      Lists all ForwardingRequest objects.
      Throws:
      StripeException
    • list

      public static RequestCollection list(RequestListParams params, RequestOptions options) throws StripeException
      Lists all ForwardingRequest objects.
      Throws:
      StripeException
    • retrieve

      public static Request retrieve(String id) throws StripeException
      Retrieves a ForwardingRequest object.
      Throws:
      StripeException
    • retrieve

      public static Request retrieve(String id, RequestOptions options) throws StripeException
      Retrieves a ForwardingRequest object.
      Throws:
      StripeException
    • retrieve

      public static Request retrieve(String id, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves a ForwardingRequest object.
      Throws:
      StripeException
    • retrieve

      public static Request retrieve(String id, RequestRetrieveParams params, RequestOptions options) throws StripeException
      Retrieves a ForwardingRequest object.
      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      The header value.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getConfig

      public String getConfig()
      The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs.
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to forwarding.request.

    • getPaymentMethod

      public String getPaymentMethod()
      The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
    • getReplacements

      public List<String> getReplacements()
      The field kinds to be replaced in the forwarded request.
    • getRequestContext

      public Request.RequestContext getRequestContext()
      Context about the request from Stripe's servers to the destination endpoint.
    • getRequestDetails

      public Request.RequestDetails getRequestDetails()
      The request that was sent to the destination endpoint. We redact any sensitive fields.
    • getResponseDetails

      public Request.ResponseDetails getResponseDetails()
      The response that the destination endpoint returned to us. We redact any sensitive fields.
    • getUrl

      public String getUrl()
      The destination URL for the forwarded request. Must be supported by the config.
    • setConfig

      public void setConfig(String config)
      The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs.
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to forwarding.request.

    • setPaymentMethod

      public void setPaymentMethod(String paymentMethod)
      The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
    • setReplacements

      public void setReplacements(List<String> replacements)
      The field kinds to be replaced in the forwarded request.
    • setRequestContext

      public void setRequestContext(Request.RequestContext requestContext)
      Context about the request from Stripe's servers to the destination endpoint.
    • setRequestDetails

      public void setRequestDetails(Request.RequestDetails requestDetails)
      The request that was sent to the destination endpoint. We redact any sensitive fields.
    • setResponseDetails

      public void setResponseDetails(Request.ResponseDetails responseDetails)
      The response that the destination endpoint returned to us. We redact any sensitive fields.
    • setUrl

      public void setUrl(String url)
      The destination URL for the forwarded request. Must be supported by the config.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId