Tour of the API

See how Fanspay API objects fit together and learn best practices for combining them.

The Fanspay APIs are powerful and flexible if you know how to use them. This tour of the API covers key information to help you understand the APIs more deeply:

  • The core concepts we use across the APIs

  • The path a successful payment takes

  • The objects that play a role and how to determine when they’re needed

  • Common patterns and best practices for using those objects together

Understanding these patterns helps you move beyond the pre-written code tutorials. You can migrate old integrations to use more modern patterns, combine simple patterns in novel ways, and plan for future growth.

Core concept

1. Everything is an object

Everything in your Fanspay account is an object, whether you create it with the API or not.

Even low-code and no-code integrations produce these objects. So do actions you perform in the Dashboard. For instance, when you manually create a payment link in the Dashboard, it still creates a PaymentLink object.

2. Objects have lives

Fanspay integrations handle complicated processes.

The API uses a single object to track each process. You create the object at the start of the process, and after every step, you can check its status to see what needs to happen next.

3. Integration is made out of cooperating objects

To accept a payment, a system needs to create several core objects and manage them through several states.

Your Fanspay integration is a system that handles this creation and management by communicating with Fanspay.

Some integrations do a lot more than that: track customers, manage subscriptions, etc. But their core payment functionality still comes from the same objects and steps, with more objects added around that core.

Last updated