POST
/
v2
/
payments
/
create-intent
curl --request POST \
  --url https://sandbox.hyperswitch.io/v2/payments/create-intent \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '{
  "amount_details": {
    "currency": "USD",
    "order_amount": 6540
  }
}'
{
  "id": "<string>",
  "status": "succeeded",
  "amount_details": {
    "order_amount": 6540,
    "currency": "AED",
    "shipping_cost": 123,
    "order_tax_amount": 123,
    "external_tax_calculation": "skip",
    "surcharge_calculation": "skip",
    "surcharge_amount": 123,
    "tax_on_surcharge": 123
  },
  "client_secret": "cs_0195b34da95d75239c6a4bf514458896",
  "profile_id": "<string>",
  "merchant_reference_id": "pay_mbabizu24mvu3mela5njyhpit4",
  "routing_algorithm_id": "<string>",
  "capture_method": "automatic",
  "authentication_type": "three_ds",
  "billing": {
    "address": {
      "city": "New York",
      "country": "AF",
      "line1": "123, King Street",
      "line2": "Powelson Avenue",
      "line3": "Bridgewater",
      "zip": "08807",
      "state": "New York",
      "first_name": "John",
      "last_name": "Doe"
    },
    "phone": {
      "number": "9123456789",
      "country_code": "+1"
    },
    "email": "<string>"
  },
  "shipping": {
    "address": {
      "city": "New York",
      "country": "AF",
      "line1": "123, King Street",
      "line2": "Powelson Avenue",
      "line3": "Bridgewater",
      "zip": "08807",
      "state": "New York",
      "first_name": "John",
      "last_name": "Doe"
    },
    "phone": {
      "number": "9123456789",
      "country_code": "+1"
    },
    "email": "<string>"
  },
  "customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
  "customer_present": "present",
  "description": "It's my first payment request",
  "return_url": "https://hyperswitch.io",
  "setup_future_usage": "off_session",
  "apply_mit_exemption": "Apply",
  "statement_descriptor": "Hyperswitch Router",
  "order_details": "[{\n        \"product_name\": \"Apple iPhone 16\",\n        \"quantity\": 1,\n        \"amount\" : 69000\n        \"product_img_link\" : \"https://dummy-img-link.com\"\n    }]",
  "allowed_payment_method_types": [
    "ach"
  ],
  "metadata": {},
  "connector_metadata": {
    "apple_pay": {
      "session_token_data": {
        "payment_processing_certificate": "<string>",
        "payment_processing_certificate_key": "<string>",
        "payment_processing_details_at": "Hyperswitch",
        "certificate": "<string>",
        "certificate_keys": "<string>",
        "merchant_identifier": "<string>",
        "display_name": "<string>",
        "initiative": "web",
        "initiative_context": "<string>",
        "merchant_business_country": "AF"
      }
    },
    "airwallex": {
      "payload": "<string>"
    },
    "noon": {
      "order_category": "<string>"
    },
    "braintree": {
      "merchant_account_id": "<string>",
      "merchant_config_currency": "<string>"
    },
    "adyen": {
      "testing": {
        "holder_name": "<string>"
      }
    }
  },
  "feature_metadata": {
    "redirect_response": {
      "param": "<string>",
      "json_payload": {}
    },
    "search_tags": [
      "<string>"
    ],
    "apple_pay_recurring_details": {
      "payment_description": "<string>",
      "regular_billing": {
        "label": "<string>",
        "recurring_payment_start_date": "2023-09-10T23:59:59Z",
        "recurring_payment_end_date": "2023-09-10T23:59:59Z",
        "recurring_payment_interval_unit": "year",
        "recurring_payment_interval_count": 123
      },
      "billing_agreement": "<string>",
      "management_url": "https://hyperswitch.io"
    },
    "payment_revenue_recovery_metadata": {
      "total_retry_count": "1",
      "payment_connector_transmission": "ConnectorCallUnsuccessful",
      "billing_connector_id": "mca_1234567890",
      "active_attempt_payment_connector_id": "mca_1234567890",
      "billing_connector_payment_details": {
        "payment_processor_token": "<string>",
        "connector_customer_id": "<string>"
      },
      "payment_method_type": "card",
      "payment_method_subtype": "ach",
      "connector": "adyenplatform",
      "invoice_next_billing_time": "2023-11-07T05:31:56Z"
    }
  },
  "payment_link_enabled": "Enable",
  "payment_link_config": {
    "theme": "#4E6ADD",
    "logo": "https://i.pinimg.com/736x/4d/83/5c/4d835ca8aafbbb15f84d07d926fda473.jpg",
    "seller_name": "hyperswitch",
    "sdk_layout": "accordion",
    "display_sdk_only": true,
    "enabled_saved_payment_method": true,
    "hide_card_nickname_field": true,
    "show_card_form_by_default": true,
    "transaction_details": [
      {
        "key": "Policy-Number",
        "value": "297472368473924",
        "ui_configuration": {
          "position": 5,
          "is_key_bold": true,
          "is_value_bold": true
        }
      }
    ],
    "background_image": {
      "url": "https://hyperswitch.io/favicon.ico",
      "position": "left",
      "size": {
        "Variants": "cover"
      }
    },
    "details_layout": "layout1",
    "payment_button_text": "<string>",
    "custom_message_for_card_terms": "<string>",
    "payment_button_colour": "<string>",
    "skip_status_screen": true,
    "payment_button_text_colour": "<string>",
    "background_colour": "<string>",
    "sdk_ui_rules": {},
    "payment_link_ui_rules": {},
    "enable_button_only_on_form_ready": true,
    "payment_form_header_text": "<string>",
    "payment_form_label_type": "above",
    "show_card_terms": "always",
    "is_setup_mandate_flow": true,
    "color_icon_card_cvc_error": "<string>"
  },
  "request_incremental_authorization": "true",
  "expires_on": "2023-11-07T05:31:56Z",
  "frm_metadata": {},
  "request_external_three_ds_authentication": "Enable"
}

Authorizations

api-key
string
header
required

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.

Body

application/json

Response

200
application/json

Payment created

The response is of type object.