WooshPay OpenAPI
Product DocumentAPI ReferenceJS SDK ReferenceSaaS Platform Integration
Product DocumentAPI ReferenceJS SDK ReferenceSaaS Platform Integration
Back to WooshPay Website
  1. Online payments
  • Online payments
    • Quick Start
    • Integration overview
    • Wooshpay JS SDK
    • Wooshpay Checkout
    • Wooshpay Direct API
    • Payment Link
    • Authorize and capture
    • Build subscriptions integration
    • Testing cards
  • After the payment
    • Payouts
    • Webhook
    • Check the webhook signatures
    • 校验webhook签名
  • Add more payment methods
    • Supported payment method
    • Cards
    • Wallets
      • Alipay
      • Alipay HK
      • Apple Pay
      • Google Pay
      • Wechat Pay
      • 微信支付
      • Kakao Pay
      • DANA
      • Boost
      • Grabpay
      • Mcash
      • Touch'n Go
      • ShopeePay
      • UnionPay
      • 9Pay
      • OVO
      • GCash
      • TrueMoney
    • Bank redirects
      • Bancontact
      • BPI
      • Trustly
      • EPS
      • Giropay
      • iDEAL
      • Przelewy24
      • FPX
    • Buy Now Pay Later
      • Klarna
    • Bank Debits
      • Sepa Direct Debit
    • Bank Transfer
      • Bank Transfer in Europe
      • Bank Transfer in United Kingdom
      • Bank Transfer in Indonesia
    • QR Payments
      • QRIS
      • PromptPay
    • Real-time payments
      • PIX
      • PayNow
      • UPI
      • SPEI
  • More payment scenarios
    • Set up future payments
    • Save payment method during payment
  • SaaS platform integration
    • Shopify Plugin
    • Shopastro 星盘
    • WooCommerce
    • Shoplazza 店匠
    • Shopline Plugin
    • Sage Connection
  • Resources
    • Supported currencies
  1. Online payments

Payment Link

Introduction#

Accept payments without building a digital storefront.
There are two methods to create payment links:
1.
Create a payment link using the Dashboard without requiring any coding.
2.
Create a payment link programmatically with the direct API
To accept a payment without building additional standalone websites or applications, use Payment Links and share the link as many times as you want on social media, in emails, or on your website.
image.png

Create a payment link with the Dashboard#

Create a custom payment page without using code.
Use the Wooshpay Dashboard to create a payment link that you can share with your customers. Customers who open this link are redirected to Wooshpay checkout page.
Here are the step-by-step instructions to create a payment link with the Dashboard
1.
Click "+ New payment link"
86e14872-dfaf-45aa-af4f-e7fc4cb425cb.png
2.
Select product and quantity.
3.
Click on "Create payment link"
d626e72f-d420-4176-a4b7-9369906a2e2b.png
4.
Copy the payment link and share it with your customers.
707c62d0-7411-4343-941f-b6107531f70d.png
After that, you can share the link with your customers to complete payment.

Create a payment link with the API#

Create a custom payment page with the API and share a link to it. Payment Links supports many payment methods—including credit and debit cards, Alipay, Wechat Pay, DANA and Klarna.

Payment Links uses Products and Prices to model what your business is selling.
To get started with Payment Links, you first need to create a product, and then use that product to create a price

1. Create a product#

Products describe the specific goods or services you offer to your customers, each product has a unique ID. For instance: If you’re an e-commerce store selling clothing, one of your products might be a sweater.
Request Create a Product
{
    "name":"taiwan fengli",
    "active":true,
    "description":"very delicious",
    "metadata":{
        "key1":"value1",
        "key3":"value3"
    },
    "url":"www.baide.com"
}
Response
{
    "id": "prod_1554351292598452224",
    "object": "product",
    "created": 1665642282000,
    "active": true,
    "description": "very delicious",
    "metadata": {
        "key1": "value1",
        "key2": "value2"
    },
    "name": "taiwan fengli",
    "livemode": false,
    "url": "www.baide.com",
    "updated": 1665642282000,
    "images": null
}

2. Create a price#

Price can be attach to existed product, and can also be created when create a
new product.

1. Attach price to exisited product#

Request Attach price to exisited product
{
    "currency":"GBP",
    "product":"prod_1554351292598452224",
    "unit_amount":5,
    "active":true,
    "metadata":{
        "key1":"value1",
        "key2":"value2"
    },
    "nickname":"fengli",
    "product_data":null,
    "billing_scheme":"testscheme",
    "lookup_key":"test_lookup_key"
}

2. Create price when create a new product#

Request Create price when create a new product
{
    "currency":"GBP",
    "product":null,
    "unit_amount":5,
    "active":true,
    "metadata":{
        "key1":"value1",
        "key2":"value2"
    },
    "nickname":"fengli",
    "product_data":{
        "id":null,
        "name":"taiwan fengli",
        "active":true,
        "description":"very delicious",
        "metadata":{
            "key1":"value1",
            "key2":"value2"
        },
        "url":"www.baide.com"
    },
    "billing_scheme":"testscheme",
    "lookup_key":"test_lookup_key"
}
Response
{
    "id":"price_1554384814788837376",
    "object":"price",
    "created":1659429194000,
    "active":true,
    "currency":"GBP",
    "metadata":{
        "key1":"value1",
        "key2":"value2"
    },
    "nickname":"fengli",
    "product":{
        "id":"prod_1554351292598452224",
        "object":"product",
        "created":1659421201000,
        "active":true,
        "description":"very delicious",
        "metadata":{
            "key1":"value1",
            "key3":"value3"
        },
        "name":"taiwan fengli",
        "livemode":false,
        "url":"www.baide.com",
        "updated":1659422039000
    },
    "type":"one_time",
    "livemode":false,
    "unit_amount":5,
    "billing_scheme":"per_unit",
    "lookup_key":"test_lookup_key"
}

3. Create a payment link#

To create a payment link, pass in line_items.
Each line item contains a price and quantity.
Request Create a payment link
{
    "line_items":[
        {
            "price":"price_1559884567408541696",
            "quantity":2
        }
    ],
    "billing_address_collection":"required",
    "after_completion":{
        "hosted_confirmation":{
            "custom_message":"Payment Success"
        },
        "type":"hosted_confirmation"
    },
    "phone_number_collection":{
        "enabled":true
    },
    "shipping_address_collection":{
        "allowed_countries":[
            "CN",
            "HK",
            "GB"
        ]
    },
    "metadata":{
        "key1":"value1",
        "key2":"value2"
    }
}
Response
{
    "id": "plink_1613796597081047040",
    "object": "payment_link",
    "created": 1673594067000,
    "active": true,
    "metadata": {
        "key1": "value1",
        "key2": "value2"
    },
    "url": "https://buytest.wooshpay.com/test_plink_1613796597081047040_secret_mWnkKBC8hUmrwKEV0HZtJ1KX",
    "livemode": false,
    "line_items": {
        "object": "list",
        "data": [
            {
                "id": "li_1613796598972678144",
                "object": "item",
                "currency": "CNY",
                "description": "good product",
                "price": {
                    "id": "price_1559884567408541696",
                    "object": "price",
                    "created": 1660740437000,
                    "active": true,
                    "currency": "CNY",
                    "metadata": {
                        "key1": "value1",
                        "key2": "value2"
                    },
                    "nickname": "low price",
                    "product": {
                        "id": "prod_1559883789331595264",
                        "object": "product",
                        "created": 1660740251000,
                        "active": true,
                        "description": "very good",
                        "metadata": {
                            "key1": "value1",
                            "key2": "value2"
                        },
                        "name": "good product",
                        "livemode": false,
                        "url": "www.baide.com",
                        "updated": 1660740251000,
                        "images": [
                            "https://oss.swooshtransfer.cn/oa/product/1559882985845555200_X6zNPOJ5ahw545XcCJhSlARR.png"
                        ]
                    },
                    "type": "one_time",
                    "livemode": false,
                    "unit_amount": 200,
                    "billing_scheme": "per_unit",
                    "lookup_key": "test_lookup_key"
                },
                "quantity": 2,
                "amount_subtotal": 400,
                "amount_total": 400
            }
        ],
        "url": null,
        "has_more": false
    },
    "after_completion": {
        "redirect": null,
        "type": "hosted_confirmation",
        "hosted_confirmation": {
            "custom_message": "Payment Success"
        }
    },
    "billing_address_collection": "required",
    "phone_number_collection": {
        "enabled": true
    },
    "shipping_address_collection": {
        "allowed_countries": [
            "CN",
            "HK",
            "GB"
        ]
    }
}

4. Share your payment link#

Each payment link contains a url that you can share with your customers through email, message etc., on social media, with a website link, in an app, or through other channels.
You can paste or embed the link anywhere. The same payment link can be shared with many customers and used across multiple channels.
Modified at 2023-06-06 11:40:38
Previous
Wooshpay Direct API
Next
Authorize and capture
Built with