Create Off-Ramp Transaction
This method allows you to add a new transaction to your off-ramp transaction list in Rampable.
Method Signature
async create(request: CreateOffRampRequest): Promise<XellarOffRampTransactionDetailResponse>
Parameters
request
: CreateOffRampRequest
- An object with the following properties:
Required Properties
inputAmount
:number
- The amount of the off-ramp transaction in crypto currencysenderName
:string
- The name of the sendersenderEmail
:string
- The email address of the senderreceiverId
:string
- Unique identifier for the receiver (refer to recipient.id)inputCurrency
:string
- The crypto ID for the input currencyoutputCurrency
:string
- The output (fiat) currency code
Optional Properties
walletAddress
:string
- The wallet address of the sender (include to speed up validation)reason
:string
- The reason for the off-ramp transactiondescription
:string
- Additional description for the transactionusNetwork
:string
- The US network type (either 'ach' or 'wire')
Returns
Promise<XellarOffRampTransactionDetailResponse>
- An object containing the created off-ramp transaction details.
Example Usage
const request = {
inputAmount: 100,
senderName: "John Doe",
senderEmail: "john@example.com",
receiverId: "64d34423027XXXXXXX",
inputCurrency: "usdc-polygon",
outputCurrency: "IDR",
reason: "Salary Payment",
description: "Monthly salary transfer"
};
const transaction = await sdk.offRamp.create(request);
console.log(transaction);
Response Example
{
"offrampId": "9fadfe62-XXXX-XXXX-XXXX-16f0a1fb711f",
"feeDetail": {
"rate_amount": 15636.447900000001,
"total_fee_amount": 0.648,
"total_fee_amount_in_currency": 10132.4182392
},
"sender": {
"id": "64c422d5e78XXXXXXXXXXXXX",
"name": "rony XXXX",
"email": "rony.XXXX@gmail.com",
"walletAddress": "-"
},
"receiver": {
"id": "64d34423027XXXXXXX",
"name": "Ahmed XXXX",
"email": "ahmed.XXXXX@gmail.com",
"accountNumber": "23123232123",
"ifsc": "1",
"achNumber": "1",
"fedwireNumber": "",
"ibanNumber": "1"
},
"inputAmount": 0.003,
"inputAmountExact": 0.003,
"inputCurrency": "usdc",
"outputCurrency": "IDR",
"outputAmount": 46.9255275,
"outputAmountExact": 0,
"reason": "Test send",
"description": "Test description",
"status": "pending",
"organizationId": "-",
"organizationName": "-",
"blockchain": "stellar",
"payOutWallet": "GAFK7XFZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"memo": "263420945XXXXXXXX",
"expiredDate": "2024-02-03T20:33:38.077Z",
"cryptoId": "usdc-stellar",
"useSmartContract": false,
"blockchainType": "STELLAR",
"activityHistory": [
{
"activity": "Signed by Payee",
"status": "pending",
"description": "Waiting for signature from sender",
"_id": "65bea1f65774dfba15f4ab0e",
"updatedAt": "2024-02-03T20:28:38.080Z"
},
{
"activity": "Converted to",
"status": "pending",
"description": "Waiting for crypto asset to be received by system, to be converted to fiat afterward",
"_id": "65bea1f65774dfba15f4ab0f",
"updatedAt": "2024-02-03T20:28:38.080Z"
},
{
"activity": "Sent to recipient account",
"status": "pending",
"description": "Transaction is under process and will be transferred out to recipient after conversion is done",
"_id": "65bea1f65774dfba15f4ab10",
"updatedAt": "2024-02-03T20:28:38.080Z"
},
{
"activity": "Received by recipient account",
"status": "pending",
"description": "Transaction is executed successfully and closed",
"_id": "65bea1f65774dfba15f4ab11",
"updatedAt": "2024-02-03T20:28:38.080Z"
}
],
"createdAt": "2024-02-03T20:28:38.085Z",
"updatedAt": "2024-02-03T20:28:38.085Z",
"id": "65bea1f6XXXXXXXXX"
}
ℹ️
A recipient must be created before using this endpoint. See Create Recipient documentation for more information.
⚠️
Users need to send the crypto to the payOutWallet
provided in the response. If a partnerRedirectUrl
is provided, the payment will be processed on the specified redirect URL.
Additional Information
- After creation, the off-ramp transaction will be in
pending
status - The transaction will be processed automatically after the crypto asset is received by Rampable
- Users are limited to 5 pending off-ramp transactions at any time
- The transaction status will update to
processed
upon successful completion
For more information, see the Rampable Create Off-Ramp API Documentation (opens in a new tab).