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.
Attributes
- idstring
Unique identifier for the object.
- objectstring
String representing the object’s type. Objects of the same type share the same value.
- createdtimestamp
Time at which the object was created. Measured in seconds since the Unix epoch.
- livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - metadatanullable objectPreview feature
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.
- payment_
methodstring The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
- replacementsarray of enums
The field kinds to be replaced in the forwarded request.
Possible enum valuescard_
cvc Replace the card cvc field
card_
expiry Replace the card expiry fields like month and year
card_
number Replace the card number field
cardholder_
name Replace the cardholder name field
- request_
contextnullable object Context about the request from Stripe’s servers to the destination endpoint.
- request_
detailsnullable object The request that was sent to the destination endpoint. We redact any sensitive fields.
- response_
detailsnullable object The response that the destination endpoint returned to us. We redact any sensitive fields.
- urlnullable string
The destination URL for the forwarded request. Must be supported by the config.
{ "id": "fwdreq_123", "object": "forwarding.request", "created": 1234567890, "livemode": false, "payment_method": "pm_456", "request_details": { "body": "{\"amount\":{\"value\":1000,\"currency\":\"usd\"},\"paymentMethod\":{\"number\":\"424242******4242\",\"expiryMonth\":\"03\",\"expiryYear\":\"2030\",\"cvc\":\"***\",\"holderName\":\"First Last\"},\"reference\":\"{{REFERENCE_ID}}\"}", "headers": [ { "name": "Destination-API-Key", "value": "{{DESTINATION_API_KEY}}" }, { "name": "Destination-Idempotency-Key", "value": "{{DESTINATION_IDEMPOTENCY_KEY}}" }, { "name": "Content-Type", "value": "application/json" } ], "http_method": "POST" }, "request_context": { "destination_ip_address": "35.190.113.80", "destination_duration": 234 }, "response_details": { "body": "{\"transactionId\":\"example1234\"}", "headers": [ { "name": "Content-Type", "value": "application/json;charset=UTF-8" } ], "status": 200 }, "url": "https://endpoint-url/v1/payments", "replacements": [ "card_number", "card_expiry", "card_cvc", "cardholder_name" ]}
Creates a ForwardingRequest object.
Parameters
- payment_
methodstringRequired The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
- replacementsarray of enumsRequired
The field kinds to be replaced in the forwarded request.
Possible enum valuescard_
cvc Replace the card cvc field
card_
expiry Replace the card expiry fields like month and year
card_
number Replace the card number field
cardholder_
name Replace the cardholder name field
- requestobjectRequired
The request body and headers to be sent to the destination endpoint.
- urlstringRequired
The destination URL for the forwarded request. Must be supported by the config.
- metadataobjectPreview feature
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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
.
Returns
Returns a ForwardingRequest object.
{ "id": "fwdreq_123", "object": "forwarding.request", "created": 1234567890, "livemode": false, "payment_method": "pm_456", "request_details": { "body": "{\"amount\":{\"value\":1000,\"currency\":\"usd\"},\"paymentMethod\":{\"number\":\"424242******4242\",\"expiryMonth\":\"03\",\"expiryYear\":\"2030\",\"cvc\":\"***\",\"holderName\":\"First Last\"},\"reference\":\"{{REFERENCE_ID}}\"}", "headers": [ { "name": "Destination-API-Key", "value": "{{DESTINATION_API_KEY}}" }, { "name": "Destination-Idempotency-Key", "value": "{{DESTINATION_IDEMPOTENCY_KEY}}" }, { "name": "Content-Type", "value": "application/json" } ], "http_method": "POST" }, "request_context": { "destination_ip_address": "35.190.113.80", "destination_duration": 234 }, "response_details": { "body": "{\"transactionId\":\"example1234\"}", "headers": [ { "name": "Content-Type", "value": "application/json;charset=UTF-8" } ], "status": 200 }, "url": "https://endpoint-url/v1/payments", "replacements": [ "card_number", "card_expiry", "card_cvc", "cardholder_name" ]}
Retrieves a ForwardingRequest object.
Parameters
No parameters.
Returns
Returns a ForwardingRequest object.
{ "id": "fwdreq_123", "object": "forwarding.request", "created": 1234567890, "livemode": false, "payment_method": "pm_456", "request_details": { "body": "{\"amount\":{\"value\":1000,\"currency\":\"usd\"},\"paymentMethod\":{\"number\":\"424242******4242\",\"expiryMonth\":\"03\",\"expiryYear\":\"2030\",\"cvc\":\"***\",\"holderName\":\"First Last\"},\"reference\":\"{{REFERENCE_ID}}\"}", "headers": [ { "name": "Destination-API-Key", "value": "{{DESTINATION_API_KEY}}" }, { "name": "Destination-Idempotency-Key", "value": "{{DESTINATION_IDEMPOTENCY_KEY}}" }, { "name": "Content-Type", "value": "application/json" } ], "http_method": "POST" }, "request_context": { "destination_ip_address": "35.190.113.80", "destination_duration": 234 }, "response_details": { "body": "{\"transactionId\":\"example1234\"}", "headers": [ { "name": "Content-Type", "value": "application/json;charset=UTF-8" } ], "status": 200 }, "url": "https://endpoint-url/v1/payments", "replacements": [ "card_number", "card_expiry", "card_cvc", "cardholder_name" ]}
Lists all ForwardingRequest objects.
Parameters
- createdobject
Similar to other List endpoints, filters results based on created timestamp. You can pass gt, gte, lt, and lte timestamp values.
- ending_
beforestring A pagination cursor to fetch the previous page of the list. The value must be a ForwardingRequest ID.
- limitinteger
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
- starting_
afterstring A pagination cursor to fetch the next page of the list. The value must be a ForwardingRequest ID.
Returns
Returns a list of ForwardingRequest objects.
{ "object": "list", "url": "/v1/forwarding/requests", "has_more": false, "data": [ { "id": "fwdreq_123", "object": "forwarding.request", "created": 1234567890, "livemode": false, "payment_method": "pm_456", "request_details": { "body": "{\"amount\":{\"value\":1000,\"currency\":\"usd\"},\"paymentMethod\":{\"number\":\"424242******4242\",\"expiryMonth\":\"03\",\"expiryYear\":\"2030\",\"cvc\":\"***\",\"holderName\":\"First Last\"},\"reference\":\"{{REFERENCE_ID}}\"}", "headers": [ { "name": "Destination-API-Key", "value": "{{DESTINATION_API_KEY}}" }, { "name": "Destination-Idempotency-Key", "value": "{{DESTINATION_IDEMPOTENCY_KEY}}" }, { "name": "Content-Type", "value": "application/json" } ], "http_method": "POST" }, "request_context": { "destination_ip_address": "35.190.113.80", "destination_duration": 234 }, "response_details": { "body": "{\"transactionId\":\"example1234\"}", "headers": [ { "name": "Content-Type", "value": "application/json;charset=UTF-8" } ], "status": 200 }, "url": "https://endpoint-url/v1/payments", "replacements": [ "card_number", "card_expiry", "card_cvc", "cardholder_name" ] } ]}