curl --request POST \
--url http://localhost:8080/api/v1/payments/{paymentId}/void \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/api/v1/payments/{paymentId}/void"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/api/v1/payments/{paymentId}/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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/payments/{paymentId}/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/api/v1/payments/{paymentId}/void"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/payments/{paymentId}/void")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/payments/{paymentId}/void")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"paymentId": "pay_1234567890abcdef",
"merchantReference": "ORDER-12345",
"amount": 12997,
"currency": "USD",
"status": "VOIDED",
"paymentMethod": {
"type": "card",
"card": {
"bin": "41111111",
"holderName": "John Doe",
"cvvPresentDuringAttempt": true,
"expiryMonth": "12",
"expiryYear": "2030",
"brand": "VISA"
}
},
"captureNow": false,
"descriptor": "MyStore Online",
"goodsType": "MIXED",
"productItems": [
{
"id": "PROD-001",
"name": "Wireless Keyboard",
"quantity": 2,
"unitPrice": 4999,
"goodsType": "PHYSICAL"
},
{
"id": "PROD-002",
"name": "E-Book Subscription",
"quantity": 1,
"unitPrice": 2999,
"goodsType": "DIGITAL"
}
],
"consumer": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
},
"billing": {
"firstName": "John",
"lastName": "Doe",
"address": {
"line1": "123 Main St",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
}
},
"shipping": {
"firstName": "John",
"lastName": "Doe",
"address": {
"line1": "123 Main St",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
}
},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T11:00:00Z"
}{
"error": "INVALID_PAYMENT_ID",
"message": "The paymentId format is invalid",
"details": [
"paymentId must be a valid string",
"paymentId cannot be empty"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "UNAUTHORIZED",
"message": "Invalid or missing authorization token",
"details": [
"Authorization header is required",
"Token has expired",
"Invalid token format"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"details": [
"No payment found with the specified paymentId"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "VOID_NOT_ALLOWED",
"message": "Void cannot be processed",
"details": [
"Payment has already been refunded",
"Payment is not in an authorized state"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "INTERNAL_ERROR",
"message": "An unexpected server error occurred",
"details": [
"Please try again later",
"Contact support if the issue persists"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "PROVIDER_UNAVAILABLE",
"message": "Payment voiding is temporarily unavailable",
"details": [
"Payment provider is experiencing issues",
"Please retry in a few minutes"
],
"timestamp": "2024-01-15T10:30:00Z"
}Void payment
curl --request POST \
--url http://localhost:8080/api/v1/payments/{paymentId}/void \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/api/v1/payments/{paymentId}/void"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/api/v1/payments/{paymentId}/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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/payments/{paymentId}/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/api/v1/payments/{paymentId}/void"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/payments/{paymentId}/void")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/payments/{paymentId}/void")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"paymentId": "pay_1234567890abcdef",
"merchantReference": "ORDER-12345",
"amount": 12997,
"currency": "USD",
"status": "VOIDED",
"paymentMethod": {
"type": "card",
"card": {
"bin": "41111111",
"holderName": "John Doe",
"cvvPresentDuringAttempt": true,
"expiryMonth": "12",
"expiryYear": "2030",
"brand": "VISA"
}
},
"captureNow": false,
"descriptor": "MyStore Online",
"goodsType": "MIXED",
"productItems": [
{
"id": "PROD-001",
"name": "Wireless Keyboard",
"quantity": 2,
"unitPrice": 4999,
"goodsType": "PHYSICAL"
},
{
"id": "PROD-002",
"name": "E-Book Subscription",
"quantity": 1,
"unitPrice": 2999,
"goodsType": "DIGITAL"
}
],
"consumer": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
},
"billing": {
"firstName": "John",
"lastName": "Doe",
"address": {
"line1": "123 Main St",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
}
},
"shipping": {
"firstName": "John",
"lastName": "Doe",
"address": {
"line1": "123 Main St",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
}
},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T11:00:00Z"
}{
"error": "INVALID_PAYMENT_ID",
"message": "The paymentId format is invalid",
"details": [
"paymentId must be a valid string",
"paymentId cannot be empty"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "UNAUTHORIZED",
"message": "Invalid or missing authorization token",
"details": [
"Authorization header is required",
"Token has expired",
"Invalid token format"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"details": [
"No payment found with the specified paymentId"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "VOID_NOT_ALLOWED",
"message": "Void cannot be processed",
"details": [
"Payment has already been refunded",
"Payment is not in an authorized state"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "INTERNAL_ERROR",
"message": "An unexpected server error occurred",
"details": [
"Please try again later",
"Contact support if the issue persists"
],
"timestamp": "2024-01-15T10:30:00Z"
}{
"error": "PROVIDER_UNAVAILABLE",
"message": "Payment voiding is temporarily unavailable",
"details": [
"Payment provider is experiencing issues",
"Please retry in a few minutes"
],
"timestamp": "2024-01-15T10:30:00Z"
}Authorizations
Enter your API token
Path Parameters
32Response
OK
Unique identifier for the payment generated by the system.
32"pay_1234567890abcdef"
Reference passed in by the merchant for correlation.
"ORDER-12345"
Amount processed in the smallest currency unit.
12997
ISO 4217 currency code used in the payment. Currently only USD is supported.
USD "USD"
Current state of the payment.
PENDING, AUTHORIZED, CAPTURED, REFUNDED, VOIDED, FAILED "CAPTURED"
The chosen payment method details (e.g., card). Sensitive fields are masked in responses.
Show child attributes
Show child attributes
Determines how the payment is processed. Default: false → Authorization only (funds reserved, must capture later). If true → Sale (authorize and capture in one step).
true
Text shown on the customer's bank statement (e.g., merchant or product name).
"MyStore Online"
Type of goods being purchased: PHYSICAL = tangible items, DIGITAL = non-physical items, MIXED = combination of both.
PHYSICAL, DIGITAL, MIXED "MIXED"
List of product or service items included in this payment.
Show child attributes
Show child attributes
[
{
"id": "PROD-001",
"name": "Wireless Keyboard",
"quantity": 2,
"unitPrice": 4999,
"goodsType": "PHYSICAL"
},
{
"id": "PROD-002",
"name": "E-Book Subscription",
"quantity": 1,
"unitPrice": 2999,
"goodsType": "DIGITAL"
}
]
Consumer details such as name, email, phone.
Show child attributes
Show child attributes
Billing address information.
Show child attributes
Show child attributes
Shipping address and recipient details.
Show child attributes
Show child attributes
Timestamp when the payment was created.
"2024-01-15T10:30:00Z"
Timestamp when the payment was last updated.
"2024-01-15T11:00:00Z"
Array of transaction attempts made for this payment.
Show child attributes
Show child attributes
[
{
"id": "SALE_eUfZ9n3BCPJo",
"type": "SALE",
"amount": 100,
"result": "FAILED",
"failure": {
"failureCode": "INSUFFICIENT_FUNDS",
"providerFailureCode": "51"
},
"createdAt": "2025-12-15T10:22:10Z"
},
{
"id": "SALE_pU2HnmS8AcpI",
"type": "SALE",
"amount": 100,
"result": "SUCCEEDED",
"createdAt": "2025-12-16T10:00:00Z"
},
{
"id": "REFN_KmOODVdcacz5",
"type": "REFUND",
"amount": 100,
"result": "SUCCEEDED",
"createdAt": "2025-12-17T14:14:14Z"
}
]
Details related to where the payment originated.
Show child attributes
Show child attributes