Payment Link
Introduction
Accept payments without building a digital storefront.
There are two methods to create payment links:
- Create a payment link using the Dashboard without requiring any coding.
- 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.
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
- Click "+ New payment link"
Select product and quantity.
Click on "Create payment link"
- Copy the payment link and share it with your customers.
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.