curl --request POST \
--url https://sandbox.hyperswitch.io/v2/recovery \
--header 'Authorization: api-key=<API_KEY>' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_abcdefghijklmnop' \
--data '{
"amount_details": {
"currency": "USD",
"order_amount": 6540
},
"billing": {
"address": {
"city": "San Francisco",
"country": "US",
"first_name": "John",
"last_name": "Doe",
"line1": "1467 Harrison Street",
"state": "California",
"zip": "94122"
},
"email": "john@example.com"
},
"billing_merchant_connector_id": "mca_billing_1234567890",
"billing_started_at": "2022-09-10T10:11:12Z",
"connector_customer_id": "cust_12345",
"connector_transaction_id": "993672945374576J",
"error": {
"code": "card_declined",
"message": "The card was declined.",
"network_advice_code": "01",
"network_decline_code": "51",
"network_error_message": "Retry after some time",
"reason": "Insufficient funds"
},
"merchant_reference_id": "invoice_mbabizu24mvu3mela5njyh",
"payment_merchant_connector_id": "mca_payment_1234567890",
"payment_method_data": {
"payment_method_metadata": {
"card_exp_month": "01",
"card_exp_year": "2026",
"card_extended_bin": "42424242",
"card_isin": "424242",
"card_network": "Visa",
"card_type": "credit",
"last4": "4242"
},
"primary_processor_payment_method_token": "token_1234"
},
"payment_method_sub_type": "credit",
"payment_method_type": "card",
"transaction_created_at": "2022-09-10T10:11:12Z",
"transaction_status": "failure"
}'
{
"id": "12_pay_01a3868d94a471219b5c4bc71638e2zc",
"intent_status": "failed",
"merchant_reference_id": "invoice_mbabizu24mvu3mela5njyh"
}Revenue Recovery - Create
Record a transaction made outside of Hyperswitch against an invoice.
curl --request POST \
--url https://sandbox.hyperswitch.io/v2/recovery \
--header 'Authorization: api-key=<API_KEY>' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_abcdefghijklmnop' \
--data '{
"amount_details": {
"currency": "USD",
"order_amount": 6540
},
"billing": {
"address": {
"city": "San Francisco",
"country": "US",
"first_name": "John",
"last_name": "Doe",
"line1": "1467 Harrison Street",
"state": "California",
"zip": "94122"
},
"email": "john@example.com"
},
"billing_merchant_connector_id": "mca_billing_1234567890",
"billing_started_at": "2022-09-10T10:11:12Z",
"connector_customer_id": "cust_12345",
"connector_transaction_id": "993672945374576J",
"error": {
"code": "card_declined",
"message": "The card was declined.",
"network_advice_code": "01",
"network_decline_code": "51",
"network_error_message": "Retry after some time",
"reason": "Insufficient funds"
},
"merchant_reference_id": "invoice_mbabizu24mvu3mela5njyh",
"payment_merchant_connector_id": "mca_payment_1234567890",
"payment_method_data": {
"payment_method_metadata": {
"card_exp_month": "01",
"card_exp_year": "2026",
"card_extended_bin": "42424242",
"card_isin": "424242",
"card_network": "Visa",
"card_type": "credit",
"last4": "4242"
},
"primary_processor_payment_method_token": "token_1234"
},
"payment_method_sub_type": "credit",
"payment_method_type": "card",
"transaction_created_at": "2022-09-10T10:11:12Z",
"transaction_status": "failure"
}'
{
"id": "12_pay_01a3868d94a471219b5c4bc71638e2zc",
"intent_status": "failed",
"merchant_reference_id": "invoice_mbabizu24mvu3mela5njyh"
}curl --request POST \
--url https://sandbox.hyperswitch.io/v2/recovery \
--header 'Authorization: api-key=<API_KEY>' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_abcdefghijklmnop' \
--data '{
"amount_details": {
"currency": "USD",
"order_amount": 6540
},
"billing": {
"address": {
"city": "San Francisco",
"country": "US",
"first_name": "John",
"last_name": "Doe",
"line1": "1467 Harrison Street",
"state": "California",
"zip": "94122"
},
"email": "john@example.com"
},
"billing_merchant_connector_id": "mca_billing_1234567890",
"billing_started_at": "2022-09-10T10:11:12Z",
"connector_customer_id": "cust_12345",
"connector_transaction_id": "993672945374576J",
"error": {
"code": "card_declined",
"message": "The card was declined.",
"network_advice_code": "01",
"network_decline_code": "51",
"network_error_message": "Retry after some time",
"reason": "Insufficient funds"
},
"merchant_reference_id": "invoice_mbabizu24mvu3mela5njyh",
"payment_merchant_connector_id": "mca_payment_1234567890",
"payment_method_data": {
"payment_method_metadata": {
"card_exp_month": "01",
"card_exp_year": "2026",
"card_extended_bin": "42424242",
"card_isin": "424242",
"card_network": "Visa",
"card_type": "credit",
"last4": "4242"
},
"primary_processor_payment_method_token": "token_1234"
},
"payment_method_sub_type": "credit",
"payment_method_type": "card",
"transaction_created_at": "2022-09-10T10:11:12Z",
"transaction_status": "failure"
}'
Authorizations
Headers
Body
Indicates the type of payment method. Eg: 'card', 'wallet', etc.
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 Indicates the sub type of payment method. Eg: 'google_pay' & 'apple_pay' for wallets.
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 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).
"mca_1234567890"
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).
"mca_1234567890"
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.
6540
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.
installment, unscheduled, recurring, subscription, resubmission 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.
present, absent 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.
off_session, on_session Response
The transaction is recorded (Fully Managed Recovery), or accepted to be recorded right after the answer (Schedule Only Recovery)
- Fully Managed Recovery
- Schedule Only Recovery
The answer to a reported transaction, which depends on whether the profile uses Fully Managed Recovery or Schedule Only Recovery.
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).
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 Was this page helpful?