[Quable x Stripe](#quable-x-stripe)
[How to link Quable partner to your Stripe account](#how-to-link-quable-partner-to-your-stripe-account)
[How to receive payment](#how-to-received-payment-)
-- [One time payment](#one-time-payment)
-- [Subscription payment](#subscription-payment)

---

!!!warning Available in beta only
This is available in beta for now. Be aware that some performance issues might occur.
!!!

---

## Quable x Stripe

**Stripe** is a leading tech firm offering a sturdy platform for processing online payments and establishing financial infrastructure. **Quable Payment**, on the other hand, is an integrated payment solution that harnesses the potent functionalities of Stripe, thereby providing a thorough and secure payment experience for Quable's partners.

---

## How to link Quable partner to your Stripe account

Quable payment is only accessible through its API at [https://billing.quable.io](https://billing.quable.io).

To link your stripe account with Before you begin, ensure you have the following:

- **Quable Partner ID**: Get it from your partner dashboard
- **Quable Partner API Secret**: Get it from your partner dashboard

Then, make a authenticated post request on endpoint `/account-link`

- ![Authenticated post request](https://i.imgur.com/nhDm1MQ.png)

This request will return the following response :

```json
{
    "status": "ACCOUNT_LINK_INCOMPLETE",
    "message": "Follow the link provided and complete your stripe account information",
    "url": "https://connect.stripe.com/setup/s/acct_1kpfTsIhWHJvfsSR/7TzKra9iXi2R"
}
```

**Open the link in browser to complete the process.**

---

## How to received payment ?

Two payment methods are available: one-time payments and subscription payments. Each method generates a unique link that can be share to customer for the completion of the payment process.

### One time payment

#### To initiate a one-time payment, the following payload can be used:

```json
{
  "appId": "demo-app",
  "customer": "demo",
  "price": {
    "priceData": {
      "product": {
        "name": "App payment",
        "description": "Payment for app",
        "images": []
      },
      "amount": 15,
      "currency": "EUR"
    }
  },
  "appCheckoutId": "9363ee98-8ca0-4284-94d1-879bd774a6aa",
  "quantity": 1,
}
```

You will get an url to share with customer

![Initiate a one-time payment](https://i.imgur.com/RRsAmSM.png)

---

#### Retrieve a list of one time payments 

You can use the following payload for filtering:

```json
{
  "customer": "<customer>",
  "appId": "<custom-app-id>",
  "status": "paid"
}
```

and you will get the list of payments.

![Retrieve a list of one time payments](https://i.imgur.com/59CXc6l.png)

---

### Subscription payment

For initiating a subscription payment,the following payload can be used:

```json
{
  "appId": "demo-app",
  "customer": "demo",
  "price": {
    "priceData": {
      "product": {
        "name": "App Pay Monthly",
        "description": "Application pay subscription test",
        "images": []
      },
      "amount": 10,
      "currency": "EUR"
    }
  },
  "quantity": 1,
  "interval": "MONTHLY",
  "appCheckoutId": "9363ee9-8ca0-4284-94d1-879bd774a6aa",
}
```

![Initiate a subscription payment](https://i.imgur.com/dCnO1fy.png)

To retrieve a list of subscription payments you can use the following payload for filtering:

```json
{
  "customer": "",
  "appId": "",
  "status": "paid"
}
```

![Retrieve a list of subscription payments](https://i.imgur.com/snNSQZo.png)
