VOID Payment
This API is used to void an existing 'Provisional Credit' transaction. It is identified by the unique 'Provisional Credit referenceId' and 'customerId'.
Method: POST
{{URL}}/jsonrpc
Example
Request Parameters
Parameter | Description |
---|---|
method Mandatory | String RPC method name Constant Value : "TransactionService.Payment" |
id Mandatory | String Unique ID for the request |
params.api Mandatory | Object API authentication block |
params.api.signature Mandatory | String Sign the request payload (params.payload) using private key. Sample Value: "MEQCIAbpxHpdOyBEVlmxPYv7m4Z1OvWJJYw7g7u3GE3T9nmvAiBjKHckSvb1M6O4t7FeWsn2z9Y3dMeYn3HyX/k28ek/Dw==" |
params.api.keyId Mandatory | String Key ID is provided at the time of device registration. Sample Value : "348076" |
params.api.credential Mandatory | String Basic (space) [( "<Username>:<apiKey>" ) as Base64 encoded value] to be provided Sample Value: "Basic bmF2eWEubitlbXBAbmV0eGQuY29tOmY1OWIwY2NlOTU4ZTQ1YTc4MGVhZWIzYWVjOWVjZDAx" |
params.api.apiKey Mandatory | String API key is provided at the time of device registration. Sample Value : "f59b0cce958e45a780eaeb3aec9ecd01" |
params.payload.type Mandatory | String Type of transaction. Constant Value - "VOID" |
params.payload.referenceId Mandatory | String Unique Reference ID of PROVISIONALCREDIT transaction. Sample Value : "65323564567089"_ |
params.payload.customerId Mandatory | String Unique id of customer. Sample Value : "100000000076002" |
params.payload.notes Optional | String Purpose of the transaction. Sample Value : "Settlement" |
- cURL
- C#
- Go
- NodeJS
curl --location 'http://localhost:5020/PL/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{"method":"TransactionService.Payment","id":"1","params":{"api":{"signature":"MEUCIFt47d3wHdgzwh3nK9Dipfm2KBWV8r/Ner4YLS374fO6AiEAzZPI6aTITZBJBCqGbo53ECEzahs5bsDxhTGNGRtryxA=","keyId":"140","credential":"Basic UEw6YTY4ZTFmODkzYTQ4NGUyOTgxYzczZWNlNjU5ZWI2ZDg=","apiKey":"a68e1f893a484e2981c73ece659eb6d8"},"payload":{"type":"VOID","referenceId":"REF_90011014","customerId":"100000000004001","notes":"void payment"}}}'
var options = new RestClientOptions("http://localhost:5020")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/PL/jsonrpc", Method.Post);
request.AddHeader("Content-Type", "application/json");
var body = @"{""method"":""TransactionService.Payment"",""id"":""1"",""params"":{""api"":{""signature"":""MEUCIFt47d3wHdgzwh3nK9Dipfm2KBWV8r/Ner4YLS374fO6AiEAzZPI6aTITZBJBCqGbo53ECEzahs5bsDxhTGNGRtryxA="",""keyId"":""140"",""credential"":""Basic UEw6YTY4ZTFmODkzYTQ4NGUyOTgxYzczZWNlNjU5ZWI2ZDg="",""apiKey"":""a68e1f893a484e2981c73ece659eb6d8""},""payload"":{""type"":""VOID"",""referenceId"":""REF_90011014"",""customerId"":""100000000004001"",""notes"":""void payment""}}}";
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 := "http://localhost:5020/PL/jsonrpc"
method := "POST"
payload := strings.NewReader(`{"method":"TransactionService.Payment","id":"1","params":{"api":{"signature":"MEUCIFt47d3wHdgzwh3nK9Dipfm2KBWV8r/Ner4YLS374fO6AiEAzZPI6aTITZBJBCqGbo53ECEzahs5bsDxhTGNGRtryxA=","keyId":"140","credential":"Basic UEw6YTY4ZTFmODkzYTQ4NGUyOTgxYzczZWNlNjU5ZWI2ZDg=","apiKey":"a68e1f893a484e2981c73ece659eb6d8"},"payload":{"type":"VOID","referenceId":"REF_90011014","customerId":"100000000004001","notes":"void payment"}}}`)
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 http = require('follow-redirects').http;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'localhost',
'port': 5020,
'path': '/PL/jsonrpc',
'headers': {
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = http.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": "TransactionService.Payment",
"id": "1",
"params": {
"api": {
"signature": "MEUCIFt47d3wHdgzwh3nK9Dipfm2KBWV8r/Ner4YLS374fO6AiEAzZPI6aTITZBJBCqGbo53ECEzahs5bsDxhTGNGRtryxA=",
"keyId": "140",
"credential": "Basic UEw6YTY4ZTFmODkzYTQ4NGUyOTgxYzczZWNlNjU5ZWI2ZDg=",
"apiKey": "a68e1f893a484e2981c73ece659eb6d8"
},
"payload": {
"type": "VOID",
"referenceId": "REF_90011014",
"customerId": "100000000004001",
"notes": "void payment"
}
}
});
req.write(postData);
req.end();
Body
{
"method": "TransactionService.Payment",
"id": "1",
"params": {
"api": {
"signature": "{{signature}}",
"keyId": "{{DeviceID}}",
"credential": "{{Credential}}",
"apiKey": "{{ApiKey}}"
},
"payload": {
"type": "VOID",
"ReferenceId": "65323564568000",
"CustomerId": "100000000076002",
"Notes": "void payment"
}
}
}
Response: 200
Response Parameters
Parameter | Description |
---|---|
Status | String Status of the void request (e.g., COMPLETED) |
TransactionID | String Unique ID for the void transaction |
transactionNumber | String System-generated transaction number |
referenceID | String New reference ID assigned to the void |
isPartial | Boolean Indicates if the void was partially successful |
{
"id": "1",
"result": {
"status": "COMPLETED",
"TransactionID": "15393647",
"transactionNumber": "QA00000002412010",
"referenceID": "1754894295066",
"isPartial": false
},
"jsonrpc": "2.0"
}