Skip to main content
POST

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

Unique identifier of the business profile under which the invoice is processed. Any billing and payment merchant connector accounts in the request must belong to this profile.

Body

application/json
amount_details
object
required
merchant_reference_id
string
required

Unique identifier of the invoice in the merchant's billing system against which the transaction is being recorded.

Required string length: 30
Example:

"invoice_mbabizu24mvu3mela5njyh"

transaction_status
enum<string>
required

Status of the transaction reported.

Available options:
charged,
failure,
partial_charged
payment_method_type
enum<string>
required

Indicates the type of payment method. Eg: 'card', 'wallet', etc.

Available options:
card,
card_redirect,
pay_later,
wallet,
bank_redirect,
bank_transfer,
crypto,
bank_debit,
reward,
real_time_payment,
upi,
voucher,
gift_card,
open_banking,
mobile_payment,
network_token
payment_method_sub_type
enum<string>
required

Indicates the sub type of payment method. Eg: 'google_pay' & 'apple_pay' for wallets.

Available options:
ach,
affirm,
afterpay_clearpay,
alfamart,
ali_pay,
ali_pay_hk,
alma,
amazon_pay,
paysera,
apple_pay,
atome,
bacs,
bancontact_card,
becs,
benefit,
bizum,
blik,
bluecode,
boleto,
bca_bank_transfer,
bni_va,
breadpay,
bri_va,
bhn_card_network,
card_redirect,
cimb_va,
classic,
credit,
crypto_currency,
cashapp,
dana,
danamon_va,
debit,
duit_now,
efecty,
eft,
eft_debit_order,
eps,
flexiti,
fps,
evoucher,
giropay,
givex,
google_pay,
go_pay,
gcash,
ideal,
interac,
indomaret,
klarna,
kakao_pay,
local_bank_redirect,
mandiri_va,
knet,
mb_way,
mobile_pay,
momo,
momo_atm,
multibanco,
neteller,
online_banking_thailand,
online_banking_czech_republic,
online_banking_finland,
online_banking_fpx,
online_banking_poland,
online_banking_slovakia,
oxxo,
pago_efectivo,
permata_bank_transfer,
open_banking_uk,
pay_bright,
payjustnow,
paypal,
paze,
pix,
pix_key,
pix_emv,
pix_qr,
pix_automatico_qr,
pix_automatico_push,
pay_safe_card,
przelewy24,
prompt_pay,
pse,
qris,
red_compra,
red_pagos,
samsung_pay,
sepa,
sepa_bank_transfer,
sepa_guarenteed_debit,
skrill,
sofort,
swish,
touch_n_go,
trustly,
twint,
upi_collect,
upi_intent,
upi_qr,
vipps,
viet_qr,
venmo,
walley,
wero,
we_chat_pay,
seven_eleven,
lawson,
mini_stop,
family_mart,
seicomart,
pay_easy,
local_bank_transfer,
mifinity,
open_banking_pis,
direct_carrier_billing,
instant_bank_transfer,
instant_bank_transfer_finland,
instant_bank_transfer_poland,
revolut_pay,
indonesian_bank_transfer,
open_banking,
network_token,
payshap,
payshap_proxy,
ted
transaction_created_at
string<date-time>
required

The time at which the transaction was created at the payment connector.

Example:

"2022-09-10T10:11:12Z"

connector_customer_id
string
required

Unique identifier of the customer at the payment connector (connector customer id), with which the payment method token used for the transaction is associated.

Example:

"cust_12345"

billing_started_at
string<date-time>
required

Invoice billing started at billing connector's end.

Example:

"2022-09-10T10:11:12Z"

connector_transaction_id
string
required

Unique identifier of the transaction at the payment connector (connector transaction id). It is used to identify the transaction among the attempts recorded for the invoice, and together with merchant_reference_id it has to be unique.

Example:

"993672945374576J"

error
object | null

Error details for the payment

billing_merchant_connector_id
string | null

Unique identifier assigned by Hyperswitch for the custom billing connector account. The account must belong to the profile passed in the X-Profile-Id header. Required under Fully Managed Recovery (revenue_recovery_trigger_model is internal_triggers), and ignored under Schedule Only Recovery (external_triggers).

Example:

"mca_1234567890"

payment_merchant_connector_id
string | null

Unique identifier assigned by Hyperswitch for the payment connector account, such as Stripe, on which the transaction was processed. The account must belong to the profile passed in the X-Profile-Id header. Required under Fully Managed Recovery (revenue_recovery_trigger_model is internal_triggers), and ignored under Schedule Only Recovery (external_triggers).

Example:

"mca_1234567890"

merchant_reference_billing_connector_id
string | null

The merchant's own identifier for the billing connector account of the invoice. Accepted, and not used yet.

Example:

"billing_account_main"

merchant_reference_payment_connector_id
string | null

The merchant's own identifier for the payment connector account on which the transaction was processed. Accepted, and not used yet.

Example:

"payment_account_us"

connector
enum<string> | null

Payment processor on which the reported transaction was made. Any other value is refused, as the standardised error code of a transaction is looked up by its processor.

Available options:
adyen,
stripe,
paypal,
shift4,
dlocal,
worldpay,
cybersource,
razorpay
amount_captured
integer<int64> | null

Amount captured by the transaction, in the lowest denomination of the currency. It is required when transaction_status is partial_charged, where it must be greater than zero and less than the order amount. For charged it may be omitted, and if sent it must equal the order amount. It must not be sent for a failure.

Example:

6540

mit_category
enum<string> | null

Specifies the category of a Merchant Initiated Transaction (MIT). In the case of MIT, mit_category tells what kind of MIT is being processed. In the case of CIT, it tells the future intended MIT type.

Available options:
installment,
unscheduled,
recurring,
subscription,
resubmission
customer_present
enum<string> | null
default:absent

Set to present to indicate that the customer is in your checkout flow during this payment, and therefore is able to authenticate. This parameter should be absent when merchant's doing merchant initiated payments and customer is not present while doing the payment.

Available options:
present,
absent
setup_future_usage
enum<string> | null
default:off_session

Specifies how the payment method can be used for future payments.

  • off_session: The payment method can be used for future payments when the customer is not present.
  • on_session: The payment method is intended for use only when the customer is present during checkout.

If omitted, defaults to on_session.

Available options:
off_session,
on_session
billing
object | null
customer_details
object | null

Passing this object creates a new customer or attaches an existing customer to the payment

payment_method_data
object | null
enable_partial_authorization
boolean | null
default:false

Allow partial authorization for this payment

metadata
object | null

You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.

Response

The transaction is recorded (Fully Managed Recovery), or accepted to be recorded right after the answer (Schedule Only Recovery)

The answer to a reported transaction, which depends on whether the profile uses Fully Managed Recovery or Schedule Only Recovery.

id
string
required

Unique identifier of the invoice in Hyperswitch against which the transaction has been recorded.

Required string length: 30
Example:

"pay_mbabizu24mvu3mela5njyhpit4"

intent_status
enum<string>
default:requires_confirmation
required

Represents the overall status of a payment intent. The status transitions through various states depending on the payment method, confirmation, capture method, and any subsequent actions (like customer authentication or manual capture).

Available options:
succeeded,
failed,
cancelled,
cancelled_post_capture,
processing,
requires_customer_action,
requires_merchant_action,
requires_payment_method,
requires_confirmation,
requires_capture,
partially_captured,
partially_captured_and_capturable,
partially_authorized_and_requires_capture,
partially_captured_and_processing,
conflicted,
expired,
review
merchant_reference_id
string | null

Unique identifier of the invoice in the merchant's billing system against which the transaction is being recorded.

Required string length: 30
Example:

"invoice_mbabizu24mvu3mela5njyh"