Creating an Offramp Transfer

Creating offramp order (API link):


Same party Offramp

In this flow, userId has to be passed in root of payload. User needs to send the crypto to the wallet address returned in the api response and user will get the fiat in their provided account details.

  • 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": "offramp",
        "purposeCode": "company_expenses",
        "source": {
            "currency": "USDC"
        },
        "destination": {
            "currency": "AED",
            "paymentType": "bank_transfer",
            "paymentCode": "bank_transfer",
            "amount: "200"
            "additionalPaymentDetails": {
                "iban": "BE68539007547034",
                "bic": "DEUTBE21XXX",
                "street": "abcd",
                "city": "abcd",
                "postalCode": "123123"
            }
        }
    }'
    {
        "status": "success",
        "data": {
            "flow": "OFFRAMP",
            "flowType": "user-self",
            "orderId": "OR-260824111423413832397538943",
            "payUrl": "https://pay-widget.transfi.com//crypto-pay?paytoken=b84346f8-3a16-48ec-b641-05ab7720ab95",
            "cryptoAmount": 61.754114,
            "cryptoCurrency": "USDC",
            "cryptoNetwork": "ethereum",
            "fiatAmount": 200,
            "walletAddress": "0x5c338eAB5D41332f8c719021Ac24cdfF5583d457",
            "feeData": {
                "depositAmount": 61.754114,
                "withdrawAmount": 200,
                "exchangeRate": 0.2778935667639294,
                "totalFee": 22.22
            },
            "quoteHistory": {
                "refreshCount": 0,
                "orderCreationQuote": {
                    "isRefreshed": false,
                    "usedQuotes": {
                        "sourceCurrency": "USDC",
                        "sourceAmount": 61.754114,
                        "sourceAmountInUsd": 61.74,
                        "sourceCurrencyType": "crypto",
                        "destinationCurrency": "AED",
                        "destinationAmount": 200,
                        "destinationAmountInUsd": 55.57,
                        "destinationCurrencyType": "fiat",
                        "conversionRate": 0.2778935667639294,
                        "processingFee": 22.22,
                        "processingFeeRate": 0.1,
                        "customerFee": 0,
                        "customerFeeRate": 0,
                        "discount": 0,
                        "discountRate": 0,
                        "additionalFee": 0,
                        "fixedFee": {
                            "totalFixedFees": 0,
                            "totalFixedTfFees": 0,
                            "totalFixedCxFees": 0,
                            "fixedFeesCurrency": "",
                            "fixedFeeDetails": {
                                "baseFeeFixedRate": 0,
                                "tfFeeFixedRate": 0,
                                "cxFeeFixedRate": 0,
                                "currency": ""
                            }
                        },
                        "totalFee": 22.22,
                        "feeMode": "percentage",
                        "rateType": "live",
                        "quoteId": "QUOTE-8b75217b-6b2c-422c-b808-500d4950cfb5",
                        "networkFee": 0
                    }
                }
            }
        },
        "traceId": "$(uuidgen)"
    }

  • 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": "offramp",
        "purposeCode": "company_expenses",
        "purposeCodeReason": "Personal payment",
        "successRedirectUrl": "https://yourapp.com/success",
        "failureRedirectUrl": "https://yourapp.com/failure",
        "sourceUrl": "https://yourapp.com/source"
        "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": "USDC",
            "walletAddress": "0x123123123890ABCDEF1234567890ABCDEF"
        },
        "destination": {
            "currency": "AED",
            "paymentType": "bank_transfer",
            "paymentCode": "bank_transfer",
            "amount: "200"
            "additionalPaymentDetails": {
                "iban": "BE68539007547034",
                "bic": "DEUTBE21XXX",
                "street": "abcd",
                "city": "abcd",
                "postalCode": "123123"
            }
        },
         "customization": {
            "locale": "id"
         },
    }'
    {
        "status": "success",
        "data": {
            "flow": "OFFRAMP",
            "flowType": "user-self",
            "orderId": "OR-260824111423413832397538943",
            "payUrl": "https://pay-widget.transfi.com//crypto-pay?paytoken=b84346f8-3a16-48ec-b641-05ab7720ab95",
            "cryptoAmount": 61.754114,
            "cryptoCurrency": "USDC",
            "cryptoNetwork": "ethereum",
            "fiatAmount": 200,
            "walletAddress": "0x5c338eAB5D41332f8c719021Ac24cdfF5583d457",
            "feeData": {
                "depositAmount": 61.754114,
                "withdrawAmount": 200,
                "exchangeRate": 0.2778935667639294,
                "totalFee": 22.22
            },
            "quoteHistory": {
                "refreshCount": 0,
                "orderCreationQuote": {
                    "isRefreshed": false,
                    "usedQuotes": {
                        "sourceCurrency": "USDC",
                        "sourceAmount": 61.754114,
                        "sourceAmountInUsd": 61.74,
                        "sourceCurrencyType": "crypto",
                        "destinationCurrency": "AED",
                        "destinationAmount": 200,
                        "destinationAmountInUsd": 55.57,
                        "destinationCurrencyType": "fiat",
                        "conversionRate": 0.2778935667639294,
                        "processingFee": 22.22,
                        "processingFeeRate": 0.1,
                        "customerFee": 0,
                        "customerFeeRate": 0,
                        "discount": 0,
                        "discountRate": 0,
                        "additionalFee": 0,
                        "fixedFee": {
                            "totalFixedFees": 0,
                            "totalFixedTfFees": 0,
                            "totalFixedCxFees": 0,
                            "fixedFeesCurrency": "",
                            "fixedFeeDetails": {
                                "baseFeeFixedRate": 0,
                                "tfFeeFixedRate": 0,
                                "cxFeeFixedRate": 0,
                                "currency": ""
                            }
                        },
                        "totalFee": 22.22,
                        "feeMode": "percentage",
                        "rateType": "live",
                        "quoteId": "QUOTE-8b75217b-6b2c-422c-b808-500d4950cfb5",
                        "networkFee": 0
                    }
                }
            }
        },
        "traceId": "$(uuidgen)"
    }

In response you will receive walletAddress with amount to be transferred. Once the user transfers the crypto to that wallet, we will initiate the fiat transfer.


Third party offramp

In this case userId need to passed in source and destination objects. Source user is the sender of crypto and destination user is the recipient of fiat.

  • 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 '{
        "orderType": "offramp",
        "purposeCode": "company_expenses",
        "source": {
        		"userId": "UX-2123123123123",
            "currency": "USDTPOLYGON"
    		},
        "destination": {
            "userId": "UX-7897898789789789",
            "currency": "AED",
            "paymentType": "bank_transfer",
            "paymentCode": "bank_transfer",
            "amount: "200"
            "additionalPaymentDetails": {
                "iban": "BE68539007547034",
                "bic": "DEUTBE21XXX",
                "street": "abcd",
                "city": "abcd",
                "postalCode": "123123"
            }
        }
    }'
    {
        "status": "success",
        "data": {
            "flow": "OFFRAMP",
            "flowType": "user-self",
            "orderId": "OR-260824111423413832397538943",
            "payUrl": "https://pay-widget.transfi.com//crypto-pay?paytoken=b84346f8-3a16-48ec-b641-05ab7720ab95",
            "cryptoAmount": 61.754114,
            "cryptoCurrency": "USDC",
            "cryptoNetwork": "ethereum",
            "fiatAmount": 200,
            "walletAddress": "0x5c338eAB5D41332f8c719021Ac24cdfF5583d457",
            "feeData": {
                "depositAmount": 61.754114,
                "withdrawAmount": 200,
                "exchangeRate": 0.2778935667639294,
                "totalFee": 22.22
            },
            "quoteHistory": {
                "refreshCount": 0,
                "orderCreationQuote": {
                    "isRefreshed": false,
                    "usedQuotes": {
                        "sourceCurrency": "USDC",
                        "sourceAmount": 61.754114,
                        "sourceAmountInUsd": 61.74,
                        "sourceCurrencyType": "crypto",
                        "destinationCurrency": "AED",
                        "destinationAmount": 200,
                        "destinationAmountInUsd": 55.57,
                        "destinationCurrencyType": "fiat",
                        "conversionRate": 0.2778935667639294,
                        "processingFee": 22.22,
                        "processingFeeRate": 0.1,
                        "customerFee": 0,
                        "customerFeeRate": 0,
                        "discount": 0,
                        "discountRate": 0,
                        "additionalFee": 0,
                        "fixedFee": {
                            "totalFixedFees": 0,
                            "totalFixedTfFees": 0,
                            "totalFixedCxFees": 0,
                            "fixedFeesCurrency": "",
                            "fixedFeeDetails": {
                                "baseFeeFixedRate": 0,
                                "tfFeeFixedRate": 0,
                                "cxFeeFixedRate": 0,
                                "currency": ""
                            }
                        },
                        "totalFee": 22.22,
                        "feeMode": "percentage",
                        "rateType": "live",
                        "quoteId": "QUOTE-8b75217b-6b2c-422c-b808-500d4950cfb5",
                        "networkFee": 0
                    }
                }
            }
        },
        "traceId": "$(uuidgen)"
    }

  • 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": "offramp",
        "purposeCode": "company_expenses",
        "purposeCodeReason": "Personal payment",
        "successRedirectUrl": "https://yourapp.com/success",
        "failureRedirectUrl": "https://yourapp.com/failure",
        "sourceUrl": "https://yourapp.com/source"
        "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": {
    				"userId": "UX-2123123123123",
            "currency": "USDTPOLYGON",
            "walletAddress": "0x123123123890ABCDEF1234567890ABCDEF"
        },
        "destination": {
            "userId": "UX-7897898789789789",
            "currency": "AED",
            "paymentType": "bank_transfer",
            "paymentCode": "bank_transfer",
            "amount: "200"
            "additionalPaymentDetails": {
                "iban": "BE68539007547034",
                "bic": "DEUTBE21XXX",
                "street": "abcd",
                "city": "abcd",
                "postalCode": "123123"
            }
        },
         "customization": {
            "locale": "id"
         },
    }'
    {
        "status": "success",
        "data": {
            "flow": "OFFRAMP",
            "flowType": "user-self",
            "orderId": "OR-260824111423413832397538943",
            "payUrl": "https://pay-widget.transfi.com//crypto-pay?paytoken=b84346f8-3a16-48ec-b641-05ab7720ab95",
            "cryptoAmount": 61.754114,
            "cryptoCurrency": "USDC",
            "cryptoNetwork": "ethereum",
            "fiatAmount": 200,
            "walletAddress": "0x5c338eAB5D41332f8c719021Ac24cdfF5583d457",
            "feeData": {
                "depositAmount": 61.754114,
                "withdrawAmount": 200,
                "exchangeRate": 0.2778935667639294,
                "totalFee": 22.22
            },
            "quoteHistory": {
                "refreshCount": 0,
                "orderCreationQuote": {
                    "isRefreshed": false,
                    "usedQuotes": {
                        "sourceCurrency": "USDC",
                        "sourceAmount": 61.754114,
                        "sourceAmountInUsd": 61.74,
                        "sourceCurrencyType": "crypto",
                        "destinationCurrency": "AED",
                        "destinationAmount": 200,
                        "destinationAmountInUsd": 55.57,
                        "destinationCurrencyType": "fiat",
                        "conversionRate": 0.2778935667639294,
                        "processingFee": 22.22,
                        "processingFeeRate": 0.1,
                        "customerFee": 0,
                        "customerFeeRate": 0,
                        "discount": 0,
                        "discountRate": 0,
                        "additionalFee": 0,
                        "fixedFee": {
                            "totalFixedFees": 0,
                            "totalFixedTfFees": 0,
                            "totalFixedCxFees": 0,
                            "fixedFeesCurrency": "",
                            "fixedFeeDetails": {
                                "baseFeeFixedRate": 0,
                                "tfFeeFixedRate": 0,
                                "cxFeeFixedRate": 0,
                                "currency": ""
                            }
                        },
                        "totalFee": 22.22,
                        "feeMode": "percentage",
                        "rateType": "live",
                        "quoteId": "QUOTE-8b75217b-6b2c-422c-b808-500d4950cfb5",
                        "networkFee": 0
                    }
                }
            }
        },
        "traceId": "$(uuidgen)"
    }

In response you will receive walletAddress with amount to be transferred. Once the user transfers the crypto to that wallet, we will initiate the fiat transfer.

Note: Amount to be transferred can be passed in either source or destination.

Examples:

{
    "source": {
        "currency": "USDC",
        "amount": "100"
    },
    "destination": {
        "currency": "EUR"
    }
}
{
    "source": {
        "currency": "USDC"
    },
    "destination": {
        "currency": "EUR",
        "amount": "100"
    }
}
  1. Amount is sent in source object: In this case, user needs to do payin of 100 USDC. Amount of EUR that will be sent to user will be calculated (~94.5 EUR). (This is usually preferred)
  2. Amount is sent in destination object: In this case, amount of USDC that user needs to send will be calculated (~105 USDC) and 100 EUR will be sent to user.

Did this page help you?