# Figure Pay Banking API
Welcome to Figure Pay! Our Banking API is a “bank-in-a-box” solution that simplifies creating a custom banking, payments, and card experience. This documentation provides a preliminary, high-level overview of the features we plan to provide in our upcoming release. Please discuss launch dates and roadmaps with your Program Manager.
**Note:** that these API descriptions, endpoints, flows are pre-release and are susceptible to (breaking) changes.
## Programs
A **Program** represents your integration with the Figure Pay Banking API.
API developers are supplied with API credentials which are associated with your `program_id`.
You will work with a Program manager to integrate with our sandbox API environment, learn about upcoming features, and facilitate any questions your team might have about integrating with our API.
## Profiles
A profile represents an entity such as an end user or business that you register. These profiles, or end user customer/business accounts, transact with each other through P2P or invoicing.
Personal information is collected in order to perform [KYC/AML](https://hackmd.io/3aIgkg-HSHisf8NlgtVyKw#KYC--AML) checks as well as enroll and ship Visa debit cards to your users. Your program manager will walk you through KYC requirements specific to your program.
### Register a Profile
```
POST /profiles
```
Submit a profile with relevant personally identifiable information (PII). This will register the profile if no other profile matches its PII.
### Retreive profiles
```
GET /profiles
```
Fetch a limited set of metadata for all profiles that your program has registered and manages.
This response will be paginated.
### Retrieve an individual profile
```
GET /profiles/:profile_id
```
Fetch a limited set of metadata from the requested profile.
## Accounts
Accounts represent wallets on the Provenance blockchain.
Accounts are associated with **Profiles** (users and business you create), as well as your **Program**.
Transactions are ledgered per account.
### Create an account
```
POST /accounts
```
Create an **Account** and associate it with a **Profile** you've created on behalf of your end-users.
### Retrieve an account
```
GET /accounts/:account_id
```
Fetch account information including balance, ACH account and routing numbers, and associated **Profile(s)**.
## Intra (P2P) Payment
Intra, or P2P, payments are transactions where money moves directly, and immediately between two customer accounts in the Figure Pay system.
### Initiate a transaction
```
POST /transactions
```
Specify the sender and recieving accounts along with the amount to initiate a intra system payment.
## Invoicing
Invoices are generted by `business` **Profiles** so that they can be presented, via QR code, to a powered by Figure Pay `user` **Profiles** for authorization. These invoices are to be used by end user customers to pay for goods or services received from a business end user.
### Generate an Invoice
```
POST /invoices
```
Generate an invoice with amount and other relevant metadata. The response will contain information that can be used by our client-side QR code generation library.
### Retrieve an Invoice
```
GET /invoices/:invoice_id
```
Fetch an invoice from the API to check its status or gather metadata required to re-display its contents and re-generate a QR code.
### Submit Invoice transaction
```
POST /transactions
```
Similar to an intra payment specify the paying account and the invoice ID to move funds from **Profile** to **Profile**.
## Inbound/Outbound ACH
ACH is used to facilitate the movement of funds between a **Profile's** account and their external bank accounts.
**Note**: The API for registering and fetching external bank accounts is temporary and will soon be replaced by an integration via [Plaid](https://plaid.com/). The integration will require both changes to our API and changes to your client-side applications. Please discuss timelines and details with your program manager.
### Register an external bank account
```
POST /profiles/:profile_id/external-accounts
```
Submit the account and routing number for a **Profile's** external bank account.
### Retrieve an external bank account
```
POST /profiles/:profile_id/external-accounts
```
Fetch metadata (name, last four of account number) for external bank accounts linked to a Profile.
### Initiate Inbound ACH transaction
```
POST /transactions/ach
{ ... type: INBOUND ... }
```
Initate an inbound ACH transfer from the Profile's linked external bank account to their Figure Pay account. The account will be credited once funds are transferred from the external bank account to Figure Pay.
### Initiate Outbound ACH transaction
```
POST /transactions/ach
{ ... type: OUTBOUND ... }
```
Initate an outbound ACH transfer from the Profile's linked external bank account to their Figure Pay account. Funds will be held from the account balance immediately and transferred out shortly after the transaction is submitted.
## KYC / AML
The Figure Pay Core Banking API offers the ability to perform the required KYC / AML banking regulatory and compliance checks necessary to open accounts for your end users.
**Note:** this feature is still a work-in-progress. Please discuss timelines and deliverables with your program manager.
## Visa Debit Cards
THe Figure Pay Core Banking API offers the ability to generate and issue Visa debit cards for your users per **Account**.
Our internal banking system will be responsible for managing full service card and transaction management, including transaction authorizations, clearings, etc.
On the client-side you will be able to programatically issue cards on behalf of your **Profiles** and their **Accounts** via our API.
**Note:** this feature is still a work-in-progress. Please discuss timelines and deliverables with your program manager.