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.
bearerAuthAuthorizationBearer <token>A live API key, sk_live_ followed by 32 base58 characters.
Idempotency-Key?stringA 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.
1 <= length <= 255application/json- body
title*stringNames the link and its payments in your dashboard. The payment link and checkout pages do not show it.
1 <= length <= 120amount?AmountDecimal string with up to 2 decimals, greater than 0.
^\d{1,12}(\.\d{1,2})?$currency*Currency"USD""EUR""INR"redirect_url?stringAn http or https URL the checkout sends the customer to after paying. Leave it out to use your business website.
urilength <= 2048The payment link was created.
application/json- response
id*stringobject*stringmode*ModeAlways live on the objects your API key creates and reads. Only demo store invoices, seen through the public checkout endpoints, are test.
"live""test"url*stringThe shareable link.
urititle*stringamount*|Fixed amount, or null for a tip link.
currency*Currency"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.
uriactive*booleancreated_at*stringdate-timecurl -X POST 'https://example.com/api/v1/payment-links' \ -H 'Content-Type: application/json' \ -d '{ "title": "Flat white", "amount": "4.50", "currency": "EUR"}'{ "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"}