---
title: "Create a payment link"
method: POST
path: "/ext/v2/payment-links/"
tags: ["Payment Methods"]
---

# Create a payment link

`POST /ext/v2/payment-links/`

## Request

- Base URL: `https://connect.vetcove.com`
- URL: `https://connect.vetcove.com/ext/v2/payment-links/`
- Auth: HTTP bearer

Creates a new payment link that can be sent to a clinic client (pet parent) to collect a payment.

## Request body

- ExternalPaymentLinkCreateSchema: Fields required to create a PaymentLink
  - `callback_urls` PaymentLinkCallbackUrlsSchema: Schema for payment link callback URLs
    - `on_cancel` string, nullable: Redirect URL when payment is cancelled
    - `on_success` string, nullable: Redirect URL after successful payment completion
  - `clinic_client_id` integer, required: The ID of the client this payment link is for.
  - `clinic_id` integer, required: The ID of the clinic this payment link is for.
  - `connect_metadata` object, nullable: Metadata to be set by the client on the payment link.
  - `custom_text` string, nullable: Optional plain-text message for the payment link (max 500 characters). Send a string only — rich-text JSON is not accepted. The value is stored internally as rich text.
  - `entity_ids` integer[], required: IDs of entities to be paid based on the payment link kind: for INVOICE kind, provide one or more Invoice IDs (e.g., [123, 456]); for CARE_PLAN_PAYMENT_METHOD_UPDATE kind, provide exactly one Patient Care Plan ID (e.g., [456]).
  - `kind` 'INVOICE' | 'CARE_PLAN_PAYMENT_METHOD_UPDATE', required

## Response `201`

Created

- ExternalPaymentLinkDetailSchema: Additional fields for list/detail views
  - `callback_urls` PaymentLinkCallbackUrlsSchema: Schema for payment link callback URLs
    - `on_cancel` string, nullable: Redirect URL when payment is cancelled
    - `on_success` string, nullable: Redirect URL after successful payment completion
  - `client_payment_ids` integer[]: The ID's of the client payments associated with this payment link, if any payments have been made.
  - `clinic_client_id` integer, required: The ID of the client this payment link is for.
  - `clinic_id` integer, required: The ID of the clinic this payment link is for.
  - `connect_metadata` object, nullable: Metadata to be set by the client on the payment link.
  - `custom_text` string, nullable: Optional plain-text message for the payment link. Notes written in the clinic app as rich text are flattened here; formatting and paragraph breaks are not preserved.
  - `entity_ids` integer[], required: IDs of entities to be paid based on the payment link kind: for INVOICE kind, provide one or more Invoice IDs (e.g., [123, 456]); for CARE_PLAN_PAYMENT_METHOD_UPDATE kind, provide exactly one Patient Care Plan ID (e.g., [456]).
  - `expires_on` string, date-time, required: The timestamp at which this payment link will expire.
  - `id` integer, required: The unique identifier for the payment link.
  - `is_deleted` boolean: Whether this payment link has been deleted.
  - `is_expired` boolean, required: Whether this payment link has expired.
  - `kind` 'INVOICE' | 'ESTIMATE' | 'APPOINTMENT' | 'CARE_PLAN' | 'CARE_PLAN_PAYMENT_METHOD_UPDATE', required
  - `url` string, required: The URL for the payment link.

## Other responses

- `422`: Unprocessable Content

---

[API](https://skmtc.dev/vetcove/apis/ninjaapi.md) - [All operations](https://skmtc.dev/vetcove/apis/ninjaapi/llms.txt) - [OpenAPI document](https://skmtc.dev/vetcove/apis/ninjaapi/revisions/4ceaed956e15?raw)
