Setting the file. One moment.
Subchapter 8.66
references/get-paid/create-payment-links.mdMarkdown5 KBView on GitHub
This recipe shows how to create and manage payment links using the current Payment Links REST API.
Payment links are created at:
POST https://www.wixapis.com/payment-links/v1/payment-linksUse one of these payment-link types:
ECOM: charge for custom or catalog line items.ECOM_ORDER: collect payment for an existing unpaid eCommerce order.If you plan to use catalog items, fetch the product first.
Examples:
GET https://www.wixapis.com/stores/v1/products/{productId}POST https://www.wixapis.com/stores/v1/products/query{
"query": {
"paging": {
"limit": 50,
"offset": 0
}
}
}{
"paymentLink": {
"title": "Business Listing Fee",
"description": "One-time listing fee",
"currency": "USD",
"type": "ECOM",
"ecomPaymentLink": {
"lineItems": [
{
"type": "CUSTOM",
"customItem": {
"name": "Listing Fee",
"quantity": 1,
"price": "200.00"
}
}
]
}
}
}{
"paymentLink": {
"title": "Product Payment",
"currency": "USD",
"type": "ECOM",
"ecomPaymentLink": {
"lineItems": [
{
"type": "CATALOG",
"catalogItem": {
"quantity": 1,
"catalogReference": {
"appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e",
"catalogItemId": "PRODUCT_ID",
"options": {
"variantId": "VARIANT_ID"
}
}
}
}
]
}
}
}{
"paymentLink": {
"title": "Order Balance",
"currency": "USD",
"type": "ECOM_ORDER",
"paymentsLimit": 1,
"ecomOrderPaymentLink": {
"orderId": "ORDER_ID",
"amount": "50"
}
}
}Use:
POST https://www.wixapis.com/payment-links/v1/payment-links/{paymentLinkId}/sendRequest body:
{
"paymentLinkId": "PAYMENT_LINK_ID",
"recipients": [
{
"contactId": "CONTACT_ID",
"sendMethods": ["EMAIL_METHOD"]
}
]
}Query:
POST https://www.wixapis.com/payment-links/v1/payment-links/query{
"query": {
"filter": {
"status": "ACTIVE"
},
"cursorPaging": {
"limit": 50
}
}
}Get one:
GET https://www.wixapis.com/payment-links/v1/payment-links/{paymentLinkId}Deactivate:
POST https://www.wixapis.com/payment-links/v1/payment-links/{paymentLinkId}/deactivateActivate:
POST https://www.wixapis.com/payment-links/v1/payment-links/{paymentLinkId}/activateDelete (only when no payments were received):
DELETE https://www.wixapis.com/payment-links/v1/payment-links/{paymentLinkId}| Status | Description |
|---|---|
ACTIVE | Link is active and can receive payments |
INACTIVE | Link is inactive and cannot receive payments |
PAID | Payment has been completed |
EXPIRED | Link has passed its expiration date |
| Error Code | Meaning |
|---|---|
UNPUBLISHED_SITE | Site must be published before creating payment links |
MISSING_ACCEPT_PAYMENTS | Site is not set up to accept payments |
FAILED_TO_INSTALL_ECOM | Required eCommerce capability is missing |
RECIPIENT_NOT_FOUND | Provided recipient contact does not exist |
ORDER_NOT_FOUND | Provided order ID does not exist |
INVALID_PAYMENTS_LIMIT_FOR_ECOM_ORDER_PAYMENT_LINK | ECOM_ORDER links require paymentsLimit: 1 |
ECOM for line-item collection and ECOM_ORDER for existing unpaid orders.