Creating Payin Transfer
Creating a Fiat-Payin Transfer (API link):
- Minimal payload:
curl --location 'https://sandbox-api.transfi.com/v3/orders' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic ==' \ --header 'mid: SAH1N3_NA_NA' \ --data '{ "userId": "UX-2123123123123", "orderType": "payin", "purposeCode": "company_expenses", "source": { "currency": "USD", "amount": "10", "paymentType": "bank_transfer" }, "destination": { "currency": "USDT" } }'{ "status": "success", "data": { "flow": "FIAT_PAYIN", "orderId": "OR-2509291454262384294", "payUrl": "https://sandbox-pay-widget.transfi.com/pay?paytoken=6c237e7e-4a55-4503-81b0-41b348d54a6d" }, }
- Full payload
curl --location 'https://sandbox-api.transfi.com/v3/orders' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic ==' \ --header 'mid: SAH1N3_NA_NA' \ --data '{ "userId": "UX-2123123123123", "orderType": "payin", "purposeCode": "company_expenses", "purposeCodeReason": "Personal payment", "successRedirectUrl": "https://yourapp.com/success", "failureRedirectUrl": "https://yourapp.com/failure", "sourceUrl": "https://yourapp.com/source", "invoiceId": "IN-2509301349208479789", "headlessMode": true, "partnerId": "1234567890", "customerMetaData": { "customerId": "1234567890", "customerName": "John Doe", "customerEmail": "[email protected]" }, "deviceDetails": { "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)", "ipInfo": { "ip": "123.123.123.123", "countryCode3": "IND" } }, "source": { "currency": "USD", "amount": "10", "paymentType": "bank_transfer", "paymentCode": "swift", "additionalPaymentDetails": { "phoneCode": "+91", "phone": "12341234123", "street": "abcd", "city": "abcd", "state": "abcd", "documentType": "passport", "documentNumber": "abcde", "dob": "01-01-2000" } }, "destination": { "currency": "USDT" } }'{ "status": "success", "data": { "flow": "FIAT_PAYIN", "orderId": "OR-2510031348048279781", "amount": 10, "payUrl": "https://sandbox-pay-widget.transfi.com/pay?paytoken=123123-123-123-123-123123", "paymentsData": { "accountDetails": { "beneficiaryName": "John d", "beneficiaryBankName": "JP Morgan Chase", "bankAddress": "383 MADISON AVENUE, NEW YORK, NY, 10179", "beneficiaryBankAccountNumber": "1234123123123", "beneficiaryAccountType": "checking", "swiftCode": "ABCDABCD", "beneficiaryAddress": "abc,abc,asd,IN" }, "type": "bankTransfer", "extra": { "accountId": "eab6881e-123-123-123-123123" } }, } }
In the successful response from the api-call you will get the paymentUrl, to which you need to redirect your user to complete the payment. After redirecting, there's nothing to do but wait!
Creating a Crypto-Payin Transfer (API link):
- Minimal payload:
curl --location 'https://sandbox-api.transfi.com/v3/orders' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic ==' \ --header 'mid: SAH1N3_NA_NA' \ --data '{ "userId": "UX-2123123123123", "orderType": "payin", "purposeCode": "company_expenses", "source": { "currency": "USDTPOLYGON", "amount": "100" }, "destination": { "currency": "EUR" } }'{ "status": "success", "data": { "flow": "CRYPTO_PAYIN", "orderId": "OR-2509291506567158826", "amount": 100, "walletAddress": "dummy_0x63d3CEAE8A65486a1caAb8B42fwrwwr" } } - Full payload
curl --location 'https://sandbox-api.transfi.com/v3/orders' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic ==' \ --header 'mid: SAH1N3_NA_NA' \ --data '{ "userId": "UX-2123123123123", "orderType": "payin", "purposeCode": "company_expenses", "purposeCodeReason": "Personal payment", "successRedirectUrl": "https://yourapp.com/success", "failureRedirectUrl": "https://yourapp.com/failure", "sourceUrl": "https://yourapp.com/source" "partnerId": "1234567890", "invoiceId": "IN-2509301349208479789", "customerMetaData": { "customerId": "1234567890", "customerName": "John Doe", "customerEmail": "[email protected]" }, "deviceDetails": { "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)", "ipInfo": { "ip": "123.123.123.123", "countryCode3": "IND" } }, "source": { "currency": "USDTPOLYGON", "walletAddress": "0x000000000000000000000000000", "amount": "100" }, "destination": { "currency": "EUR" } }'{ "status": "success", "data": { "flow": "CRYPTO_PAYIN", "orderId": "OR-2509291506567158826", "amount": 100, "walletAddress": "dummy_0x63d3CEAE8A65486a1caAb8B42fwrwwr" } }
Note: Amount to be transferred can be passed in either source or destination.
Examples:
{
"source": {
"currency": "EUR",
"amount": "100"
},
"destination": {
"currency": "USDC"
}
}{
"source": {
"currency": "EUR"
},
"destination": {
"currency": "USDC",
"amount": "100"
}
}- Amount is sent in source object: In this case, user needs to do payin of 100 EUR. Amount of USDC that will be updated in the balance will be calculated (~105 USDC). (This is usually preferred)
- Amount is sent in destination object: In this case, 100 USDC will be added to the balance and amount of EUR that user needs to send will be calculated (~94.5 EUR).
Updated 5 days ago