Go Headless

Changelog

API Reference
Articles
Platform Overview
Authentication
Work with Wix APIs
SDK Setup and Usage
AI Tools

App Management
OAuth 2
App Billing
App Instance
App Permissions
Embedded Scripts
BI Event
Editor Deep Link
Site Plugins
Market Listing V1

Business Solutions
eCommerce
Stores
Bookings
CMS
Events
Restaurants
Blog
Forum
Pricing Plans
Portfolio
Benefit Programs
Donations
Suppliers Hub
Gift Cards
Coupons

Assets
Media
HTTP Functions
Rich Content
Pro Gallery

CRM
Members & Contacts
Forms
Community
Communication
Loyalty Program
CRM

Business Management
AI Site-Chat
Analytics
App Installation
Async Job
Automations
Branches
Calendar
Captcha
Cookie Consent Policy
Custom Embeds
Data Extension Schema
Dashboard
FAQ App
Functions
Get Paid
Introduction
Billable Items
Bulk Downloads
Payment Links
Receipts
Headless
Locations
Marketing
Multilingual
Notifications
Online Programs
Payments
Site Search
Secrets
Site Properties
Site URLs
Tags

Account Level
About Account Level APIs
Sites
Resellers
Domains
B2B Site Management
User Management

Site
Viewer
In This Article

  1. Prerequisites
  2. Required APIs
  3. Overview
  4. Step 1: Retrieve product details (optional)
  5. Step 2: Create an ECOM payment link with custom line items
  6. Step 3: Create an ECOM payment link with catalog items
  7. Step 4: Create an ECOM_ORDER payment link for an existing order
  8. Step 5: Send payment link to recipients
  9. Step 6: Query and manage payment links
  10. Payment Link Statuses
  11. Common Errors
  12. Best Practices
  13. Related Documentation

Create Payment Links

View the file in GitHub
Download skill
Copy

This recipe shows how to create and manage payment links using the current Payment Links REST API.

Prerequisites

  1. Site is premium.
  2. Site is published.
  3. Site is set up to accept payments (Wix Payments onboarding completed).
  4. App has payment-link permissions.
  5. Wix Stores is installed if you plan to charge for catalog products.

Required APIs

  • Payment Links API: REST
  • Products API: REST

Overview

Payment links are created at:

  • POST https://www.wixapis.com/payment-links/v1/payment-links

Use one of these payment-link types:

  • ECOM: charge for custom or catalog line items.
  • ECOM_ORDER: collect payment for an existing unpaid eCommerce order.

Step 1: Retrieve product details (optional)

If you plan to use catalog items, fetch the product first.

Examples:

  • Catalog V1: GET https://www.wixapis.com/stores/v1/products/{productId}
  • Catalog V1 query: POST https://www.wixapis.com/stores/v1/products/query
Copy

Step 2: Create an ECOM payment link with custom line items

Copy

Step 3: Create an ECOM payment link with catalog items

Copy

Step 4: Create an ECOM_ORDER payment link for an existing order

Copy

Step 5: Send payment link to recipients

Use:

  • POST https://www.wixapis.com/payment-links/v1/payment-links/{paymentLinkId}/send

Request body:

Copy

Step 6: Query and manage payment links

Query:

  • POST https://www.wixapis.com/payment-links/v1/payment-links/query
Copy

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}/deactivate

Activate:

  • POST https://www.wixapis.com/payment-links/v1/payment-links/{paymentLinkId}/activate

Delete (only when no payments were received):

  • DELETE https://www.wixapis.com/payment-links/v1/payment-links/{paymentLinkId}

Payment Link Statuses

StatusDescription
ACTIVELink is active and can receive payments
INACTIVELink is inactive and cannot receive payments
PAIDPayment has been completed
EXPIREDLink has passed its expiration date

Common Errors

Error CodeMeaning
UNPUBLISHED_SITESite must be published before creating payment links
MISSING_ACCEPT_PAYMENTSSite is not set up to accept payments
FAILED_TO_INSTALL_ECOMRequired eCommerce capability is missing
RECIPIENT_NOT_FOUNDProvided recipient contact does not exist
ORDER_NOT_FOUNDProvided order ID does not exist
INVALID_PAYMENTS_LIMIT_FOR_ECOM_ORDER_PAYMENT_LINKECOM_ORDER links require paymentsLimit: 1

Best Practices

  1. Validate prerequisites first (premium, published, payments enabled).
  2. Use ECOM for line-item collection and ECOM_ORDER for existing unpaid orders.
  3. Use IDs from real entities (products, variants, contacts, orders).
  4. Keep currency aligned with your business/order currency rules.
  5. Persist payment-link IDs and monitor status via query/get methods.

Related Documentation

  • Payment Links API Reference
  • Payments Overview
  • Products API Reference
  • Send Payment Link
Did this help?