Update Account Category
'UpdateAccountCategory' API enables to change the category (setting product) of an account
Account Category (Product) - Global level setting is done and a category (product) name is given to the setting. This category can be mapped with any required account.
Bank or financial institution can change the category (setting product) that is mapped with an account. On providing the request with the account number and the account category to be updated, the account category is changed with the generation of success message.
Method: POST
{{URL}}/jsonrpc
Headers
Name | Value |
---|---|
Content-Type | application/json |
Example
Payload Parameters
Parameter | Description |
---|---|
method Mandatory | String API method that is being called to update account category through account service Constant value: "AccountService.UpdateAccountCategory" |
id Mandatory | String Unique ID of API request Sample value: "1" |
params Mandatory | Object |
api Mandatory | Object |
signature Mandatory | String Signature for request validation Sample value: "signature" |
keyId Mandatory | String API key used for request authentication Sample value: "ApplicationKeyId" |
credential Mandatory | String API credential provided by NetXD Sample value: "Credential" |
payload Mandatory | Object |
AccountNumber Mandatory | String Account number of the account that requires an update/change of category Sample value: 200656417727934 |
AccountCategory Mandatory | String Required category that to be updated for the account Sample value: DEFAULT |
- cURL
- C#
- Go
- NodeJS
curl --location --globoff '{{URL}}/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{"method":"AccountService.UpdateAccountCategory","id":"1","params":{"api":{"signature":"{{signature}}","keyId":"{{ApplicationKeyId}}","credential":"{{Credential}}"},"payload":{"AccountNumber":"200656417727934","AccountCategory":"DEFAULT"}}}'
var options = new RestClientOptions("{{URL}}/jsonrpc")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""method"": ""AccountService.UpdateAccountCategory"",
" + "\n" +
@" ""id"": ""1"",
" + "\n" +
@" ""params"": {
" + "\n" +
@" ""api"": {
" + "\n" +
@" ""signature"": ""{{signature}}"",
" + "\n" +
@" ""keyId"": ""{{ApplicationKeyId}}"",
" + "\n" +
@" ""credential"": ""{{Credential}}""
" + "\n" +
@" },
" + "\n" +
@" ""payload"": {
" + "\n" +
@" ""AccountNumber"": ""200656417727934"",
" + "\n" +
@" ""AccountCategory"": ""DEFAULT""
" + "\n" +
@" }
" + "\n" +
@" }
" + "\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}}/jsonrpc"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"method": "AccountService.UpdateAccountCategory",`+"
"+`
"id": "1",`+"
"+`
"params": {`+"
"+`
"api": {`+"
"+`
"signature": "{{signature}}",`+"
"+`
"keyId": "{{ApplicationKeyId}}",`+"
"+`
"credential": "{{Credential}}"`+"
"+`
},`+"
"+`
"payload": {`+"
"+`
"AccountNumber": "200656417727934",`+"
"+`
"AccountCategory": "DEFAULT"`+"
"+`
}`+"
"+`
}`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
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': '/jsonrpc',
'headers': {
'Content-Type': 'application/json'
},
'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({
"method": "AccountService.UpdateAccountCategory",
"id": "1",
"params": {
"api": {
"signature": "{{signature}}",
"keyId": "{{ApplicationKeyId}}",
"credential": "{{Credential}}"
},
"payload": {
"AccountNumber": "200656417727934",
"AccountCategory": "DEFAULT"
}
}
});
req.write(postData);
req.end();
Body
{
"method": "AccountService.UpdateAccountCategory",
"id": "1",
"params": {
"api": {
"signature": "{{signature}}",
"keyId": "{{ApplicationKeyId}}",
"credential": "{{Credential}}"
},
"payload": {
"AccountNumber": "200656417727934",
"AccountCategory": "DEFAULT"
}
}
}
Response: 200
Response Parameters
Parameter | Description |
---|---|
id | String Response ID echoed from the request ID Sample value: "1" |
result | Object |
Message | String Response message confirms that the account is updated successfully with the update/change of category Sample value: "Account updated Successfully" |
{
"id": "1",
"result": {
"Message": "Account updated Successfully"
}
}