How to create callback endpoint
This guide explains what your website endpoint must do to receive completion callbacks from our system.
What is a callback endpoint?
It is a URL in your website/backend that we call (via GET) after successful matching when a transaction becomes completed.
Its main purpose: receive transaction data and execute your business action in your DB (for example: balance top-up, order completion, service activation).
Where should this endpoint live?
It should be implemented in your backend (not frontend/client-side code).
Example paths:
/payment/callback/api/vfc/callback/wallet/topup/callback
For WordPress with our plugin, the path is usually /wp-json/vodafoncash/v1/callback on your site; the store Website type “WordPress” option in the tenant UI helps prefill that URL—see WordPress integration.
Expected request shape (generic example)
Exact field names can vary by store settings/version, but this is a practical reference format.
GET https://your-site.com/payment/callback?transaction_id=123&phone=01000000000&amount=100¤cy=EGP&store_id=2&user_name=customer_001&status=completedWhat your endpoint should do
When request arrives:
- Read query parameters.
- Validate expected status (for example
status=completed). - Execute your business logic:
- increase balance
- complete order
- activate service
- Save internal request log.
- Return
200 OK.
Validation and security (important)
- Never rely on frontend for this logic.
- Validate/process on backend only.
- Use unique transaction identifiers (
transaction_id) to prevent duplicates. - Keep endpoint idempotent (same request twice should not duplicate credits/orders).
Quick endpoint test
Before configuring it in store settings:
- Call endpoint manually using browser/Postman with sample query.
- Confirm DB updates correctly.
- Confirm endpoint returns
200 OK.
Then put it in your store settings as callback endpoint.