Deposit
On this page, we’ll dive into the different deposit endpoints you can use to manage deposit transactions programmatically. You can deposit both fiat and cryptocurrency.
The deposit model
The deposit model is the data structure that represents a deposit transaction in Rampable. The following attributes are associated with the deposit model:
Properties
- Name
depositId
- Type
- string
- Description
Unique identifier for the deposit transaction.
- Name
depositType
- Type
- string
- Description
The type of deposit (e.g., fiat or crypto).
- Name
userId
- Type
- string
- Description
Unique identifier for the user making the deposit.
- Name
inputCurrency
- Type
- string
- Description
The currency used for the deposit (e.g., IDR).
- Name
inputAmount
- Type
- number
- Description
The amount of the deposit in the input currency.
- Name
exchangeRate
- Type
- number
- Description
The exchange rate applied to the deposit.
- Name
output
- Type
- object
- Description
The output details of the deposit transaction.
- Name
output.balanceType
- Type
- string
- Description
The type of balance (e.g., fiat or crypto).
- Name
output.currency
- Type
- string
- Description
The currency of the output (e.g., IDR).
- Name
output.amount
- Type
- number
- Description
The amount of the output.
- Name
fee
- Type
- object
- Description
The fee details associated with the deposit.
- Name
fee.amount
- Type
- number
- Description
The amount of the fee.
- Name
fee.percentage
- Type
- number
- Description
The percentage of the fee.
- Name
fee.currency
- Type
- string
- Description
The currency of the fee.
- Name
paymentFiat
- Type
- object
- Description
The payment details for fiat transactions.
- Name
paymentFiat.bankName
- Type
- string
- Description
The name of the bank used for the payment.
- Name
paymentFiat.bankCode
- Type
- string
- Description
The code of the bank used for the payment.
- Name
paymentFiat.accountName
- Type
- string
- Description
The name on the bank account.
- Name
paymentFiat.accountNumber
- Type
- string
- Description
The bank account number.
- Name
paymentCrypto
- Type
- object
- Description
The payment details for crypto transactions.
- Name
paymentCrypto.payoutWallet
- Type
- string
- Description
The wallet address used for the payment.
- Name
paymentCrypto.network
- Type
- string
- Description
The network used for the payment.
- Name
status
- Type
- string
- Description
The status of the deposit transaction. This can be either
pending
,expired
orcompleted
.
- Name
activityHistory
- Type
- array
- Description
A history of activities related to the deposit.
- Name
activityHistory.activity
- Type
- string
- Description
The activity description.
- Name
activityHistory.status
- Type
- string
- Description
The status of the activity.
- Name
activityHistory.description
- Type
- string
- Description
A description of the activity.
- Name
activityHistory.updatedAt
- Type
- string
- Description
The timestamp of the activity update.
- Name
expiredAt
- Type
- string
- Description
The expiration timestamp of the deposit transaction.
- Name
createdAt
- Type
- string
- Description
The timestamp when the deposit transaction was created.
- Name
updatedAt
- Type
- string
- Description
The timestamp when the deposit transaction was last updated.
Deposit Fiat
This endpoint initiates a fiat deposit transaction. To initiate a deposit, you must provide the amount, inputCurrency, outputCurrency, balanceType, and paymentMethod.
Ensure that the amount is a positive number and both inputCurrency and outputCurrency are valid currency codes.
Required attributes
- Name
inputAmount
- Type
- number
- Description
The amount of the offramp in the input currency.
- Name
inputCurrency
- Type
- string
- Description
The fiat currency of the deposit.
- Name
outputCurrency
- Type
- string
- Description
The output currency (fiat or crypto) of the deposit.
- Name
balanceType
- Type
- string
- Description
The type of balance (e.g., fiat).
- Name
paymentMethod
- Type
- string
- Description
The payment method used for the transaction. You can get the payment method code from the payment methods endpoint.
Request
curl --location \
https://sandbox.rampable.co/v1/deposit/fiat \
--header 'x-client-secret: ••••••' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"inputAmount": 10000,
"inputCurrency": "IDR",
"outputCurrency": "IDR",
"balanceType": "fiat",
"paymentMethod": "bank_sinarmas"
}'
Response
{
"statusCode": 201,
"message": "Fiat deposit created",
"data": {
"depositId": "4b509748-b2c2-4334-a251-8b0d79e5b750",
"depositType": "fiat",
"userId": "6719f68dd07aef516b9158ba",
"inputCurrency": "IDR",
"inputAmount": 10000,
"exchangeRate": 1,
"output": {
"balanceType": "fiat",
"currency": "IDR",
"amount": 4980
},
"fee": {
"amount": 5020,
"percentage": 50.2,
"currency": "IDR"
},
"paymentFiat": {
"bankName": "Bank Sinarmas",
"bankCode": "bank_sinarmas",
"accountName": "Rampable",
"accountNumber": "00000000"
},
"status": "pending",
"activityHistory": [
{
"activity": "Paid by Payee",
"status": "pending",
"description": "Waiting for payment",
"updatedAt": "2024-10-30T12:05:44.650Z"
}
],
"expiredAt": "2024-10-30T12:10:44.650Z",
"createdAt": "2024-10-30T12:05:44.653Z",
"updatedAt": "2024-10-30T12:05:44.653Z"
}
}
HTTP Status 400 Example
Error Response
{
"statusCode": 400,
"error": "Not Found",
"message": "Payment method not found"
}
Deposit Crypto
This endpoint initiates a crypto deposit transaction. To initiate a deposit, you must provide the amount, inputCurrency, outputCurrency, balanceType, and paymentMethod.
Ensure that the amount is a positive number and both inputCurrency and outputCurrency are valid currency codes.
Required attributes
- Name
inputAmount
- Type
- number
- Description
The amount of the offramp in the input currency.
- Name
inputCurrency
- Type
- string
- Description
The fiat currency of the deposit.
- Name
outputCurrency
- Type
- string
- Description
The output currency (fiat or crypto) of the deposit.
- Name
balanceType
- Type
- string
- Description
The type of balance (e.g., fiat).
Request
curl --location \
https://sandbox.rampable.co/v1/deposit/crypto \
--header 'x-client-secret: ••••••' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"inputAmount": 10,
"inputCurrency": "usdt-tron",
"outputCurrency": "IDR",
"balanceType": "fiat"
}'
Response
{
"statusCode": 201,
"message": "Crypto deposit created",
"data": {
"depositId": "cd8cf499-9bdd-4faf-a72a-3b0c7725e241",
"depositType": "crypto",
"userId": "6724548c8638b44fd6f6f0f3",
"inputCurrency": "usdt-tron",
"inputAmount": 10,
"exchangeRate": 15897,
"output": {
"balanceType": "fiat",
"currency": "IDR",
"amount": 153652.06
},
"fee": {
"amount": 5317.94,
"percentage": 3.3452475309806875,
"currency": "IDR"
},
"paymentCrypto": {
"payoutWallet": "TMLwSA83KgzNLFyhnTysAGBVjQguAkZxN3",
"network": "tron"
},
"status": "pending",
"activityHistory": [
{
"activity": "Paid by Payee",
"status": "pending",
"description": "Waiting for payment",
"updatedAt": "2024-11-02T07:04:06.396Z",
"_id": "6725cee61bc5acff583ec56d"
}
],
"expiredAt": "2024-11-02T07:09:06.396Z",
"createdAt": "2024-11-02T07:04:06.414Z",
"updatedAt": "2024-11-02T07:04:06.414Z"
}
}
HTTP Status 400 Example
Error Response
{
"statusCode": 400,
"error": "Not Found",
"message": "Fiat not found"
}
[DEV] Update status
This endpoint is used to update the status of a deposit. Work only on sandbox environment. Will send webhook to the user.
Work only on sandbox environment.
Required attributes
- Name
status
- Type
- string
- Description
The status of the deposit.
Request
curl --location --request PATCH 'https://sandbox.rampable.co/v1/deposit/24f8d87a-ee5c-42b6-81b1-0a2706430bd7' \
--header 'x-client-secret: ••••••' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"status" : "completed"
}'
Response
{
"statusCode": 200,
"message": "Deposit updated",
"data": {
"depositId": "24f8d87a-ee5c-42b6-81b1-0a2706430bd7",
"depositType": "fiat",
"userId": "6724548c8638b44fd6f6f0f3",
"inputCurrency": "IDR",
"inputAmount": 10000,
"exchangeRate": 1,
"output": {
"balanceType": "fiat",
"currency": "IDR",
"amount": 4980
},
"fee": {
"amount": 5020,
"percentage": 50.2,
"currency": "IDR"
},
"paymentFiat": {
"bankName": "Bank Sinarmas",
"bankCode": "bank_sinarmas",
"accountName": "Rampable",
"accountNumber": "123123123"
},
"paymentCrypto": {},
"status": "completed",
"activityHistory": [
{
"activity": "Paid by Payee",
"status": "pending",
"description": "Waiting for payment",
"updatedAt": "2024-11-01T10:27:35.024Z",
"_id": "6724ad17edf5d43f1026ace2"
}
],
"expiredAt": "2024-11-01T10:32:35.024Z",
"createdAt": "2024-11-01T10:27:35.040Z",
"updatedAt": "2024-11-02T06:56:39.934Z"
}
}
### HTTP Status 400 Example
```json {{ title: 'Error Response' }}
{
"statusCode": 400,
"error": "Bad Request",
"message": "Deposit not found"
}