Welcome to the ShaPay Developer Reference. Our payment API is organized around clean HTTPS POST requests with predictable JSON payloads, scoped Brand API Keys, and idempotent verification.
Base Checkout Gateway URL
All payment creation and verification calls are sent to https://pay.shapay.me. Never expose your API-KEY in public client-side code.
CORE ENDPOINTS
POSThttps://pay.shapay.me/api/payment/create
Initializes a hosted checkout session and returns a redirect payment_url + transaction_id.
POSThttps://pay.shapay.me/api/payment/verify
Verifies a transaction receipt server-to-server and returns final settlement status (COMPLETED, PENDING, or ERROR).
OVERVIEW
Authentication
Authenticate every API request by supplying your scoped Brand key inside the API-KEY HTTP request header.
Finding Your Brand API Key
Log in to Merchant Portal → Brands, create or select your storefront brand, and copy its active Brand Key. You can rotate keys anytime with zero downtime to other brands.
REQUIRED HEADERS
API-KEYstringrequired
Scoped Brand API Key associated with your merchant brand profile.
Content-Typestringrequired
Must be application/json for all JSON request bodies.
INTEGRATION GUIDES
Webhooks & Callbacks
When a customer completes or cancels a payment, ShaPay notifies your webhook_url and redirects the browser to success_url or cancel_url with query parameters.
Never trust browser query strings alone. Inside your callback handler, call POST /api/payment/verify with transaction_id, verify status === "COMPLETED", and confirm amount matches your local order total.
INTEGRATION GUIDES
Official Plugins & Downloads
Download pre-built integration packages directly from ShaPay:
WordPress / WooCommerce
Installable WooCommerce payment gateway ZIP with instant callback verification.
Creates a new checkout transaction bound to your Brand and returns a hosted payment_url where your customer completes payment. Edit any field below to update the live code sample on the right.
HEADERS
API-KEYstringrequired
Your Brand API Key from Merchant Portal → Brands.
BODY PARAMS
cus_namestringrequired
Customer full name displayed on receipt.
cus_emailstringrequired
Customer email address.
amountnumberrequired
Payable amount (greater than 0, up to 1,000,000).
success_urlstringrequired
Redirect URL when checkout finishes.
cancel_urlstringrequired
Redirect URL if customer cancels checkout.
webhook_urlstring
Optional server-to-server notification endpoint.
metadatajson object
Custom JSON object (e.g. {"order_id": "1042"}) echoed back on verify.
RESPONSES
Returns status: 1, unique transaction_id, currency, and hosted payment_url.
Returns status: 0 with a descriptive message when required fields or valid Brand credentials are missing.
VERIFY PAYMENT API
Verify Payment
POSThttps://pay.shapay.me/api/payment/verify
Server-Side Receipt Verification
Verifies a transaction using its transaction_id and returns customer details, amount, payment method, metadata, and authoritative status (COMPLETED, PENDING, or ERROR).
HEADERS
API-KEYstringrequired
Same Brand API Key used to create the checkout.
BODY PARAMS
transaction_idstringrequired
Transaction ID returned at creation or callback query string.
RESPONSES
Returns cus_name, cus_email, amount, transaction_id, metadata, currency, payment_method, and status.
Returns {"status": 0, "message": "failed"} if the transaction does not belong to the authenticated Brand.
ANDROID BRIDGE API
Connect Device
POSThttps://shapay.me/api/device-connect
Used automatically by the ShaPay Android Sync APK to pair a merchant phone using its scoped device_key.
ANDROID BRIDGE API
Push SMS Receipt
POSThttps://shapay.me/api/add-data
Receives incoming financial SMS messages from an authenticated Android Bridge device to settle matching pending MFS/bank checkouts in real time.