You might want to get the status of a payment request upon receiving webhooks. Use this endpoint to fetch the current status of a transfer. The same path is callable with either a secret key or a public key; the response shape differs slightly between the two — see Responses below.
| Name | Type | Required | Description |
|---|---|---|---|
| reference | string | Yes | Your reference or the PVB reference (pvb_reference or pvb_third_party_reference from the webhook payload). |
curl -X GET "https://api.piggyvest.business/api/v1/pocket/transfer/status/your-reference" \-H "Authorization: Bearer YOUR_SECRET_KEY"import axios from 'axios'const secretKey = process.env.PVB_SECRET_KEYconst url = `${process.env.PVB_BASE_URL}/api/v1/pocket/transfer/status/:reference`await axios.get(url, { headers: { 'Authorization': `Bearer ${secretKey}`, },})The response shape depends on which key you authenticate with. The two variants below describe the same endpoint called as either an API (secret key) request or a checkout (public key) request.
Server-to-server calls authorized with your secret key return the standard status / message / data envelope used elsewhere in the API.
{ "status": true, "message": "Payment request found", "data": { "payment_request": { "id": "f461f152-1c89-418e-8a26-ec2f560683eb", "reference": "pvfb_89259283-8702-4472-af66-41edd8784f221729962149844", "third_party_reference": "101029928283737373636533", "status": "successful", "amount": 20000, "tag": "mazigraphql", "narration": "Success test", "product_name": "Chinex Electronics", "wallet_id": "3b8251aa-b373-495b-9525-1221fe799f31", "meta": null } }}When called with a public key (browser / checkout flow), the response follows the Pocket / service raw shape rather than the standard envelope. The status field reflects the Pocket-provider status string instead of a boolean. A representative shape:
{ "status": "<from-pocket-provider>", "data": { "payment_request": { "id": "string", "reference": "string", "third_party_reference": "string", "status": "string", "amount": 0, "tag": "string", "narration": "string", "product_name": "string | null", "wallet_id": "string", "meta": null } }}{ "status": false, "message": "Payment request not found"}{ "status": false, "message": "We are unable to process your request. please try again later or contact support"}The payment_request.status field in the response can be one of: