Payment Links for Bookings
Use this recipe to collect payment for booking-related flows by generating payment links with the Payment Links API.
When to Use Which Type
Use ECOM_ORDER for existing unpaid orders
If a booking already has an associated unpaid eCommerce order, create an ECOM_ORDER payment link.
{
"paymentLink": {
"title": "Booking Balance",
"currency": "USD",
"type": "ECOM_ORDER",
"paymentsLimit": 1,
"ecomOrderPaymentLink": {
"orderId": "ORDER_ID",
"amount": "50"
}
}
}Notes:
orderIdmust exist and be unpaid.ECOM_ORDERlinks requirepaymentsLimit: 1.
Use ECOM for ad-hoc booking charges
If there is no existing order, create an ECOM payment link with custom line items.
{
"paymentLink": {
"title": "Booking Fee",
"currency": "USD",
"type": "ECOM",
"ecomPaymentLink": {
"lineItems": [
{
"type": "CUSTOM",
"customItem": {
"name": "Booking Fee",
"quantity": 1,
"price": "50.00"
}
}
]
}
}
}Send Flow
Creating a payment link does not deliver it. Send it explicitly:
POST https://www.wixapis.com/payment-links/v1/payment-links/{paymentLinkId}/send
{
"paymentLinkId": "PAYMENT_LINK_ID",
"recipients": [
{
"contactId": "CONTACT_ID",
"sendMethods": ["EMAIL_METHOD"]
}
]
}Prerequisites
Before creating booking payment links, ensure:
- Site is premium.
- Site is published.
- Site is set up to accept payments.
- Required payment-link permissions are granted to the app.
- Recipient contacts exist if you plan to send links.
Common Errors
| Error Code | Meaning |
|---|---|
UNPUBLISHED_SITE |
Site must be published before creating payment links |
MISSING_ACCEPT_PAYMENTS |
Site is not set up to accept payments |
ORDER_NOT_FOUND |
The provided order ID does not exist |
INVALID_PAYMENTS_LIMIT_FOR_ECOM_ORDER_PAYMENT_LINK |
ECOM_ORDER links require paymentsLimit: 1 |
RECIPIENT_NOT_FOUND |
Recipient contact ID does not exist |