> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flouci.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Binding

> Link a customer's Flouci account to your application for future payments.

This endpoint initiates the binding process by creating a payment with a unique `client_id`. The first transaction links the customer's Flouci wallet or card to your application. Subsequent payments using the same `client_id` will use the saved payment method.

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://developers.flouci.com/api/v2/generate_payment' \
    --header 'Authorization: Bearer <PUBLIC_KEY>:<PRIVATE_KEY>' \
    --header 'Content-Type: application/json' \
    --data '{
      "amount": "40300",
      "developer_tracking_id": "<YOUR_TRACKING_ID>",
      "accept_card": true,
      "success_link": "https://example.com/success",
      "fail_link": "https://example.com/failure",
      "client_id": "<unique_internal_id>"
    }'
  ```
</RequestExample>

### Body

<ParamField body="amount" type="string" required>
  The amount to be paid in millimes.
</ParamField>

<ParamField body="developer_tracking_id" type="string">
  An ID for you to track the payment. This is a free field that Flouci doesn't check against.
</ParamField>

<ParamField body="accept_card" type="boolean" default="false">
  Whether to accept card payments.
</ParamField>

<ParamField body="success_link" type="string" required>
  The URL to redirect the user to after a successful payment.
</ParamField>

<ParamField body="fail_link" type="string" required>
  The URL to redirect the user to after a failed payment.
</ParamField>

<ParamField body="client_id" type="string" required>
  A unique internal identifier for the customer. This is the key that creates and references the binding — subsequent payments with the same `client_id` will use the saved payment method.
</ParamField>

<ParamField body="webhook" type="string">
  The webhook URL you want to receive payment confirmation on.
</ParamField>

<ParamField body="image_url" type="URL">
  The URL of the image to display on the payment page.
</ParamField>

<ParamField body="session_timeout_secs" type="integer" default="1200">
  The session timeout in seconds.
</ParamField>

<ResponseExample>
  ```json Success theme={null}
  {
    "result": {
      "success": true,
      "payment_id": "FoPKKHqfQIKfBqhEj8M47A",
      "link": "https://flouci.com/pay/FoPKKHqfQIKfBqhEj8M47A",
      "developer_tracking_id": "<YOUR_TRACKING_ID>"
    },
    "name": "developers",
    "code": 0,
    "version": "v2"
  }
  ```

  ```json Error theme={null}
  {
    "result": {
      "status": 400,
      "message": "Bad Request"
    }
  }
  ```
</ResponseExample>

<Note>
  The customer completes this first payment through the Flouci checkout page. Once completed, the `client_id` is bound to their payment method for future use. You can get the Binding Id from the verify API after the payment is done.
</Note>
