> For the complete documentation index, see [llms.txt](https://docs.mburger.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mburger.cloud/api-docs-1/integrations-extensions/stripe/payment.md).

# Payment

{% hint style="info" %}
How to create a new Stripe payment for the logged user
{% endhint %}

Calling this API will immediately charge the user for the amount of the product.

For the billing lifecycle please refer to [Stripe documentation](https://stripe.com/docs/billing/lifecycle)

{% tabs %}
{% tab title="Request" %}
`POST https://mburger.cloud/api/payments`

```bash
curl https://mburger.cloud/api/payments
-X POST
-H "Accept: application/json" 
-H "X-MBurger-Token: <token>" 
-H "X-MBurger-Version: 3"
-H "Authorization: Bearer <JWT>"
-d '<data>' 
```

#### &#x20;Parameters

| Name         | Type   | Required | Description                                                                                                                      |
| ------------ | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| name         | string | Yes      | Payment identifier chosen on Stripe dashboard.                                                                                   |
| amount       | int    | Yes      | Amount to charge for single product.                                                                                             |
| quantity     | int    | Yes      | Quantity of products.                                                                                                            |
| token        | string | No       | Source token provided by the Stripe SDK, it is not required if the user is already a customer and wants to use the default card. |
| meta         | JSON   | No       | Additional data to save for the payment.                                                                                         |
| {% endtab %} |        |          |                                                                                                                                  |

{% tab title="Response" %}
When successful, a HTTP 200 and JSON like this is returned:

```bash
{
  "status_code": 0
}
```

{% endtab %}
{% endtabs %}
