Payment Link API
Payment Links API Integration
The Payment Links API allows you to programmatically create and manage payment links. This is ideal for merchants who want to generate links on demand from their own systems, rather than creating them manually through the dashboard.
Payment links are reusable. A payment link can be opened and paid through as many times as you want — static or dynamic. Each time a customer uses a payment link, Basqet creates a new checkout session (transaction) for that use, but the link itself stays active and can be shared again. If you need a one-time payment that expires after a single use, use the Transactions API to initialize a transaction directly instead.
A payment link is a Basqet-hosted checkout page that your customers can open to complete a payment. Links can be:
- Static — a fixed amount is set when the link is created.
- Dynamic — the customer enters the amount at checkout.
Create Payment Link
API Details
Action: Create Payment Link
Method: POST
Path: /v1/payment-links
Auth Requirement: Secret Key
Business Summary
This endpoint creates a new payment link that can be shared with customers. Once created, the link generates a unique, Basqet-hosted checkout URL your customers can use to complete a crypto payment.
You can use this API to:
- Programmatically generate payment links for invoices, orders, or recurring billing.
- Create fixed-price (static) links for specific products or dynamic links where the customer sets the amount.
- Attach custom metadata to links for your internal tracking.
Request Parameters
Request Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token in the form Bearer sec_... (your secret key). |
| Content-Type | string | Yes | application/json |
Body Parameters
| Name | Type | Required | Default | Allowed Values | Description |
|---|---|---|---|---|---|
| title | string | Yes | - | 2–100 chars | Display name for the payment link. |
| link_type | string | Yes | - | "static", "dynamic" | static requires a fixed amount. dynamic lets the customer enter the amount at checkout. |
| currency | string | Yes | - | USD, NGN, GBP, EUR | The fiat currency the payment is priced in. Must be uppercase. |
| amount | string | Conditionally | - | Numeric, > 0 | Required when link_type is "static". Omit or set to null for dynamic links. |
| description | string | No | null | Max 255 chars | Optional description for the link. |
| metadata | object | No | null | Any JSON object | Custom data you want to attach to the link. Returned as-is in responses. |
| pass_fee_to_customer | boolean | No | false | true, false | When true, the Basqet processing fee is passed to the customer. |
| pass_settlement_fee_to_customer | boolean | No | false | true, false | When true, the settlement fee is passed to the customer. |
Request Examples
cURL — Static Link
curl --request POST \
--url https://api.basqet.com/v1/payment-links \
--header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"title": "Invoice #1024",
"link_type": "static",
"currency": "USD",
"amount": "150.00",
"description": "Payment for design services",
"metadata": {
"order_id": "order_1024",
"customer_tier": "premium"
}
}'
cURL — Dynamic Link
curl --request POST \
--url https://api.basqet.com/v1/payment-links \
--header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"title": "Open Donation",
"link_type": "dynamic",
"currency": "USD"
}'
Response Schema
| Field | Type | Nullable | Description |
|---|---|---|---|
| message | string | No | Always "Payment Link created" on success. |
| id | string | No | Unique identifier for the payment link (bq_pl_…). |
| title | string | No | The payment link's title. |
| link_type | string | No | "static" or "dynamic". |
| currency | string | No | The fiat currency code (e.g., USD, NGN). |
| amount | number | null | Yes | Fixed payment amount for static links. null for dynamic links. |
| payment_url | string | No | The shareable Basqet-hosted checkout URL for this payment link. |
| metadata | object | null | Yes | Echo of the metadata you passed in, or null when omitted. |
| created_at | string | No | ISO 8601 timestamp of link creation. |
| last_used | string | null | Yes | ISO 8601 timestamp of the most recent use. null if unused. |
| deleted_at | string | null | Yes | ISO 8601 timestamp of deletion. null if active. |
Sample Response
{
"message": "Payment Link created",
"id": "bq_pl_aBcDeFgHiJkLmNo",
"title": "Invoice #1024",
"link_type": "static",
"currency": "USD",
"amount": 150.0,
"payment_url": "https://pay.basqet.com/pl_aBcDeFgHiJkLmNo",
"metadata": {
"order_id": "order_1024",
"customer_tier": "premium"
},
"created_at": "2026-04-22T10:30:00.000Z",
"last_used": null,
"deleted_at": null
}
Error Reference
| HTTP Code | Error Code | Resolution |
|---|---|---|
| 400 | missing_required_field | Ensure title, link_type, and currency are all present in the body. |
| 400 | invalid_link_type | link_type must be exactly "static" or "dynamic". |
| 400 | invalid_currency | Verify the currency code is supported (USD, NGN, etc.). |
| 400 | missing_amount | amount is required when link_type is "static". |
| 400 | invalid_amount | amount must be a number greater than 0. |
| 400 | invalid_metadata | metadata must be a valid JSON object. |
| 404 | merchant_user_not_found | No merchant user found for the provided secret key. |
| 422 | Varies based on KYC status | The merchant must complete KYB verification before creating live-mode payment links. |
List Payment Links
API Details
Action: List Payment Links
Method: GET
Path: /v1/payment-links
Auth Requirement: Secret Key
Business Summary
Returns a paginated list of payment links for your merchant account. By default, only active (non-deleted) links are returned. Use the status parameter to retrieve archived links.
Request Parameters
Request Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token in the form Bearer sec_... (your secret key). |
Query Parameters
| Name | Type | Required | Default | Allowed Values | Description |
|---|---|---|---|---|---|
| offset | number | No | 0 | Integer ≥ 0 | Number of records to skip. |
| limit | number | No | 10 | Integer 1–100 | Number of records to return. |
| order | string | No | desc | "asc", "desc" | Sort order by creation date. |
| from | string | No | - | Date string YYYY-MM-DD | Filter links created on or after this date. |
| to | string | No | - | Date string YYYY-MM-DD | Filter links created on or before this date. |
| search_term | string | No | - | - | Search links by title or currency code. |
| status | string | No | active | "active", "archived", "all" | Filter by link status. archived returns deleted links. |
Request Example
cURL
curl --request GET \
--url 'https://api.basqet.com/v1/payment-links?limit=20&order=desc&status=active' \
--header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx'
Response Schema
| Field | Type | Nullable | Description |
|---|---|---|---|
| data | PaymentLink[] | No | Array of payment link objects. |
| meta.limit | number | No | The limit applied to the request. |
| meta.count | number | No | Total number of matching payment links. |
| meta.hasNext | boolean | No | true if more records exist beyond this page. |
Sample Response
{
"data": [
{
"id": "bq_pl_aBcDeFgHiJkLmNo",
"title": "Invoice #1024",
"link_type": "static",
"currency": "USD",
"amount": 150.0,
"payment_url": "https://pay.basqet.com/pl_aBcDeFgHiJkLmNo",
"metadata": null,
"created_at": "2026-04-22T10:30:00.000Z",
"last_used": null,
"deleted_at": null
}
],
"meta": {
"limit": 20,
"count": 1,
"hasNext": false
}
}
...
Get Payment Link
API Details
Action: Get Payment Link
Method: GET
Path: /v1/payment-links/:id
Auth Requirement: Secret Key
Business Summary
Retrieves the details of a single payment link by its ID.
Request Parameters
Request Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token in the form Bearer sec_... (your secret key). |
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The unique ID of the payment link (bq_pl_…). |
Request Example
cURL
\--url <https://api.basqet.com/v1/payment-links/bq_pl_aBcDeFgHiJkLmNo> \\
\--header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx'```
```
<br />
Sample Response
```json
{
"id": "bq_pl_aBcDeFgHiJkLmNo",
"title": "Invoice #1024",
"link_type": "static",
"currency": "USD",
"amount": 150.0,
"payment_url": "https://pay.basqet.com/pl_aBcDeFgHiJkLmNo",
"metadata": null,
"created_at": "2026-04-22T10:30:00.000Z",
"last_used": null,
"deleted_at": null
}
Error Reference
| HTTP Code | Error Code | Resolution |
|---|---|---|
| 404 | link_not_found | Verify the id is correct and belongs to your account. |
Update Payment Link
API Details
Action: Update Payment Link
Method: PATCH
Path: /v1/payment-links/:id
Auth Requirement: Secret Key
Business Summary
Updates one or more fields on an existing payment link. At least one field must be provided.
Request Parameters
Request Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token in the form Bearer sec_... (your secret key). |
| Content-Type | string | Yes | application/json |
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The unique ID of the payment link to update. |
Body Parameters
All fields are optional, but at least one must be provided.
| Name | Type | Required | Allowed Values | Description |
|---|---|---|---|---|
| title | string | No | 2–100 chars | Updated display name for the payment link. |
| link_type | string | No | "static", "dynamic" | Changing to "static" requires an amount. Changing to "dynamic" clears any existing amount. |
| currency | string | No | USD, NGN, GBP, EUR | Updated fiat currency for the link. |
| amount | string | number | null | No | Numeric, > 0 | Required when changing link_type to "static". Set to null with "dynamic". |
| description | string | null | No | Max 255 chars | Updated description for the link. |
| metadata | object | null | No | Any JSON object | Replaces the existing metadata. Set to null to clear. |
| pass_fee_to_customer | boolean | No | true, false | Update whether the Basqet processing fee is passed to the customer. |
| pass_settlement_fee_to_customer | boolean | No | true, false | Update whether the settlement fee is passed to the customer. |
Request Example
cURL
curl --request PATCH \
--url https://api.basqet.com/v1/payment-links/bq_pl_aBcDeFgHiJkLmNo \
--header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"title": "Invoice #1024 (Updated)",
"amount": "200.00"
}'
Sample Response
{
"id": "bq_pl_aBcDeFgHiJkLmNo",
"title": "Invoice #1024 (Updated)",
"link_type": "static",
"currency": "USD",
"amount": 200.0,
"payment_url": "https://pay.basqet.com/pl_aBcDeFgHiJkLmNo",
"metadata": null,
"created_at": "2026-04-22T10:30:00.000Z",
"last_used": null,
"deleted_at": null
}
Error Reference
| HTTP Code | Error Code | Resolution |
|---|---|---|
| 400 | missing_amount | amount must be provided when changing link_type to "static". |
| 400 | invalid_amount | amount must be greater than 0. |
| 404 | link_not_found | Verify the id is correct and belongs to your merchant account. |
Delete Payment Link
API Details
Action: Delete Payment Link
Method: DELETE
Path: /v1/payment-links/:id
Auth Requirement: Secret Key
Business Summary
Soft-deletes a payment link. Deleted links are no longer accessible to customers and are excluded from your default list view. This action cannot be undone via the API.
Request Parameters
Request Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token in the form Bearer sec_... (your secret key). |
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The unique ID of the payment link to delete. |
Request Example
cURL
curl --request DELETE \
--url https://api.basqet.com/v1/payment-links/bq_pl_aBcDeFgHiJkLmNo \
--header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx'
Sample Response
{
"id": "bq_pl_aBcDeFgHiJkLmNo",
"status": "deleted",
"deleted_at": "2026-04-22T14:00:00.000Z"
}
Error Reference
| HTTP Code | Error Code | Resolution |
|---|---|---|
| 404 | link_not_found | Verify the id is correct and belongs to your merchant account. |
| 409 | link_already_deleted | The payment link is already deleted. |
Notes
- All Merchant API endpoints require a secret key (
sec_...) in theAuthorizationheader. Public keys are not accepted. - Payment links in live mode require your merchant account to have completed KYB verification.
- Deleting a payment link is a soft delete — the record is retained but the link becomes inactive. Use
status=archivedin the List endpoint to retrieve deleted links. - The
payment_urlreturned in responses is the shareable link to send to your customers. When a customer opens this URL, they will be taken through the Basqet-hosted checkout flow. - For merchants using payment links with the Initialize Transaction API, you can pass the payment link's
url_slug(prefixed withpl_) as thepayment_linkparameter when initializing a transaction. This associates the transaction with the link's configuration.
Message Tega:ai-champion-badge:Prompt Engineer 👷
Updated about 4 hours ago