{"api_version":"1.0","base_url_hint":"Set X-API-Key header for authenticated endpoints.","tools":[{"name":"create_payment","description":"Creates a new sPay payment charge. Returns a payment_id, a unique email alias for the customer to send the PDF, and a pay_url to redirect the customer.","parameters":{"type":"object","properties":{"amount":{"type":"number","description":"Amount in Kz (Kwanzas). Must be greater than 0."},"expires_in_minutes":{"type":"integer","description":"Expiry time in minutes. Accepted range: 5 to 1440 (24h). Default: 15.","default":15},"description":{"type":"string","description":"Optional order description shown on the hosted checkout page."}},"required":["amount","expires_in_minutes"]},"http":{"method":"POST","path":"/api/payments","auth":"X-API-Key"}},{"name":"get_payment_status","description":"Checks the current status of a payment by its payment_id. Returns status: pending, paid, or expired. Does not require authentication.","parameters":{"type":"object","properties":{"payment_id":{"type":"string","description":"The payment_id returned by create_payment."}},"required":["payment_id"]},"http":{"method":"GET","path":"/api/payments/{payment_id}","auth":"none"}},{"name":"list_payments","description":"Lists all payments for the authenticated merchant. Supports filtering by status and pagination.","parameters":{"type":"object","properties":{"status":{"type":"string","enum":["pending","paid","expired"],"description":"Filter payments by status."},"limit":{"type":"integer","default":50,"description":"Maximum results to return."},"offset":{"type":"integer","default":0,"description":"Pagination offset."}}},"http":{"method":"GET","path":"/api/payments","auth":"X-API-Key"}},{"name":"verify_webhook_signature","description":"Logic to verify the HMAC-SHA256 signature of incoming sPay webhooks. Compute HMAC-SHA256 of JSON.stringify(body, sort_keys=True) using your webhook secret. Compare with X-SPay-Signature header.","parameters":{"type":"object","properties":{"payload":{"type":"object","description":"The parsed JSON body from the webhook POST request."},"signature":{"type":"string","description":"Value of the X-SPay-Signature header."},"secret":{"type":"string","description":"Your webhook secret (whsec_...)."}},"required":["payload","signature","secret"]},"http":"client-side-only"}]}