Withdraw
The Withdraw API is used to initiate the withdrawal process following the SEP-24 protocol. By invoking this API, users can initiate a withdrawal 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 withdrawal request. Ex: "701001" |
asset Mandatory | String Represents the digital asset for the withdrawal transaction. Ex: "SRT" |
- cURL
- C#
- Go
- NodeJs
curl --location '{{url}}/rpc/WalletService/WithdrawProcess' \
--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/WithdrawProcess", 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/WithdrawProcess"
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/WithdrawProcess',
'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 customer information required for the withdrawal process. Ex: "interactive_customer_info_needed" |
url | String Represents the URL that provides an interactive web application for the withdrawal process. Ex: "https://testanchor.stellar.org/sep24/transactions/withdraw/webapp?asset_code=SRT&transaction_id=5d8f2a41-7dcc-41e8-adcc-398eaf717f8f&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3Rlc3RhbmNob3Iuc3RlbGxhci5vcmcvc2VwMjQvdHJhbnNhY3Rpb25zL3dpdGhkcmF3L2ludGVyYWN0aXZlIiwiaWF0IjoxNjg3NjkzOTcwLCJleHAiOjE2ODc2OTQwMDAsInN1YiI6IkdDNVQ3RDVWRUxHRE5XSVdZV0tUUFk2TDRRSDZaUlFWQ1dLNlFSM1hSRUMzRUY0TlMzUzZXSTVUIiwianRpIjoiNWQ4ZjJhNDEtN2RjYy00MWU4LWFkY2MtMzk4ZWFmNzE3ZjhmIn0.5oCfSsVbqgv5_y-wWVqLJa0O-n-8PjNL2UXMx-Gr3dI&lang=en" |
id | String Represents the unique identifier for the withdrawal transaction. Ex: "5d8f2a41-7dcc-41e8-adcc-398eaf717f8f" |
transaction | Object |
id | String Represents the unique identifier for the withdrawal transaction. Ex: "5d8f2a41-7dcc-41e8-adcc-398eaf717f8f" |
kind | String Represents the type of transaction. Ex: "withdrawal" |
status | String Represents the status of the withdrawal transaction. Ex: "incomplete" |
withdraw_memo_type | String Represents the type of withdrawal memo. Ex: "hash" |
{
"type": "interactive_customer_info_needed",
"url": "https://testanchor.stellar.org/sep24/transactions/withdraw/webapp?asset_code=SRT&transaction_id=5d8f2a41-7dcc-41e8-adcc-398eaf717f8f&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3Rlc3RhbmNob3Iuc3RlbGxhci5vcmcvc2VwMjQvdHJhbnNhY3Rpb25zL3dpdGhkcmF3L2ludGVyYWN0aXZlIiwiaWF0IjoxNjg3NjkzOTcwLCJleHAiOjE2ODc2OTQwMDAsInN1YiI6IkdDNVQ3RDVWRUxHRE5XSVdZV0tUUFk2TDRRSDZaUlFWQ1dLNlFSM1hSRUMzRUY0TlMzUzZXSTVUIiwianRpIjoiNWQ4ZjJhNDEtN2RjYy00MWU4LWFkY2MtMzk4ZWFmNzE3ZjhmIn0.5oCfSsVbqgv5_y-wWVqLJa0O-n-8PjNL2UXMx-Gr3dI&lang=en",
"id": "5d8f2a41-7dcc-41e8-adcc-398eaf717f8f",
"transaction": {
"id": "5d8f2a41-7dcc-41e8-adcc-398eaf717f8f",
"kind": "withdrawal",
"status": "incomplete",
"withdraw_memo_type": "hash"
}
}