Skip to main content

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:
  1. Created: The payment intent has been created in Fype.
  2. Processing: The customer has initiated the payment on the gateway, and Fype is waiting for confirmation.
  3. Succeeded: The payment was successfully captured.
  4. Failed: The payment attempt failed or was declined.
  5. Cancelled: The customer cancelled the payment session.
  6. Expired: The checkout session expired before the payment was completed.

Creating a Payment

Payments are created via the POST /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} Configure a webhook listener for payment.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_id in your database alongside your order record.
  • Implement Idempotency: Use the Idempotency-Key header to safely retry requests if you experience network issues.
  • Handle All States: Ensure your application logic can handle processing, failed, and expired states gracefully.