Create payment link
Creates a Square-hosted checkout page.
Applications can share the resulting payment link with their buyer to pay for goods and services.
Name | Description |
---|---|
idempotency_
|
A unique string that identifies this For more information, see Idempotency. |
description
|
A description of the payment link. You provide this optional description that is useful in your application context. It is not used anywhere. |
quick_
|
Describes an ad hoc item and price for which to generate a quick pay checkout link. For more information, see Quick Pay Checkout. |
order
|
Describes the |
checkout_
|
Describes optional fields to add to the resulting checkout page. For more information, see Optional Checkout Configurations. |
pre_
|
Describes fields to prepopulate in the resulting checkout page. For more information, see Prepopulate the shipping address. |
source
|
The application that created the payment link. |
payment_
|
A note for the payment. After processing the payment, Square adds this note to the resulting |
Response Fields
Name | Description |
---|---|
errors
|
Any errors that occurred during the request. |
payment_
|
The created payment link. |
Examples
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/online-checkout/payment-links \
-X POST \
-H 'Square-Version: 2022-06-16' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"idempotency_key": "cd9e25dc-d9f2-4430-aedb-61605070e95f",
"quick_pay": {
"name": "Auto Detailing",
"price_money": {
"amount": 10000,
"currency": "USD"
},
"location_id": "A9Y43N9ABXZBP"
}
}'
{
"payment_link": {
"id": "PKVT6XGJZXYUP3NZ",
"version": 1,
"order_id": "o4b7saqp4HzhNttf5AJxC0Srjd4F",
"url": "https://square.link/u/EXAMPLE",
"created_at": "2022-04-25T23:58:01Z"
}
}