Payment Links

Create and manage payment links.

Payment Links API

Payment Links allow you to create shareable URLs that accept payments without writing checkout code.

{
  "id": "pl_abc123def456",
  "object": "payment_link",
  "active": true,
  "amount": 50,
  "currency": "GHS",
  "name": "Premium Subscription",
  "description": "Monthly subscription to Premium plan",
  "url": "https://pay.shikacreators.com/pay/pl_abc123def456",
  "image_url": null,
  "allow_promotion_codes": false,
  "after_completion": {
    "type": "redirect",
    "redirect": {
      "url": "https://yoursite.com/success"
    }
  },
  "usage_limit": null,
  "collect_phone": true,
  "collect_email": true,
  "collect_name": false,
  "metadata": {
    "product_id": "prod_123"
  },
  "created_at": "2024-01-15T10:00:00Z"
}

Attributes

AttributeTypeDescription
idstringUnique identifier
objectstringAlways "payment_link"
activebooleanWhether link is active
amountnumberAmount in GHS (null if using line items)
currencystringCurrency code
namestringLink name/title
descriptionstringDescription
urlstringShareable payment URL
image_urlstringImage URL for the payment link
allow_promotion_codesbooleanAllow promotion/coupon codes
after_completionobjectBehavior after payment completion
usage_limitintegerMaximum number of times this link can be used
collect_phonebooleanRequire phone number
collect_emailbooleanRequire email
collect_namebooleanRequire name
metadataobjectCustom metadata
created_atstringCreation timestamp

Creates a new payment link.

POST /v1/payment_links

Request Body

ParameterTypeRequiredDescription
namestringYesLink name
amountnumberNoAmount in GHS
currencystringNoCurrency (default: GHS)
line_itemsarrayNoLine items with price/amount and quantity
descriptionstringNoDescription
image_urlstringNoImage URL to display
allow_promotion_codesbooleanNoAllow coupon/promo codes (default: false)
after_completionobjectNoBehavior after payment (e.g., { "type": "redirect", "redirect": { "url": "..." } })
usage_limitintegerNoMaximum number of uses
collect_phonebooleanNoRequire phone (default: true)
collect_emailbooleanNoRequire email (default: false)
collect_namebooleanNoRequire name (default: false)
metadataobjectNoCustom metadata
# Fixed amount link
curl -X POST https://api.shikacreators.com/v1/payment_links \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50,
    "currency": "GHS",
    "name": "Premium Subscription",
    "description": "Monthly subscription to Premium plan",
    "collect_email": true,
    "after_completion": {
      "type": "redirect",
      "redirect": { "url": "https://yoursite.com/success" }
    },
    "metadata": {
      "product_id": "prod_123"
    }
  }'

# Link with line items
curl -X POST https://api.shikacreators.com/v1/payment_links \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Bundle Deal",
    "line_items": [
      { "price": 25, "quantity": 2 },
      { "price": 10, "quantity": 1 }
    ],
    "collect_email": true,
    "collect_name": true
  }'
// Fixed amount link
const link = await shikacreators.paymentLinks.create({
  amount: 50,
  currency: 'GHS',
  name: 'Premium Subscription',
  description: 'Monthly subscription to Premium plan',
  collect_email: true,
  after_completion: {
    type: 'redirect',
    redirect: { url: 'https://yoursite.com/success' }
  },
  metadata: {
    product_id: 'prod_123'
  }
})

console.log(link.url) // https://pay.shikacreators.com/pay/pl_abc123

// Link with line items
const bundleLink = await shikacreators.paymentLinks.create({
  name: 'Bundle Deal',
  line_items: [
    { price: 25, quantity: 2 },
    { price: 10, quantity: 1 }
  ],
  collect_email: true,
  collect_name: true
})
# Fixed amount link
link = client.payment_links.create(
    amount=50,
    currency='GHS',
    name='Premium Subscription',
    description='Monthly subscription to Premium plan',
    collect_email=True,
    after_completion={
        'type': 'redirect',
        'redirect': {'url': 'https://yoursite.com/success'}
    },
    metadata={'product_id': 'prod_123'}
)

print(link.url)  # https://pay.shikacreators.com/pay/pl_abc123

# Link with line items
bundle_link = client.payment_links.create(
    name='Bundle Deal',
    line_items=[
        {'price': 25, 'quantity': 2},
        {'price': 10, 'quantity': 1}
    ],
    collect_email=True,
    collect_name=True
)
// Fixed amount link
$link = $shikacreators->paymentLinks->create([
    'amount' => 50,
    'currency' => 'GHS',
    'name' => 'Premium Subscription',
    'description' => 'Monthly subscription to Premium plan',
    'collect_email' => true,
    'after_completion' => [
        'type' => 'redirect',
        'redirect' => ['url' => 'https://yoursite.com/success']
    ],
    'metadata' => ['product_id' => 'prod_123']
]);

echo $link->url;

// Link with line items
$bundleLink = $shikacreators->paymentLinks->create([
    'name' => 'Bundle Deal',
    'line_items' => [
        ['price' => 25, 'quantity' => 2],
        ['price' => 10, 'quantity' => 1]
    ],
    'collect_email' => true,
    'collect_name' => true
]);

Retrieves a payment link by ID.

GET /v1/payment_links/:id
curl https://api.shikacreators.com/v1/payment_links/pl_abc123def456 \
  -H "Authorization: Bearer sk_test_..."
const link = await shikacreators.paymentLinks.retrieve('pl_abc123def456')
link = client.payment_links.retrieve('pl_abc123def456')

Updates a payment link.

PATCH /v1/payment_links/:id

Request Body

ParameterTypeDescription
namestringLink name
descriptionstringDescription
activebooleanWhether link is active
image_urlstringImage URL
after_completionobjectBehavior after payment
metadataobjectCustom metadata
curl -X PATCH https://api.shikacreators.com/v1/payment_links/pl_abc123def456 \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Product Name",
    "active": true
  }'
const link = await shikacreators.paymentLinks.update('pl_abc123def456', {
  name: 'Updated Product Name',
  active: true
})
link = client.payment_links.update('pl_abc123def456',
    name='Updated Product Name',
    active=True
)

Returns a list of payment links.

GET /v1/payment_links

Query Parameters

ParameterTypeDescription
limitintegerNumber of results (1-100)
starting_afterstringCursor for pagination
activebooleanFilter by active status
curl "https://api.shikacreators.com/v1/payment_links?active=true&limit=10" \
  -H "Authorization: Bearer sk_test_..."
const links = await shikacreators.paymentLinks.list({
  active: true,
  limit: 10
})
links = client.payment_links.list(active=True, limit=10)

Deactivate a link to stop accepting payments:

const link = await shikacreators.paymentLinks.update('pl_abc123def456', {
  active: false
})

List payments made through a specific link:

const payments = await shikacreators.payments.list({
  payment_link: 'pl_abc123def456'
})

console.log(`Total payments: ${payments.data.length}`)

Or use webhooks:

app.post('/webhooks', (req, res) => {
  const event = Webhook.constructEvent(req.body, signature, secret)

  if (event.type === 'payment.succeeded') {
    const payment = event.data.object

    if (payment.payment_link) {
      console.log(`Payment via link: ${payment.payment_link}`)
      // Process the payment
    }
  }

  res.json({ received: true })
})