Skip to main content
POST
/
v1
/
proxy
Proxy
curl --request POST \
  --url https://sandbox.hyperswitch.io/v1/proxy \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'X-Profile-Id: <x-profile-id>' \
  --data '
{
  "destination_url": "https://api.example.com/payments",
  "headers": {
    "Authorization": "Bearer sk_test_example",
    "Content-Type": "application/json"
  },
  "method": "POST",
  "request_body": {
    "amount": 6540,
    "capture": true,
    "currency": "USD",
    "reference": "ORD-5023-4E89",
    "source": {
      "billing_address": {
        "address_line1": "123 High St.",
        "city": "London",
        "country": "GB"
      },
      "expiry_month": "{{$card_exp_month}}",
      "expiry_year": "{{$card_exp_year}}",
      "number": "{{$card_number}}",
      "type": "card"
    }
  },
  "token": "pm_0196ea5a42a67583863d5b1253d62931",
  "token_type": "PaymentMethodId"
}
'
{
  "response": "<unknown>",
  "status_code": 1,
  "response_headers": {}
}

Authorizations

Authorization
string
header
required

Format: api-key=<api_key>

Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.

Headers

X-Profile-Id
string
required

Profile ID for authentication

Body

application/json
request_body
any
required

The request body that needs to be forwarded

destination_url
string
required

The destination URL where the request needs to be forwarded

Example:

"https://api.example.com/endpoint"

headers
object
required

The headers that need to be forwarded

method
enum<string>
required
Available options:
GET,
POST,
PUT,
DELETE,
PATCH
token
string
required

The vault token that is used to fetch sensitive data from the vault

token_type
enum<string>
required
Available options:
tokenization_id,
payment_method_id,
volatile_payment_method_id

Response

Proxy request

response
any
required

The response received from the destination

status_code
integer<int32>
required

The status code of the response

Required range: x >= 0
response_headers
object
required

The headers of the response