Void a payment
curl --request POST \
--url https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Duplicate submission"
}
'import requests
url = "https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void"
payload = { "reason": "Duplicate submission" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Duplicate submission'})
};
fetch('https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Duplicate submission'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void"
payload := strings.NewReader("{\n \"reason\": \"Duplicate submission\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Duplicate submission\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Duplicate submission\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amountCents": 10300,
"currency": "USD",
"reason": "Duplicate submission",
"status": "succeeded",
"voidedLineItems": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"amountCents": 7500
},
{
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"amountCents": 2500
}
],
"voidedServiceFeeCents": 300,
"gateway": {
"transactionId": "4938271649"
},
"createdAt": "2024-03-01T12:00:00.000Z"
}
}{
"success": false,
"message": "Payment was declined.",
"details": {
"code": "PAYMENT_DECLINED",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"success": false,
"message": "Payment was declined.",
"details": {
"code": "PAYMENT_DECLINED",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suggestedAction": "refund"
}
}Payments
Void a payment
Cancel a payment before its batch settles. If the payment gateway rejects the void, the API returns 422 VOID_FAILED. The void endpoint does not issue a refund automatically. After settlement, use POST /api/partner/v1/payments/{id}/refund.
POST
/
api
/
partner
/
v1
/
payments
/
{id}
/
void
Void a payment
curl --request POST \
--url https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Duplicate submission"
}
'import requests
url = "https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void"
payload = { "reason": "Duplicate submission" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Duplicate submission'})
};
fetch('https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Duplicate submission'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void"
payload := strings.NewReader("{\n \"reason\": \"Duplicate submission\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Duplicate submission\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apistagepc.grogov.us/api/partner/v1/payments/{id}/void")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Duplicate submission\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amountCents": 10300,
"currency": "USD",
"reason": "Duplicate submission",
"status": "succeeded",
"voidedLineItems": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"amountCents": 7500
},
{
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"amountCents": 2500
}
],
"voidedServiceFeeCents": 300,
"gateway": {
"transactionId": "4938271649"
},
"createdAt": "2024-03-01T12:00:00.000Z"
}
}{
"success": false,
"message": "Payment was declined.",
"details": {
"code": "PAYMENT_DECLINED",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"success": false,
"message": "Payment was declined.",
"details": {
"code": "PAYMENT_DECLINED",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suggestedAction": "refund"
}
}Authorizations
ApiKeyAuthBearerAuth
Send your API key as Authorization: ApiKey pc_<your-key>. The API also accepts the key without the ApiKey prefix. API keys authenticate requests to /api/partner/v1/*. Contact GroGov support to rotate your key or deactivate your API account. Rotation invalidates the previous key. Account deactivation blocks both API keys and access tokens.
Headers
Makes retries safe: a repeated void with the same key replays the original response.
Maximum string length:
255Path Parameters
Payment ID (id).
Body
application/json
Maximum string length:
1000Example:
"Duplicate submission"