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
request_
signature Calculate and replace the request signature field
- requestobjectRequired
The request body and headers to be sent to the destination endpoint.
- request.
bodystring The body payload to send to the destination endpoint.
- request.
headersarray of objects The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included.
- request.
headers. namestringRequired The header name.
- request.
headers. valuestringRequired The header value.
- 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" ]}