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

NameTypeRequiredDescription
AuthorizationstringYesBearer token in the form Bearer sec_... (your secret key).
Content-TypestringYesapplication/json

Body Parameters

NameTypeRequiredDefaultAllowed ValuesDescription
titlestringYes-2–100 charsDisplay name for the payment link.
link_typestringYes-"static", "dynamic"static requires a fixed amount. dynamic lets the customer enter the amount at checkout.
currencystringYes-USD, NGN, GBP, EURThe fiat currency the payment is priced in. Must be uppercase.
amountstringConditionally-Numeric, > 0Required when link_type is "static". Omit or set to null for dynamic links.
descriptionstringNonullMax 255 charsOptional description for the link.
metadataobjectNonullAny JSON objectCustom data you want to attach to the link. Returned as-is in responses.
pass_fee_to_customerbooleanNofalsetrue, falseWhen true, the Basqet processing fee is passed to the customer.
pass_settlement_fee_to_customerbooleanNofalsetrue, falseWhen 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

FieldTypeNullableDescription
messagestringNoAlways "Payment Link created" on success.
idstringNoUnique identifier for the payment link (bq_pl_…).
titlestringNoThe payment link's title.
link_typestringNo"static" or "dynamic".
currencystringNoThe fiat currency code (e.g., USD, NGN).
amountnumber | nullYesFixed payment amount for static links. null for dynamic links.
payment_urlstringNoThe shareable Basqet-hosted checkout URL for this payment link.
metadataobject | nullYesEcho of the metadata you passed in, or null when omitted.
created_atstringNoISO 8601 timestamp of link creation.
last_usedstring | nullYesISO 8601 timestamp of the most recent use. null if unused.
deleted_atstring | nullYesISO 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 CodeError CodeResolution
400missing_required_fieldEnsure title, link_type, and currency are all present in the body.
400invalid_link_typelink_type must be exactly "static" or "dynamic".
400invalid_currencyVerify the currency code is supported (USD, NGN, etc.).
400missing_amountamount is required when link_type is "static".
400invalid_amountamount must be a number greater than 0.
400invalid_metadatametadata must be a valid JSON object.
404merchant_user_not_foundNo merchant user found for the provided secret key.
422Varies based on KYC statusThe 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

NameTypeRequiredDescription
AuthorizationstringYesBearer token in the form Bearer sec_... (your secret key).

Query Parameters

NameTypeRequiredDefaultAllowed ValuesDescription
offsetnumberNo0Integer ≥ 0Number of records to skip.
limitnumberNo10Integer 1–100Number of records to return.
orderstringNodesc"asc", "desc"Sort order by creation date.
fromstringNo-Date string YYYY-MM-DDFilter links created on or after this date.
tostringNo-Date string YYYY-MM-DDFilter links created on or before this date.
search_termstringNo--Search links by title or currency code.
statusstringNoactive"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

FieldTypeNullableDescription
dataPaymentLink[]NoArray of payment link objects.
meta.limitnumberNoThe limit applied to the request.
meta.countnumberNoTotal number of matching payment links.
meta.hasNextbooleanNotrue 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

NameTypeRequiredDescription
AuthorizationstringYesBearer token in the form Bearer sec_... (your secret key).

Path Parameters

NameTypeRequiredDescription
idstringYesThe 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 CodeError CodeResolution
404link_not_foundVerify 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

NameTypeRequiredDescription
AuthorizationstringYesBearer token in the form Bearer sec_... (your secret key).
Content-TypestringYesapplication/json

Path Parameters

NameTypeRequiredDescription
idstringYesThe unique ID of the payment link to update.

Body Parameters

All fields are optional, but at least one must be provided.

NameTypeRequiredAllowed ValuesDescription
titlestringNo2–100 charsUpdated display name for the payment link.
link_typestringNo"static", "dynamic"Changing to "static" requires an amount. Changing to "dynamic" clears any existing amount.
currencystringNoUSD, NGN, GBP, EURUpdated fiat currency for the link.
amountstring | number | nullNoNumeric, > 0Required when changing link_type to "static". Set to null with "dynamic".
descriptionstring | nullNoMax 255 charsUpdated description for the link.
metadataobject | nullNoAny JSON objectReplaces the existing metadata. Set to null to clear.
pass_fee_to_customerbooleanNotrue, falseUpdate whether the Basqet processing fee is passed to the customer.
pass_settlement_fee_to_customerbooleanNotrue, falseUpdate 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 CodeError CodeResolution
400missing_amountamount must be provided when changing link_type to "static".
400invalid_amountamount must be greater than 0.
404link_not_foundVerify 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

NameTypeRequiredDescription
AuthorizationstringYesBearer token in the form Bearer sec_... (your secret key).

Path Parameters

NameTypeRequiredDescription
idstringYesThe 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 CodeError CodeResolution
404link_not_foundVerify the id is correct and belongs to your merchant account.
409link_already_deletedThe payment link is already deleted.

Notes

  • All Merchant API endpoints require a secret key (sec_...) in the Authorization header. 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=archived in the List endpoint to retrieve deleted links.
  • The payment_url returned 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 with pl_) as the payment_link parameter when initializing a transaction. This associates the transaction with the link's configuration.
    Message Tega:ai-champion-badge:Prompt Engineer 👷