Verify Payment
2/7/25Less than 1 minute
Verify Payment
Description
The Verify Payment API confirms the status of a payment using the payment reference obtained from the Initialize Payment response. This ensures that a transaction has been completed successfully before processing an order.
Endpoint
POST /v1/payments/confirm
Required Headers
{
"Authorization": "Bearer JWT_TOKEN",
"X-MerchantApiKey": "MERCHANT_API_KEY",
"Content-Type": "application/json"
}
๐ฅ Request Body
Parameter | Type | Required | Description |
---|---|---|---|
reference | string | Yes | The unique reference ID for the payment. |
Example API Call (Fetch or Axios)
fetch('https://api.shopsynch.com/v1/payments/confirm', {
method: 'POST',
headers: {
'Authorization': 'Bearer JWT_TOKEN',
'X-MerchantApiKey': 'MERCHANT_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
reference: "PAYSTACK_934481IVSFgB"
})
})
.then(response => response.json())
.then(data => console.log(data));
๐ค Sample 200 Response (Success)
{
"message": "Payment confirmation successful",
"status": true
}
โ Sample 400 Response (Invalid Reference)
{
"status": false,
"message": "Invalid reference"
}