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-260824093040975684502245180",
            "payUrl": "https://pay-widget.transfi.com//pay?paytoken=c373ca40-ab79-4ab8-bd1d-2c2ca29dfd1a",
            "feeData": {
                "depositAmount": 10,
                "withdrawAmount": 9.502319,
                "exchangeRate": 1.0002440595505304,
                "totalFee": 0.5
            },
            "quoteHistory": {
                "refreshCount": 0,
                "orderCreationQuote": {
                    "isRefreshed": false,
                    "usedQuotes": {
                        "sourceCurrency": "USD",
                        "sourceAmount": 10,
                        "sourceAmountInUsd": 10,
                        "sourceCurrencyType": "fiat",
                        "destinationCurrency": "USDT",
                        "destinationAmount": 9.502319,
                        "destinationAmountInUsd": 9.5,
                        "destinationCurrencyType": "crypto",
                        "conversionRate": 1.0002440595505304,
                        "minLimit": 6,
                        "maxLimit": 100000,
                        "direction": "forward",
                        "processingFee": 0.5,
                        "processingFeeRate": 0.05,
                        "customerFee": 0,
                        "customerFeeRate": 0,
                        "rrFeeRate": 0,
                        "discount": 0,
                        "discountRate": 0,
                        "additionalFee": 0,
                        "fixedFee": {
                            "totalFixedFees": 0,
                            "totalFixedTfFees": 0,
                            "totalFixedCxFees": 0,
                            "fixedFeesCurrency": "USD",
                            "fixedFeeDetails": {
                                "baseFeeFixedRate": 0,
                                "tfFeeFixedRate": 0,
                                "cxFeeFixedRate": 0,
                                "currency": ""
                            }
                        },
                        "totalFee": 0.5,
                        "feeMode": "percentage",
                        "rateType": "live",
                        "quoteId": "QUOTE-1c459c8e-6d66-4982-aade-a3626f12ff49"
                    }
                }
            }
        },
        "traceId": "18c56011-810a-4d55-9f33-23dc590fc6ba"
    }

  • 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": {
                "street": "Unter den Linden 10",
                "city": "Berlin",
                "postalCode": "10117"
            }
        },
        "settlementAccountId": "SA-260824082045645679959041055",
        "destination": {
            "currency": "IDR",
            "holdingCurrency": "USDC"
        }, 		
       "customization": {
          "locale": "id"
       },
    }'
    {
        "status": "success",
        "data": {
            "flow": "FIAT_PAYIN",
            "orderId": "OR-260824115036993393430582943",
            "amount": 1000,
            "payUrl": "https://pay-widget.transfi.com//pay?paytoken=f01ac353-6f92-449e-872b-292df5a5ab29",
            "paymentsData": {
                "accountDetails": {
                    "name": "NEOMONEY INC.",
                    "iban": "LT403400015000121416",
                    "bic": "GUPULT22",
                    "address": "24 Jono Basanaviciaus Str, Vilnius, Lithuania, 03224",
                    "reference": "TXJU0P6259A5TJBH2"
                },
                "type": "sepaBankTransfer"
            },
            "feeData": {
                "depositAmount": 1000,
                "withdrawAmount": 18649213.607561298,
                "holdingRatesData": {
                    "depositAmount": 1000,
                    "holdingAmount": 1108.506445,
                    "exchangeRate": 1.1668488895682543,
                    "totalFee": 50
                },
                "settlementRatesData": {
                    "holdingAmount": 1108.506445,
                    "withdrawAmount": 18649213.607561298,
                    "exchangeRate": 0.00005646785677478352,
                    "totalFee": 981537.5582927
                }
            },
            "quoteHistory": {
                "refreshCount": 0,
                "orderCreationQuote": {
                    "isRefreshed": false,
                    "usedQuotes": {
                        "sourceCurrency": "EUR",
                        "sourceAmount": 1000,
                        "sourceAmountInUsd": 1166.59,
                        "sourceCurrencyType": "fiat",
                        "destinationCurrency": "USDC",
                        "destinationAmount": 1108.506445,
                        "destinationAmountInUsd": 1108.26,
                        "destinationCurrencyType": "crypto",
                        "conversionRate": 1.1668488895682543,
                        "minLimit": 23,
                        "maxLimit": 85720.27,
                        "direction": "forward",
                        "processingFee": 50,
                        "processingFeeRate": 0.05,
                        "customerFee": 0,
                        "customerFeeRate": 0,
                        "rrFeeRate": 0,
                        "discount": 0,
                        "discountRate": 0,
                        "additionalFee": 0,
                        "fixedFee": {
                            "totalFixedFees": 0,
                            "totalFixedTfFees": 0,
                            "totalFixedCxFees": 0,
                            "fixedFeesCurrency": "EUR",
                            "fixedFeeDetails": {
                                "baseFeeFixedRate": 0,
                                "tfFeeFixedRate": 0,
                                "cxFeeFixedRate": 0,
                                "currency": ""
                            }
                        },
                        "totalFee": 50,
                        "feeMode": "percentage",
                        "rateType": "live",
                        "quoteId": "QUOTE-3006f840-def8-41ac-a345-9bd6f0170ce0"
                    }
                }
            },
            "settlements": {
                "settlementAccountId": "SA-26082408201575479959041055",
                "settlementType": "batch"
            }
        },
        "traceId": "e8bfe2c7-5dd1-46e3-81dc-0bb930fb0887"
    }

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-260824115529378541795876536",
            "payUrl": "https://pay-widget.transfi.com//crypto-pay?paytoken=20b8a11f-43c5-44c0-87f4-48d96b298f2d",
            "amount": 20,
            "cryptoCurrency": "SOL",
            "cryptoNetwork": "solana",
            "walletAddress": "BfxbAgniTmY9uqzWXSdSZ73QFseRyhbUSsZJXwK2QuEX",
            "feeData": {
                "depositAmount": 20,
                "withdrawAmount": 32198249,
                "exchangeRate": 5.900942082607622e-7,
                "totalFee": 1694644.661815
            },
            "quoteHistory": {
                "refreshCount": 0,
                "orderCreationQuote": {
                    "isRefreshed": false,
                    "usedQuotes": {
                        "sourceCurrency": "SOL",
                        "sourceAmount": 20,
                        "sourceAmountInUsd": 1913.7,
                        "sourceCurrencyType": "crypto",
                        "destinationCurrency": "IDR",
                        "destinationAmount": 32198249,
                        "destinationAmountInUsd": 1818.02,
                        "destinationCurrencyType": "fiat",
                        "conversionRate": 5.900942082607622e-7,
                        "processingFee": 1694644.66,
                        "processingFeeRate": 0.05,
                        "customerFee": 0,
                        "customerFeeRate": 0,
                        "discount": 0,
                        "discountRate": 0,
                        "additionalFee": 0,
                        "additionalFeeRate": 0,
                        "fixedFee": {
                            "totalFixedFees": 0,
                            "totalFixedTfFees": 0,
                            "totalFixedCxFees": 0,
                            "fixedFeesCurrency": "",
                            "fixedFeeDetails": {
                                "baseFeeFixedRate": 0,
                                "tfFeeFixedRate": 0,
                                "cxFeeFixedRate": 0,
                                "currency": ""
                            }
                        },
                        "totalFee": 1694644.661815,
                        "feeMode": "percentage",
                        "rateType": "live",
                        "quoteId": "QUOTE-21ede440-dd95-4b41-acab-ecd474d1de8d",
                        "networkFee": 0
                    }
                }
            }
        },
        "traceId": "65d93663-8fea-46a3-91e7-dade7d3d38ab"
    }
  • 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"
        },
        "settlementAccountId": "SA-260824082018649179959041055",
        "destination": {
            "currency": "IDR",
            "holdingCurrency": "USDC"
        },
         "customization": {
            "locale": "id"
         },
    }'
    {
        "status": "success",
        "data": {
            "flow": "CRYPTO_PAYIN",
            "orderId": "OR-260824115330700130524161726",
            "payUrl": "https://pay-widget.transfi.com//crypto-pay?paytoken=a406e2e8-3833-46a0-a4ff-b234a4f1a256",
            "amount": 20,
            "cryptoCurrency": "SOL",
            "cryptoNetwork": "solana",
            "walletAddress": "BfxbAgniTmY9uqzWXSdSZ73QFseRyhbUSsZJXwK2QuEX",
            "feeData": {
                "depositAmount": 20,
                "withdrawAmount": 0,
                "holdingRatesData": {
                    "depositAmount": 20,
                    "holdingAmount": 1818.8358,
                    "exchangeRate": 95.7282,
                    "totalFee": 1
                },
                "settlementRatesData": {
                    "holdingAmount": 1818.8358,
                    "withdrawAmount": 30599403.653401155,
                    "exchangeRate": 0.00005646822499888933,
                    "totalFee": 1610494.9291263768
                }
            },
            "quoteHistory": {
                "refreshCount": 0,
                "orderCreationQuote": {
                    "isRefreshed": false,
                    "usedQuotes": {
                        "sourceCurrency": "SOL",
                        "sourceAmount": 20,
                        "sourceAmountInUsd": 1914.27,
                        "sourceCurrencyType": "crypto",
                        "destinationCurrency": "USDC",
                        "destinationAmount": 1818.8358,
                        "destinationAmountInUsd": 1818.55,
                        "destinationCurrencyType": "crypto",
                        "conversionRate": 95.7282,
                        "processingFee": 1,
                        "processingFeeRate": 0.05,
                        "customerFee": 0,
                        "customerFeeRate": 0,
                        "discount": 0,
                        "discountRate": 0,
                        "additionalFee": 0,
                        "additionalFeeRate": 0,
                        "fixedFee": {},
                        "totalFee": 1,
                        "feeMode": "percentage",
                        "rateType": "live",
                        "quoteId": "QUOTE-831a8165-b162-4001-bde0-26e17fd331c1",
                        "networkFee": 0
                    }
                }
            },
            "settlements": {
                "settlementAccountId": "SA-260824082018649179959041055",
                "settlementType": "batch"
            }
        },
        "traceId": "236b4005-a9fc-4d57-8bb4-6204c062f848"
    }

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"
    }
}
  1. 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)
  2. 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).

Did this page help you?