> ## 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.

# Complete Payment

> Completes (captures) a payment.

`square.completePayment` completes (captures) a payment.

## Example

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

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

  square.completePayment({
    paymentId: "payment_id",
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires `PAYMENTS_WRITE`.

| Field          | Type             | Required | Default | Description                                                                                                                                                                                                                                            |
| -------------- | ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `paymentId`    | `string`         | Yes      | —       | The unique ID identifying the payment to be completed.                                                                                                                                                                                                 |
| `versionToken` | `string \| null` | No       | —       | Used for optimistic concurrency. This opaque token identifies the current `Payment` version that the caller expects. If the server has a different version of the Payment, the update fails and a response with a VERSION\_MISMATCH error is returned. |

Use the official [CompletePayment reference](https://developer.squareup.com/reference/square/payments-api/complete-payment) for provider field semantics and limits.

## Output

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