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": "USDTPOLYGON"
        },
        "destination": {
            "currency": "EUR",
            "paymentType": "bank_transfer",
            "paymentCode": "sepa_bank",
            "amount: "200"
            "additionalPaymentDetails": {
                "iban": "BE68539007547034",
                "bic": "DEUTBE21XXX",
                "street": "abcd",
                "city": "abcd",
                "postalCode": "123123"
            }
        }
    }'
    {
        "status": "success",
        "data": {
            "flow": "OFFRAMP",
            "orderId": "OR-2510010702057129005",
            "cryptoAmount": 245.985005,,
            "fiatAmount": 200,
            "walletAddress": "0xbd09d65597b27626b23cd2e2d7664943df007293",
            "feeData": {
                "depositAmount": 245.985005,
                "withdrawAmount": 200,
                "exchangeRate": 0.838203804606,
                "totalFee": 6.19
            }
        }
    }

  • 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": "USDTPOLYGON",
            "walletAddress": "0x123123123890ABCDEF1234567890ABCDEF"
        },
        "destination": {
            "currency": "EUR",
            "paymentType": "bank_transfer",
            "paymentCode": "sepa_bank",
            "amount: "200"
            "additionalPaymentDetails": {
                "iban": "BE68539007547034",
                "bic": "DEUTBE21XXX",
                "street": "abcd",
                "city": "abcd",
                "postalCode": "123123"
            }
        },
         "customization": {
            "locale": "id"
         },
    }'
    {
        "status": "success",
        "data": {
            "flow": "OFFRAMP",
            "orderId": "OR-2510010702057129005",
            "cryptoAmount": 245.985005,,
            "fiatAmount": 200,
            "walletAddress": "0xbd09d65597b27626b23cd2e2d7664943df007293",
            "feeData": {
                "depositAmount": 245.985005,
                "withdrawAmount": 200,
                "exchangeRate": 0.838203804606,
                "totalFee": 6.19
            }
        }
    }

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": "EUR",
            "paymentType": "bank_transfer",
            "paymentCode": "sepa_bank",
            "amount: "200"
            "additionalPaymentDetails": {
                "iban": "BE68539007547034",
                "bic": "DEUTBE21XXX",
                "street": "abcd",
                "city": "abcd",
                "postalCode": "123123"
            }
        }
    }'
    {
        "status": "success",
        "data": {
            "flow": "OFFRAMP",
            "orderId": "OR-2510010702057129005",
            "cryptoAmount": 245.985005,,
            "fiatAmount": 200,
            "walletAddress": "0xbd09d65597b27626b23cd2e2d7664943df007293",
            "feeData": {
                "depositAmount": 245.985005,
                "withdrawAmount": 200,
                "exchangeRate": 0.838203804606,
                "totalFee": 6.19
            }
        }
    }

  • 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": "EUR",
            "paymentType": "bank_transfer",
            "paymentCode": "sepa_bank",
            "amount: "200"
            "additionalPaymentDetails": {
                "iban": "BE68539007547034",
                "bic": "DEUTBE21XXX",
                "street": "abcd",
                "city": "abcd",
                "postalCode": "123123"
            }
        },
         "customization": {
            "locale": "id"
         },
    }'
    {
        "status": "success",
        "data": {
            "flow": "OFFRAMP",
            "orderId": "OR-2510010702057129005",
            "cryptoAmount": 245.985005,,
            "fiatAmount": 200,
            "walletAddress": "0xbd09d65597b27626b23cd2e2d7664943df007293",
            "feeData": {
                "depositAmount": 245.985005,
                "withdrawAmount": 200,
                "exchangeRate": 0.838203804606,
                "totalFee": 6.19
            }
        }
    }

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?