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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create Payment Link

> Creates a Square-hosted checkout page.

`square.createPaymentLink` creates a Square-hosted checkout page.

## Example

```ts automations/square-create-payment-link.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { square } from "automate.ax/square"

export default automation("Create Square Payment Link", () => {
  onDashboardRun({ title: "Create Square Payment Link" })

  square.createPaymentLink({
    idempotencyKey: "cd9e25dc-d9f2-4430-aedb-61605070e95f",
    quickPay: {
      name: "Auto Detailing",
      priceMoney: {
        amount: BigInt("10000"),
        currency: "USD",
      },
      locationId: "A9Y43N9ABXZBP",
    },
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires `ORDERS_READ` and `ORDERS_WRITE` and `PAYMENTS_WRITE`.

| Field              | Type                      | Required | Default | Description                                                                                                                                                                                                                                                                                                            |
| ------------------ | ------------------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `idempotencyKey`   | `string`                  | No       | —       | A unique string that identifies this `CreatePaymentLinkRequest` request. If you do not provide a unique string (or provide an empty string as the value), the endpoint treats each request as independent. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). |
| `description`      | `string`                  | No       | —       | A description of the payment link. You provide this optional description that is useful in your application context. It is not used anywhere.                                                                                                                                                                          |
| `quickPay`         | `Square.QuickPay`         | No       | —       | Describes an ad hoc item and price for which to generate a quick pay checkout link. For more information, see [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout).                                                                                                               |
| `order`            | `Square.Order`            | No       | —       | Describes the `Order` for which to create a checkout link. For more information, see [Square Order Checkout](https://developer.squareup.com/docs/checkout-api/square-order-checkout).                                                                                                                                  |
| `checkoutOptions`  | `Square.CheckoutOptions`  | No       | —       | Describes optional fields to add to the resulting checkout page. For more information, see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations).                                                                                                      |
| `prePopulatedData` | `Square.PrePopulatedData` | No       | —       | Describes fields to prepopulate in the resulting checkout page. For more information, see [Prepopulate the shipping address](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#prepopulate-the-shipping-address).                                                                      |
| `paymentNote`      | `string`                  | No       | —       | A note for the payment. After processing the payment, Square adds this note to the resulting `Payment`.                                                                                                                                                                                                                |

Use the official [CreatePaymentLink reference](https://developer.squareup.com/reference/square/checkout-api/create-payment-link) for provider field semantics and limits.

## Output

Returns the official `Square.CreatePaymentLinkResponse` response as a codec-safe object. Square integer money amounts remain `bigint` values.
