ποΈPayment Links
Introduction
Payment links are a quick and easy way for merchants to accept payments from customers. With Sonic Payment Gateway, you can create unique payment links that can be shared via email, social media, or any other medium.
Payment links can be customized with various options such as custom amounts, currency, and expiration date. They can also be associated with a specific product or pricing.
Create a payment link
Payment links can be created using our API or through the Sonic Payment Gateway Dashboard.
POST https://api.sonicpay.org/v1/payment_links
Request Body
amount*
1000
currency*
USDT
price_id*
def456
expiry_date*
2022-12-31
metadata
"customer_name: "John Smith"
{
"id": "ghi789",
"url": "https://sonicpay.org/p/ghi789",
"amount": 1000,
"currency": "USDT",
"product_id": "abc123",
"price_id": "def456
}Get a Payment Link
To retrieve an existing payment link, you can use the GET endpoint and pass in the payment link ID. This will return a JSON object containing information about the link, including its status, expiration date, and any metadata associated with it.
GET https://api.sonicpay.org/v1/payment_links/{link_id}
Headers
Authorization: Bearer*
xxxxxx
Delete a Payment Link
To delete a payment link, you will need to make a DELETE request to our API endpoint at https://api.sonicpay.org/api/v1/%3Cpayment_link_id%3E. The <payment_link_id> in the endpoint should be replaced with the unique identifier of the payment link you want to delete.
Before making the request, you will need to include your API key in the headers of the request for authentication.
DELETE https://api.sonicpay.org/api/v1/links/<payment_link_id>
Headers
Authorization: Bearer*
YOUR_API_KEY
Update a payment link
To update a payment link, you will need to make a PUT request to the https://api.sonicpay.org/api/v1/payment_links/:id endpoint, passing in the updated values in the request body.
The request body should include the updated values for the payment link such as the name, description, amount, and currency.
Here is an example of how to update a payment link using our SDK:
PUT https://api.sonicpay.org/api/v1/payment_links/:id
Headers
Authorization: Bearer *
your_api_key
Content-Type*
application/json
Request Body
name*
Updated Name
description*
Updated Description
amount*
100
currency*
USDT
name
string
Yes
Updated name of the payment link
description
string
No
Updated description of the payment link
amount
number
No
Updated amount of the payment link
currency
string
No
Updated currency of the payment link
Get all Payment Links
To retrieve all payment links, you will need to make a GET request to the https://api.sonicpay.org/api/v1/payment_links
Here is an example of how to retrieve all payment links using our SDK:
GET https://api.sonicpay.org/api/v1/payment_links
Headers
Content-Type*
application/json
Authorization: Bearer*
your_api_key
You can also pass in query parameters to filter the payment links returned such as status, created_at, updated_at, and limit.
Example:
Last updated