Documentation Index
Fetch the complete documentation index at: https://docs.fype.dev/llms.txt
Use this file to discover all available pages before exploring further.
Payments
Payments are the core entity in Fype. They represent an intent to collect money from a customer.Payment Lifecycle
A payment can transition through the following states:- Created: The payment intent has been created in Fype.
- Processing: The customer has initiated the payment on the gateway, and Fype is waiting for confirmation.
- Succeeded: The payment was successfully captured.
- Failed: The payment attempt failed or was declined.
- Cancelled: The customer cancelled the payment session.
- Expired: The checkout session expired before the payment was completed.
Creating a Payment
Payments are created via thePOST /v1/payments endpoint. When you create a payment, Fype:
- Validates your request.
- Generates a unique
checkout_session. - Returns a
checkout_url.
Monitoring Payments
Via Dashboard
The Payments tab in the dashboard provides a real-time view of all transactions. You can filter by status and date range.Via API
You can fetch the latest status of any payment using its ID:GET /v1/payments/{payment_id}
Via Webhooks (Recommended)
Configure a webhook listener forpayment.succeeded and payment.failed events to automate your business logic.
Best Practices
- Use Reference IDs: Always provide your own
reference_id(e.g., your Order ID) to make reconciliation easier. - Store Fype IDs: Save the Fype
payment_idin your database alongside your order record. - Implement Idempotency: Use the
Idempotency-Keyheader to safely retry requests if you experience network issues. - Handle All States: Ensure your application logic can handle
processing,failed, andexpiredstates gracefully.