Payment links

Create a payment link

Creates a reusable payment link. Leave out amount to create a tip link where the customer chooses the amount. Rate limit: 60 per minute per API key, shared with the other endpoints that have this limit.

POST
/api/v1/payment-links

Authorization

bearerAuth
headerAuthorizationBearer <token>

A live API key, sk_live_ followed by 32 base58 characters.

Header Parameters

Idempotency-Key?string

A unique string of 1 to 255 characters for this operation. A key belongs to the business across every endpoint for 24 hours, so give each operation its own key, for example invoice-order-1042 and refund-order-1042, not the order id alone. A retry with the same key on the same endpoint and with the same body returns the stored response with the header Idempotent-Replayed: true. The same key with a different body or on another endpoint returns 409 idempotency_conflict. Errors are not stored, so a request that failed can be retried with the same key, even with a corrected body. While the first request with a key is still running, a retry gets 409 idempotency_conflict with Retry-After: 1.

Length1 <= length <= 255

Request Body

application/json
  1. body
title*string

Names the link and its payments in your dashboard. The payment link and checkout pages do not show it.

Length1 <= length <= 120
amount?Amount

Decimal string with up to 2 decimals, greater than 0.

Match^\d{1,12}(\.\d{1,2})?$
currency*Currency
Value in"USD""EUR""INR"
redirect_url?string

An http or https URL the checkout sends the customer to after paying. Leave it out to use your business website.

Formaturi
Lengthlength <= 2048

Response Body

The payment link was created.

application/json
  1. response
id*string
object*string
mode*Mode

Always live on the objects your API key creates and reads. Only demo store invoices, seen through the public checkout endpoints, are test.

Value in"live""test"
url*string

The shareable link.

Formaturi
title*string
amount*|

Fixed amount, or null for a tip link.

currency*Currency
Value in"USD""EUR""INR"
redirect_url*|

Where the checkout sends the customer after paying. When null, the customer goes to your business website, if you set one.

Formaturi
active*boolean
created_at*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/v1/payment-links' \  -H 'Content-Type: application/json' \  -d '{  "title": "Flat white",  "amount": "4.50",  "currency": "EUR"}'
Example Response
{  "id": "lnk_8Fq2xT4mW9pL3vN7rB2s",  "object": "payment_link",  "mode": "live",  "url": "http://example.com",  "title": "string",  "amount": "string",  "currency": "USD",  "redirect_url": "http://example.com",  "active": true,  "created_at": "2019-08-24T14:15:22Z"}