Deposit
The Deposit API is used to initiate the deposit process for the SEP-24 protocol. By invoking this API, users can initiate a deposit transaction following the SEP-24 standard.
Method: POST
{{URL}}/jsonrpc
Headers
Name | Value |
---|---|
Content-Type | application/json |
Example
Payload Parameters
Parameter | Description |
---|---|
id Mandatory | String Represents the unique identifier associated with the deposit transaction. Ex: "701001" |
asset Mandatory | String Refers to the asset code for the deposit transaction. It specifies the type of asset being deposited. Ex: "SRT" |
- cURL
- C#
- Go
- NodeJs
curl --location '{{url}}/rpc/WalletService/DepositProcess' \
--header 'DiviceID: 8020' \
--header 'Signature: keyId=8020,algorithm=ecdsa-sha256,signature=MEUCIQCNi1vjPf/HpI9R2DXnc0Zt1s6YmWyA4H1x813lJ+tuDgIgB+lrc+iCMyTUGiraG9kGKNDXYiz7RfBBtifr5wUQs54=' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic e3tFbWFpbH19Ont7UGFzc3dvcmR9fQ==' \
--data '{"id":"701001","asset":"SRT"}'
var options = new RestClientOptions("{{url}}")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/fednowbackend/rpc/WalletService/DepositProcess", Method.Post);
request.AddHeader("DiviceID", "8020");
request.AddHeader("Signature", "keyId=8020,algorithm=ecdsa-sha256,signature=MEUCIQCNi1vjPf/HpI9R2DXnc0Zt1s6YmWyA4H1x813lJ+tuDgIgB+lrc+iCMyTUGiraG9kGKNDXYiz7RfBBtifr5wUQs54=");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Basic e3tFbWFpbH19Ont7UGFzc3dvcmR9fQ==");
var body = @"{
" + "\n" +
@" ""id"": ""701001"",
" + "\n" +
@" ""asset"": ""SRT""
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "{{url}}/rpc/WalletService/DepositProcess"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"id": "701001",`+"
"+`
"asset": "SRT"`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("DiviceID", "8020")
req.Header.Add("Signature", "keyId=8020,algorithm=ecdsa-sha256,signature=MEUCIQCNi1vjPf/HpI9R2DXnc0Zt1s6YmWyA4H1x813lJ+tuDgIgB+lrc+iCMyTUGiraG9kGKNDXYiz7RfBBtifr5wUQs54=")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic e3tFbWFpbH19Ont7UGFzc3dvcmR9fQ==")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': '{{url}}',
'path': '/fednowbackend/rpc/WalletService/DepositProcess',
'headers': {
'DiviceID': '8020',
'Signature': 'keyId=8020,algorithm=ecdsa-sha256,signature=MEUCIQCNi1vjPf/HpI9R2DXnc0Zt1s6YmWyA4H1x813lJ+tuDgIgB+lrc+iCMyTUGiraG9kGKNDXYiz7RfBBtifr5wUQs54=',
'Content-Type': 'application/json',
'Authorization': 'Basic e3tFbWFpbH19Ont7UGFzc3dvcmR9fQ=='
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"id": "701001",
"asset": "SRT"
});
req.write(postData);
req.end();
Body
{
"id": "701001",
"asset": "SRT"
}
Response: 200
Response Parameters
Parameter | Description |
---|---|
type | String Represents the type of action or information needed for the deposit transaction. Ex: "interactive_customer_info_needed" |
url | String Specifies the URL that needs to be accessed to complete the deposit transaction. It typically directs the user to an interactive web application where customer information can be provided. Ex: "https://testanchor.stellar.org/sep24/transactions/deposit/webapp?asset_code=SRT&transaction_id=1d54b233-cd1c-4b14-9e62-dbd382698018&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3Rlc3RhbmNob3Iuc3RlbGxhci5vcmcvc2VwMjQvdHJhbnNhY3Rpb25zL2RlcG9zaXQvaW50ZXJhY3RpdmUiLCJpYXQiOjE2ODc4NDQwNjQsImV4cCI6MTY4Nzg0NDA5NCwic3ViIjoiR0M1VDdENVZFTEdETldJV1lXS1RQWTZMNFFINlpSUVZDV0s2UVIzWFJFQzNFRjROUzNTNldJNVQiLCJqdGkiOiIxZDU0YjIzMy1jZDFjLTRiMTQtOWU2Mi1kYmQzODI2OTgwMTgifQ.OD8kEVeeo-26vgQeIg2ar1Y-qU7x3xW7qaIatPU8-6k&lang=en" |
id | String Represents the unique identifier associated with the deposit transaction. It is also used as the transaction ID. Ex: "1d54b233-cd1c-4b14-9e62-dbd382698018" |
transaction | Object |
id | String Represents the unique identifier associated with the deposit transaction. It is also used as the transaction ID. Ex: "1d54b233-cd1c-4b14-9e62-dbd382698018" |
kind | String Represents the type or nature of the transaction. Ex: "deposit" |
status | String Indicates the current status of the deposit transaction. Ex: "incomplete" |
{
"type": "interactive_customer_info_needed",
"url": "https://testanchor.stellar.org/sep24/transactions/deposit/webapp?asset_code=SRT&transaction_id=1d54b233-cd1c-4b14-9e62-dbd382698018&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3Rlc3RhbmNob3Iuc3RlbGxhci5vcmcvc2VwMjQvdHJhbnNhY3Rpb25zL2RlcG9zaXQvaW50ZXJhY3RpdmUiLCJpYXQiOjE2ODc4NDQwNjQsImV4cCI6MTY4Nzg0NDA5NCwic3ViIjoiR0M1VDdENVZFTEdETldJV1lXS1RQWTZMNFFINlpSUVZDV0s2UVIzWFJFQzNFRjROUzNTNldJNVQiLCJqdGkiOiIxZDU0YjIzMy1jZDFjLTRiMTQtOWU2Mi1kYmQzODI2OTgwMTgifQ.OD8kEVeeo-26vgQeIg2ar1Y-qU7x3xW7qaIatPU8-6k&lang=en",
"id": "1d54b233-cd1c-4b14-9e62-dbd382698018",
"transaction": {
"id": "1d54b233-cd1c-4b14-9e62-dbd382698018",
"kind": "deposit",
"status": "incomplete"
}
}