Cancel Virtual Account
1 min
code examples curl request delete \\ \ url https //dev nicepay co id/nicepay/api/v1 0/transfer va/delete va \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'x timestamp 2024 03 05t14 15 40+07 00' \\ \ header 'x signature 4inuztse4h9ymrbqryhtyubq/dce0bekf2cl1l4ojs2n84nzruskvvj9n2kdrrqqws5bsu43idshtzf2thokbw==' \\ \ header 'x partner id tniceva023' \\ \ header 'x external id 20240304181404' \\ \ header 'channel id tniceva023' \\ \ data '{ "partnerserviceid" "", "customerno" "", "virtualaccountno" "9912391111111111", "trxid" "2020102900000000000001" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("x timestamp", "2024 03 05t14 15 40+07 00"); myheaders append("x signature", "4inuztse4h9ymrbqryhtyubq/dce0bekf2cl1l4ojs2n84nzruskvvj9n2kdrrqqws5bsu43idshtzf2thokbw=="); myheaders append("x partner id", "tniceva023"); myheaders append("x external id", "20240304181404"); myheaders append("channel id", "tniceva023"); var raw = json stringify({ "partnerserviceid" "", "customerno" "", "virtualaccountno" "9912391111111111", "trxid" "2020102900000000000001" }); var requestoptions = { method 'delete', headers myheaders, body raw, redirect 'follow' }; fetch("https //dev nicepay co id/nicepay/api/v1 0/transfer va/delete va", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //dev nicepay co id/nicepay/api/v1 0/transfer va/delete va") https = net http new(url host, url port) https use ssl = true request = net http delete new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["x timestamp"] = "2024 03 05t14 15 40+07 00" request\["x signature"] = "4inuztse4h9ymrbqryhtyubq/dce0bekf2cl1l4ojs2n84nzruskvvj9n2kdrrqqws5bsu43idshtzf2thokbw==" request\["x partner id"] = "tniceva023" request\["x external id"] = "20240304181404" request\["channel id"] = "tniceva023" request body = json dump({ "partnerserviceid" "", "customerno" "", "virtualaccountno" "9912391111111111", "trxid" "2020102900000000000001" }) response = https request(request) puts response read body import requests import json url = "https //dev nicepay co id/nicepay/api/v1 0/transfer va/delete va" payload = json dumps({ "partnerserviceid" "", "customerno" "", "virtualaccountno" "9912391111111111", "trxid" "2020102900000000000001" }) headers = { 'accept' 'application/json', 'content type' 'application/json', 'x timestamp' '2024 03 05t14 15 40+07 00', 'x signature' '4inuztse4h9ymrbqryhtyubq/dce0bekf2cl1l4ojs2n84nzruskvvj9n2kdrrqqws5bsu43idshtzf2thokbw==', 'x partner id' 'tniceva023', 'x external id' '20240304181404', 'channel id' 'tniceva023' } response = requests request("delete", url, headers=headers, data=payload) print(response text) responses // successful { "responsecode" "2003100", "responsemessage" "successful", "virtualaccountdata" { "partnerserviceid" "", "customerno" "", "virtualaccountno" "7001400002007725", "trxid" "2023123100000000000001", "additionalinfo" { "txidva" "tniceva02302202403061508052242", "cancelmessage" "cancel va", "cancelvatime" "2024 03 06t15 08 05+07 00", "totalamount" { "value" "10000 00", "currency" "idr" } } } }// request in progress { "responsecode" "202xx00", "responsemessage" "request in progress" }// duplicate partnerreferenceno { "responsecode" "409xx01", "responsemessage" "duplicate partnerreferenceno" }// general error { "responsecode" "500xx00", "responsemessage" "general error" }// request timeout { "responsecode" "504xx00", "responsemessage" "request timeout" }