https://api.knoxapi.comCreate a ForwardingRequest
POST/v1/forwarding/requests
Creates a ForwardingRequest object.
Body parameters
payment_methodstringRequiredThe PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
replacementsarray of stringsRequiredThe field kinds to be replaced in the forwarded request.
urlstringRequiredThe destination URL for the forwarded request. Must be supported by the config.
expandarray of stringsSpecifies which fields in the response should be expanded.
metadataobjectSet 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.requestobjectThe request body and headers to be sent to the destination endpoint.
Show 2 child parameters
bodystringheadersarray of objectsShow 2 child parameters
namestringRequiredvaluestringRequired
Returns
The forwarding.request object.
curl https://api.knoxapi.com/v1/forwarding/requests \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d payment_method=pm_456 \
-d "replacements[]=card_cvc" \
-d url=https://endpoint-url/v1/paymentsconst Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('POST', '/v1/forwarding/requests', {
payment_method: 'pm_456',
replacements: ['card_cvc'],
url: 'https://endpoint-url/v1/payments',
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("post", "/v1/forwarding/requests", payment_method="pm_456", replacements=["card_cvc"], url="https://endpoint-url/v1/payments")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:post, '/v1/forwarding/requests', {
payment_method: 'pm_456',
replacements: ['card_cvc'],
url: 'https://endpoint-url/v1/payments',
}){
"created": 1234567890,
"id": "fwdreq_123",
"livemode": false,
"object": "forwarding.request",
"payment_method": "pm_456",
"replacements": [],
"request_context": {
"destination_duration": 234,
"destination_ip_address": ""
},
"request_details": {
"body": "'{\"amount\":{\"value\":1000,\"currency\":\"usd\"},\"paymentMethod\":{\"cvc\": \"***\",\"expiryMonth\": \"03\",\"expiryYear\": \"2030\",\"holderName\": \"First Last\",\"number\": \"************4242\",\"type\": \"scheme\",},\"merchantAccount\":\"{{MERCHANT_ID}}\",\"reference\":\"{{REFERENCE_ID}}\"}'",
"headers": [
{
"name": "Idempotency-Key",
"value": "{{UPSTREAM_IDEMPOTENCY_KEY}}"
}
],
"http_method": "POST"
},
"response_details": {
"body": "'{\"transactionId\":\"example1234\"}'",
"headers": [
{
"name": "Content-Type",
"value": "application/json;charset=UTF-8"
},
{
"name": "Idempotency-Key",
"value": "{{UPSTREAM_IDEMPOTENCY_KEY}}"
}
],
"status": 200
},
"url": "https://endpoint-url/v1/payments"
}List all ForwardingRequests
GET/v1/forwarding/requests
Lists all ForwardingRequest objects.
Query parameters
createdobjectSimilar to other List endpoints, filters results based on created timestamp. You can pass gt, gte, lt, and lte timestamp values.
Show 4 child parameters
gtintegergteintegerltintegerlteinteger
ending_beforestringA pagination cursor to fetch the previous page of the list. The value must be a ForwardingRequest ID.
expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA pagination cursor to fetch the next page of the list. The value must be a ForwardingRequest ID.
Returns
A list of forwarding.request objects.
curl -G https://api.knoxapi.com/v1/forwarding/requests \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/forwarding/requests', {
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/forwarding/requests", limit=3)require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/forwarding/requests', {
limit: 3,
}){
"object": "list",
"url": "/v1/forwarding/requests",
"has_more": false,
"data": [
{
"created": 1234567890,
"id": "fwdreq_123",
"livemode": false,
"object": "forwarding.request",
"payment_method": "pm_456",
"replacements": [],
"request_context": {
"destination_duration": 234,
"destination_ip_address": ""
},
"request_details": {
"body": "'{\"amount\":{\"value\":1000,\"currency\":\"usd\"},\"paymentMethod\":{\"cvc\": \"***\",\"expiryMonth\": \"03\",\"expiryYear\": \"2030\",\"holderName\": \"First Last\",\"number\": \"************4242\",\"type\": \"scheme\",},\"merchantAccount\":\"{{MERCHANT_ID}}\",\"reference\":\"{{REFERENCE_ID}}\"}'",
"headers": [
{
"name": "Idempotency-Key",
"value": "{{UPSTREAM_IDEMPOTENCY_KEY}}"
}
],
"http_method": "POST"
},
"response_details": {
"body": "'{\"transactionId\":\"example1234\"}'",
"headers": [
{
"name": "Content-Type",
"value": "application/json;charset=UTF-8"
},
{
"name": "Idempotency-Key",
"value": "{{UPSTREAM_IDEMPOTENCY_KEY}}"
}
],
"status": 200
},
"url": "https://endpoint-url/v1/payments"
}
]
}Retrieve a ForwardingRequest
GET/v1/forwarding/requests/{id}
Retrieves a ForwardingRequest object.
Path parameters
idstringRequired
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The forwarding.request object.
curl https://api.knoxapi.com/v1/forwarding/requests/fwdreq_123 \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/forwarding/requests/fwdreq_123');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/forwarding/requests/fwdreq_123")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/forwarding/requests/fwdreq_123'){
"created": 1234567890,
"id": "fwdreq_123",
"livemode": false,
"object": "forwarding.request",
"payment_method": "pm_456",
"replacements": [],
"request_context": {
"destination_duration": 234,
"destination_ip_address": ""
},
"request_details": {
"body": "'{\"amount\":{\"value\":1000,\"currency\":\"usd\"},\"paymentMethod\":{\"cvc\": \"***\",\"expiryMonth\": \"03\",\"expiryYear\": \"2030\",\"holderName\": \"First Last\",\"number\": \"************4242\",\"type\": \"scheme\",},\"merchantAccount\":\"{{MERCHANT_ID}}\",\"reference\":\"{{REFERENCE_ID}}\"}'",
"headers": [
{
"name": "Idempotency-Key",
"value": "{{UPSTREAM_IDEMPOTENCY_KEY}}"
}
],
"http_method": "POST"
},
"response_details": {
"body": "'{\"transactionId\":\"example1234\"}'",
"headers": [
{
"name": "Content-Type",
"value": "application/json;charset=UTF-8"
},
{
"name": "Idempotency-Key",
"value": "{{UPSTREAM_IDEMPOTENCY_KEY}}"
}
],
"status": 200
},
"url": "https://endpoint-url/v1/payments"
}Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.