[DEPRECATED] Payments
These endpoints will be deprecated at 6th February 2024. Please use offramp endpoints instead.
On this page, we’ll dive into the different payment endpoints you can use to manage payments programmatically. You can use these endpoints to retrieve a list of payments, create a new payment, update a payment, and delete a payment. You can also use these endpoints to retrieve a list of payments for a specific organization.
The payment model
The payment model is the data structure that represents a payment in Rampable. The following attributes are associated with the payment model:
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the payment.
- Name
sender.id
- Type
- string
- Description
Unique identifier for the sender.
- Name
sender.name
- Type
- string
- Description
The name of the sender.
- Name
sender.email
- Type
- string
- Description
The email address of the sender.
- Name
sender.walletAddress
- Type
- string
- Description
The wallet address of the sender.
- Name
receiver.id
- Type
- string
- Description
Unique identifier for the receiver
- Name
receiver.name
- Type
- string
- Description
The name of the receiver.
- Name
receiver.email
- Type
- string
- Description
The email address of the receiver.
- Name
receiver.accountNumber
- Type
- string
- Description
The account number of the receiver.
- Name
receiver.bankName
- Type
- string
- Description
The bank name of the receiver.
- Name
paymentId
- Type
- string
- Description
Unique identifier for the payment.
- Name
paymentType
- Type
- string
- Description
The type of payment. This can be either onramp or offramp.
- Name
inputAmount
- Type
- number
- Description
The amount of the payment in the input currency.
- Name
inputAmountExact
- Type
- number
- Description
The exact amount of the payment in the input currency.
- Name
inputCurrency
- Type
- string
- Description
The currency of the payment.
- Name
outputCurrency
- Type
- string
- Description
The currency of the payment.
- Name
outputAmount
- Type
- number
- Description
The amount of the payment in the output currency.
- Name
outputAmountExact
- Type
- number
- Description
The exact amount of the payment in the output currency.
- Name
exchangeFees
- Type
- number
- Description
The exchange fees for the payment.
- Name
platformFees
- Type
- number
- Description
The platform fees for the payment.
- Name
reason
- Type
- string
- Description
The reason for the payment.
- Name
description
- Type
- string
- Description
The description for the payment.
- Name
status
- Type
- string
- Description
The status of the payment. This can be either pending, processed, completed, or failed.
- Name
organizationId
- Type
- string
- Description
Unique identifier for the organization associated with the payment.
- Name
organizationName
- Type
- string
- Description
The name of the organization associated with the payment.
- Name
blockchain
- Type
- string
- Description
The blockchain of the payment.
- Name
payOutWallet
- Type
- string
- Description
The wallet address of the receiver.
- Name
expiredDate
- Type
- string
- Description
The expired date of the payment.
- Name
createdAt
- Type
- string
- Description
The date the payment was created.
- Name
updatedAt
- Type
- string
- Description
The date the payment was last updated.
Quote
This endpoint allows you to get quote price for payment. To get quote price, you must provide amount, coin, currency, and network.
Required attributes
Optional attributes
- Name
withLimit
- Type
- boolean
- Description
Using the withLimit means you can get the quote using only the client secret without having to include your user access token in request headers as well, which is useful for client-side applications.
It means there is no daily limit calculation applied for the quote based on the user's limits when you use withLimit equal to false (pure quote only).
Request
curl --location 'https://sandbox.rampable.co/v2/payment/quote?amount=10&inputCurrency=usdc-polygon&outputCurrency=SGD&withLimit=true' \
--header 'x-client-secret: d9659c0857a91ae28a59ce9f9a8155f1b37ba1df91d4b4a50b3ecbb9ecdc2667' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
Response
{
"statusCode": 200,
"message": "getQuotePriceHandler successfully",
"data": {
"status": true,
"coin": "usdt",
"currency": "INR",
"amount": 12,
"rate_amount": 82.9644525,
"amount_in_currency": 995.5734299999999,
"total_fee_percentage": 4.5,
"total_fee_amount": 0.54,
"total_fee_amount_in_currency": 44.80080435,
"total_received_amount": 11.46,
"total_received_amount_in_currency": 950.77262565,
"payout_wallet": "0xabcabcabcxxxxxxxxxxxxxxxxxxxxxx"
}
}
List all payments
This endpoint allows you to retrieve a paginated list of all your payments. By default, a maximum of ten payments are shown per page.
Query Params attributes
- Name
limit
- Type
- integer
- Description
Limit the number of payments returned.
- Name
page
- Type
- integer
- Description
Specify the page number of the payments to retrieve.
- Name
sort
- Type
- string
- Description
Sort the payments by a specific field. You can sort by createdAt or updatedAt. By default, payments are sorted by createdAt. You can also sort in reverse order by adding a hyphen (-) before the field you want to sort by.
- Name
search
- Type
- string
- Description
Search for a payment by name or email.
- Name
status
- Type
- string
- Description
Filter payments by status. This can be either pending, processed, completed, or failed.
- Name
reason
- Type
- string
- Description
Filter payments by reason.
- Name
minInputAmount
- Type
- number
- Description
Filter payments by minimum input amount.
- Name
maxInputAmount
- Type
- number
- Description
Filter payments by maximum input amount.
- Name
minOutputAmount
- Type
- number
- Description
Filter payments by minimum output amount.
- Name
maxOutputAmount
- Type
- number
- Description
Filter payments by maximum output amount.
- Name
organizationId
- Type
- string
- Description
Filter payments by organization id.
- Name
organizationName
- Type
- string
- Description
Filter payments by organization name.
- Name
blockchain
- Type
- string
- Description
Filter payments by blockchain.
- Name
receiverName
- Type
- string
- Description
Filter payments by receiver name.
Request
curl -X GET "https://sandbox.rampable.co/v2/payment?search=something&limit=10&status=success&reason=Salary%20/%20Bonus" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
Response
{
"statusCode": 200,
"message": "getPaymentsHandler successfully",
"data": {
"docs": [
{
"sender": {
"id": "6503e4a7a7a0c81808f820a8",
"name": "john",
"email": "johndoe@gmail.com",
"walletAddress": "0xeB900400cbaD60dACB53c1a37C11FE02AC49bf1C"
},
"receiver": {
"id": "649103fbda596d801de2e317",
"name": "test",
"email": "test@be.com",
"accountNumber": "454534",
"bankName": "Allo Bank Indonesia"
},
"paymentId": "03da242a-c1a6-49fe-b00c-fb68c271bed5",
"paymentType": "offramp",
"inputAmount": 10,
"inputAmountExact": 10,
"inputCurrency": "usdt",
"outputCurrency": "IDR",
"outputAmount": 153596.25,
"outputAmountExact": 153596.25,
"exchangeFees": 0,
"platformFees": 0,
"reason": "Salary / Bonus",
"description": "",
"status": "failed",
"organizationId": "648ad7c3f7ef099b9b86c236",
"organizationName": "Organization test",
"blockchain": "ethereum",
"payOutWallet": "0xbEAB719e60709AeC383038cD3633fd4092955D5e",
"expiredDate": "2023-09-22T08:06:01.739Z",
"createdAt": "2023-09-22T08:05:01.954Z",
"updatedAt": "2023-09-22T10:10:00.067Z",
"id": "650d4aad80db079d38925649"
},
...
],
"totalDocs": 1,
"offset": 0,
"limit": 10,
"totalPages": 1,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": false,
"prevPage": null,
"nextPage": null
}
}
Payment Detail
This endpoint allows you to retrieve a payment detail by paymentId.
Request
curl -X GET "https://sandbox.rampable.co/v2/payment/detail/xxxxxxx" \
-H "Authorization: Bearer YOUR_TOKEN"
Response
{
"statusCode": 200,
"message": "getPaymentHandler successfully",
"data": {
"paymentId": "4622e2c4-6335-4d36-95b5-ae1614429f",
"paymentType": "offramp",
"sender": {
"id": "64b50e7XXXXXX59c15783",
"name": "XXXXXXX",
"email": "xxxxxx@mail.com",
"walletAddress": "0xA46Bd8E25XXXXXXXB2d1f088EB3947"
},
"receiver": {
"id": "64d344XXXXXbfe646664f2",
"name": "XXXXX",
"email": "xxxxxx@mail.com",
"accountNumber": "12345678",
"ifsc": "1",
"achNumber": "1",
"fedwireNumber": "",
"ibanNumber": "1"
},
"inputAmount": 2,
"inputAmountExact": 2,
"inputCurrency": "usdt",
"outputCurrency": "IDR",
"outputAmount": 30879.09,
"outputAmountExact": 30879.09,
"exchangeFees": 0,
"platformFees": 0,
"reason": "The reason for the payment",
"description": "The description for the payment",
"status": "pending",
"organizationId": "648ad7XXXXXXX9b9b86c236",
"organizationName": "XXXXXXXX",
"transactionHash": "",
"blockchain": "polygon",
"payOutWallet": "0xbEAB719XXXXXXXXcD363ss55D5e",
"expiredDate": "2023-10-01T05:09:41.162Z",
"activityHistory": [
{
"activity": "Signed by Payee",
"status": "pending",
"description": "Waiting for signature from sender",
"_id": "6518fedXXXXXXe187867ad36",
"updatedAt": "2023-10-01T05:08:41.653Z"
},
{
"activity": "Converted to",
"status": "pending",
"description": "Your crypto has been converted to desired output successfully",
"_id": "6518fedXXXXXX7867ad37",
"updatedAt": "2023-10-01T05:08:41.653Z"
},
{
"activity": "Sent to receipient account",
"status": "pending",
"description": "Transaction is under process and will be transferred out to recipient",
"_id": "6518feXXXXXX87867ad38",
"updatedAt": "2023-10-01T05:08:41.653Z"
},
{
"activity": "Received by recipient account",
"status": "pending",
"description": "Transaction is executed successfully and closed",
"_id": "6518fXXXXXXXX7867ad39",
"updatedAt": "2023-10-01T05:08:41.653Z"
}
],
"createdAt": "2023-10-01T05:08:41.657Z",
"updatedAt": "2023-10-01T05:08:41.657Z",
"id": "6518fedXXXXXXXX87867ad35"
}
}
Create Payment
This endpoint allows you to add a new payment to your payment list in Rampable. To add a payment, you must provide their Rampable name and email also bank country and currency which automatically bind using recipient id.
Recipient must be created first before you get started with this endpoint. See Create Recipient for more information.
Required attributes
- Name
walletAddress
- Type
- string
- Description
The wallet address of the sender.
Optional, include this attribute if you want to speed up the validation of payment / offramp process.
- Name
inputAmount
- Type
- number
- Description
The amount of the payment in the input currency.
- Name
senderName
- Type
- string
- Description
The name of the sender.
- Name
senderEmail
- Type
- string
- Description
The email address of the sender.
- Name
receiverId
- Type
- string
- Description
Unique identifier for the receiver refer to recipient.id
- Name
inputCurrency
- Type
- string
- Description
The crypto ID of the payment. See Reference
- Name
outputCurrency
- Type
- string
- Description
The output currency (currency) of the payment. See Reference
Optional attributes
- Name
reason
- Type
- string
- Description
The reason for the payment.
- Name
description
- Type
- string
- Description
The description for the payment.
- Name
usNetwork
- Type
- string
- Description
The us network for the payment. This can be either
ach
orwire
.
After the create payment process was done, the payment will be in pending
status. The payment will be processed automatically after the requested crypto asset has been received by Rampable. If the payment is successful, the status will be updated to processed
.
Users need to send the crypto to the payOutWallet
Request
curl -X POST "https://sandbox.rampable.co/v2/payment" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"walletAddress": "0xA4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"inputAmount": 1,
"senderName": "XXXXX",
"senderEmail": "xxxxxx@mail.com",
"receiverId": "64d3XXXXXXXXX6664f2",
"inputCurrency": "usdc-polygon",
"outputCurrency": "SGD",
"reason": "The reason for the payment",
"description": "The description for the payment",
"usNetwork": "ach"
}'
Response
{
"statusCode": 201,
"message": "Payment created successfully",
"data": {
"paymentId": "4622e2c4-xxxx-ssss6-95b5-axxxxx472f9f",
"paymentType": "offramp",
"sender": {
"id": "64b50e7XXXXXX59c15783",
"name": "XXXXXXX",
"email": "xxxxxx@mail.com",
"walletAddress": "0xA46Bd8E25XXXXXXXB2d1f088EB3947"
},
"receiver": {
"id": "64d344XXXXXbfe646664f2",
"name": "XXXXX",
"email": "xxxxxx@mail.com",
"accountNumber": "12345678",
"ifsc": "1",
"achNumber": "1",
"fedwireNumber": "",
"ibanNumber": "1"
},
"inputAmount": 2,
"inputAmountExact": 2,
"inputCurrency": "usdt",
"outputCurrency": "IDR",
"outputAmount": 30879.09,
"outputAmountExact": 30879.09,
"exchangeFees": 0,
"platformFees": 0,
"reason": "The reason for the payment",
"description": "The description for the payment",
"status": "pending",
"organizationId": "648ad7XXXXXXX9b9b86c236",
"organizationName": "XXXXXXXX",
"transactionHash": "",
"blockchain": "polygon",
"payOutWallet": "0xbEAB719XXXXXXXXcD3633fd4092955D5e",
"expiredDate": "2023-10-01T05:09:41.162Z",
"activityHistory": [
{
"activity": "Signed by Payee",
"status": "pending",
"description": "Waiting for signature from sender",
"_id": "6518fedXXXXXXe187867ad36",
"updatedAt": "2023-10-01T05:08:41.653Z"
},
{
"activity": "Converted to",
"status": "pending",
"description": "Your crypto has been converted to desired output successfully",
"_id": "6518fedXXXXXX7867ad37",
"updatedAt": "2023-10-01T05:08:41.653Z"
},
{
"activity": "Sent to receipient account",
"status": "pending",
"description": "Transaction is under process and will be transferred out to recipient",
"_id": "6518feXXXXXX87867ad38",
"updatedAt": "2023-10-01T05:08:41.653Z"
},
{
"activity": "Received by recipient account",
"status": "pending",
"description": "Transaction is executed successfully and closed",
"_id": "6518fXXXXXXXX7867ad39",
"updatedAt": "2023-10-01T05:08:41.653Z"
}
],
"createdAt": "2023-10-01T05:08:41.657Z",
"updatedAt": "2023-10-01T05:08:41.657Z",
"id": "6518fedXXXXXXXX87867ad35"
}
}