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

# Create a Payment Link for Checkout

> Call the POST /payment-links/create endpoint to generate a hosted payment URL you can share with your customer via email, SMS, or any channel.

The Create Payment Link endpoint accepts your order details and customer information, then returns a hosted payment URL that your customer can open to complete the transaction. Because FastFlowPe hosts the checkout page, you do not need to build any frontend to collect payments.

<Tip>
  **Quick Reference**

  **Required:** `order_id`, `amount`, `description`, `customer_info`

  **Returns:** `payment_link`, `link_id`, `expiry`

  **Minimum amount:** ₹200
</Tip>

## Endpoint

```text theme={"dark"}
POST https://api.fastflowpe.com/merchant/payment-links/create
```

## Headers

| Header         | Value                 |
| -------------- | --------------------- |
| `x-api-key`    | Your merchant API key |
| `Content-Type` | `application/json`    |

## Request Body Parameters

<ParamField body="order_id" type="string" required>
  Unique identifier for the order on your system. Use a new value for every transaction — duplicate `order_id` values will be rejected.
</ParamField>

<ParamField body="amount" type="float" required>
  Amount to charge the customer, in Indian Rupees. Minimum value is **₹200**.
</ParamField>

<ParamField body="description" type="string" required>
  A short description of the product or transaction shown to the customer on the payment page.
</ParamField>

<ParamField body="customer_info" type="object" required>
  An object containing the customer's contact details.

  <Expandable title="customer_info fields">
    <ParamField body="customer_info.name" type="string" required>
      Full name of the customer.
    </ParamField>

    <ParamField body="customer_info.email" type="string" required>
      Email address of the customer.
    </ParamField>

    <ParamField body="customer_info.phone" type="string" required>
      10-digit mobile number of the customer, without country code.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="psp_provider_id" type="string">
  UUID of a specific PSP provider to route this payment through. Retrieve available provider IDs from the [Get PSP Providers](/collections/payment-links/psp-providers) endpoint. If omitted, FastFlowPe selects the provider automatically.
</ParamField>

<ParamField body="expiry" type="string">
  ISO 8601 datetime string specifying when the payment link expires. For example: `2026-08-29T12:12:09.823481+05:30`. If omitted, the platform default expiry applies.
</ParamField>

<RequestExample>
  ```bash cURL theme={"dark"}
  curl --location 'https://api.fastflowpe.com/merchant/payment-links/create' \
  --header 'x-api-key: <x-api-key>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
      "order_id": "ORD_4421",
      "amount": 500,
      "description": "Premium Subscription",
      "customer_info": {
          "name": "John Doe",
          "email": "john@example.com",
          "phone": "9999999999"
      },
      "expiry": "2026-08-29T12:12:09.823481+05:30"
  }'
  ```

  ```python Python theme={"dark"}
  import requests

  url = "https://api.fastflowpe.com/merchant/payment-links/create"
  headers = {
      "x-api-key": "<x-api-key>",
      "Content-Type": "application/json",
  }
  payload = {
      "order_id": "ORD_4421",
      "amount": 500,
      "description": "Premium Subscription",
      "customer_info": {
          "name": "John Doe",
          "email": "john@example.com",
          "phone": "9999999999",
      },
      "expiry": "2026-08-29T12:12:09.823481+05:30",
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```javascript Node.js theme={"dark"}
  const response = await fetch("https://api.fastflowpe.com/merchant/payment-links/create", {
    method: "POST",
    headers: {
      "x-api-key": "<x-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      order_id: "ORD_4421",
      amount: 500,
      description: "Premium Subscription",
      customer_info: {
        name: "John Doe",
        email: "john@example.com",
        phone: "9999999999",
      },
      expiry: "2026-08-29T12:12:09.823481+05:30",
    }),
  });
  console.log(await response.json());
  ```

  ```java Java theme={"dark"}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  String body = """
  {
    "order_id": "ORD_4421",
    "amount": 500,
    "description": "Premium Subscription",
    "customer_info": {
      "name": "John Doe",
      "email": "john@example.com",
      "phone": "9999999999"
    },
    "expiry": "2026-08-29T12:12:09.823481+05:30"
  }
  """;

  HttpClient client = HttpClient.newHttpClient();
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.fastflowpe.com/merchant/payment-links/create"))
      .header("x-api-key", "<x-api-key>")
      .header("Content-Type", "application/json")
      .POST(HttpRequest.BodyPublishers.ofString(body))
      .build();

  HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```go Go theme={"dark"}
  package main

  import (
      "bytes"
      "fmt"
      "io"
      "net/http"
  )

  func main() {
      payload := []byte(`{
          "order_id": "ORD_4421",
          "amount": 500,
          "description": "Premium Subscription",
          "customer_info": {"name": "John Doe", "email": "john@example.com", "phone": "9999999999"},
          "expiry": "2026-08-29T12:12:09.823481+05:30"
      }`)

      req, _ := http.NewRequest("POST", "https://api.fastflowpe.com/merchant/payment-links/create", bytes.NewBuffer(payload))
      req.Header.Set("x-api-key", "<x-api-key>")
      req.Header.Set("Content-Type", "application/json")

      resp, _ := http.DefaultClient.Do(req)
      defer resp.Body.Close()
      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```php PHP theme={"dark"}
  <?php
  $payload = json_encode([
      "order_id" => "ORD_4421",
      "amount" => 500,
      "description" => "Premium Subscription",
      "customer_info" => [
          "name" => "John Doe",
          "email" => "john@example.com",
          "phone" => "9999999999",
      ],
      "expiry" => "2026-08-29T12:12:09.823481+05:30",
  ]);

  $ch = curl_init("https://api.fastflowpe.com/merchant/payment-links/create");
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "x-api-key: <x-api-key>",
      "Content-Type: application/json",
  ]);
  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```

  ```ruby Ruby theme={"dark"}
  require 'net/http'
  require 'uri'
  require 'json'

  uri = URI('https://api.fastflowpe.com/merchant/payment-links/create')
  request = Net::HTTP::Post.new(uri)
  request['x-api-key'] = '<x-api-key>'
  request['Content-Type'] = 'application/json'
  request.body = {
    order_id: 'ORD_4421',
    amount: 500,
    description: 'Premium Subscription',
    customer_info: {
      name: 'John Doe',
      email: 'john@example.com',
      phone: '9999999999',
    },
    expiry: '2026-08-29T12:12:09.823481+05:30',
  }.to_json

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
  puts response.body
  ```
</RequestExample>

<Note>
  The `order_id` must be unique for every transaction. Reusing an existing `order_id` will cause the request to fail.
</Note>

<Tip>
  Use the `psp_provider_id` field to route a payment to a specific payment provider. Call the [Get PSP Providers](/collections/payment-links/psp-providers) endpoint to retrieve the UUID for each provider available to your account.
</Tip>
