Payment Links 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 instead of creating them manually through the dashboard.

Payment links are reusable. A payment link can be opened and paid through multiple times, whether it is static or dynamic. Each time a customer uses a payment link, Basqet creates a new checkout session, or transaction, for that use. The link itself remains 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

FieldValue
ActionCreate Payment Link
MethodPOST
Path/v1/payment-links
Auth RequirementSecret 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_..., using your secret key.
Content-TypestringYesMust be application/json.

Body Parameters

NameTypeRequiredDefaultAllowed ValuesDescription
titlestringYes2–100 charactersDisplay name for the payment link.
link_typestringYesstatic, dynamicstatic requires a fixed amount. dynamic lets the customer enter the amount at checkout.
currencystringYesUSD, NGN, GBP, EURFiat currency the payment is priced in. Must be uppercase.
amountstringConditionalNumeric value greater than 0Required when link_type is static. Omit or set to null for dynamic links.
descriptionstringNonullMaximum 255 charactersOptional description for the link.
metadataobjectNonullAny JSON objectCustom data 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, e.g. bq_pl_....
titlestringNoPayment link title.
link_typestringNoEither static or dynamic.
currencystringNoFiat currency code, e.g. USD or NGN.
amountnumber/nullYesFixed payment amount for static links. null for dynamic links.
payment_urlstringNoShareable Basqet-hosted checkout URL for this payment link.
metadataobject/nullYesEcho of the metadata 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 that the currency code is supported.
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 was 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

FieldValue
ActionList Payment Links
MethodGET
Path/v1/payment-links
Auth RequirementSecret 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_..., using your secret key.

Query Parameters

NameTypeRequiredDefaultAllowed ValuesDescription
offsetnumberNo0Integer greater than or equal to 0Number of records to skip.
limitnumberNo10Integer from 1 to 100Number of records to return.
orderstringNodescasc, descSort order by creation date.
fromstringNoDate string in YYYY-MM-DD formatFilter links created on or after this date.
tostringNoDate string in YYYY-MM-DD formatFilter links created on or before this date.
search_termstringNoSearch links by title or currency code.
statusstringNoactiveactive, archived, allFilter 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
dataarrayNoArray of payment link objects.
meta.limitnumberNoLimit 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

FieldValue
ActionGet Payment Link
MethodGET
Path/v1/payment-links/:id
Auth RequirementSecret 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_..., using your secret key.

Path Parameters

NameTypeRequiredDescription
idstringYesUnique ID of the payment link, e.g. bq_pl_....

Request Example

cURL

curl --request GET \
  --url https://api.basqet.com/v1/payment-links/bq_pl_aBcDeFgHiJkLmNo \
  --header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx'

Sample Response

{
  "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 that the id is correct and belongs to your account.

Update Payment Link

API Details

FieldValue
ActionUpdate Payment Link
MethodPATCH
Path/v1/payment-links/:id
Auth RequirementSecret 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_..., using your secret key.
Content-TypestringYesMust be application/json.

Path Parameters

NameTypeRequiredDescription
idstringYesUnique ID of the payment link to update.

Body Parameters

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

NameTypeRequiredAllowed ValuesDescription
titlestringNo2–100 charactersUpdated display name for the payment link.
link_typestringNostatic, dynamicChanging to static requires an amount. Changing to dynamic clears any existing amount.
currencystringNoUSD, NGN, GBP, EURUpdated fiat currency for the link.
amountstring/number/nullNoNumeric value greater than 0Required when changing link_type to static. Set to null with dynamic.
descriptionstring/nullNoMaximum 255 charactersUpdated description for the link.
metadataobject/nullNoAny JSON objectReplaces the existing metadata. Set to null to clear.
pass_fee_to_customerbooleanNotrue, falseUpdates whether the Basqet processing fee is passed to the customer.
pass_settlement_fee_to_customerbooleanNotrue, falseUpdates 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 that the id is correct and belongs to your merchant account.

Delete Payment Link

API Details

FieldValue
ActionDelete Payment Link
MethodDELETE
Path/v1/payment-links/:id
Auth RequirementSecret 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_..., using your secret key.

Path Parameters

NameTypeRequiredDescription
idstringYesUnique 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 that 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 in the form 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 are taken through the Basqet-hosted checkout flow.
  • For merchants using payment links with the Initialize Transaction API, 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.