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.
The Payment Link Object
{
"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
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier |
object | string | Always "payment_link" |
active | boolean | Whether link is active |
amount | number | Amount in GHS (null if using line items) |
currency | string | Currency code |
name | string | Link name/title |
description | string | Description |
url | string | Shareable payment URL |
image_url | string | Image URL for the payment link |
allow_promotion_codes | boolean | Allow promotion/coupon codes |
after_completion | object | Behavior after payment completion |
usage_limit | integer | Maximum number of times this link can be used |
collect_phone | boolean | Require phone number |
collect_email | boolean | Require email |
collect_name | boolean | Require name |
metadata | object | Custom metadata |
created_at | string | Creation timestamp |
Create a Payment Link
Creates a new payment link.
POST /v1/payment_linksRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Link name |
amount | number | No | Amount in GHS |
currency | string | No | Currency (default: GHS) |
line_items | array | No | Line items with price/amount and quantity |
description | string | No | Description |
image_url | string | No | Image URL to display |
allow_promotion_codes | boolean | No | Allow coupon/promo codes (default: false) |
after_completion | object | No | Behavior after payment (e.g., { "type": "redirect", "redirect": { "url": "..." } }) |
usage_limit | integer | No | Maximum number of uses |
collect_phone | boolean | No | Require phone (default: true) |
collect_email | boolean | No | Require email (default: false) |
collect_name | boolean | No | Require name (default: false) |
metadata | object | No | Custom 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
]);Retrieve a Payment Link
Retrieves a payment link by ID.
GET /v1/payment_links/:idcurl 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')Update a Payment Link
Updates a payment link.
PATCH /v1/payment_links/:idRequest Body
| Parameter | Type | Description |
|---|---|---|
name | string | Link name |
description | string | Description |
active | boolean | Whether link is active |
image_url | string | Image URL |
after_completion | object | Behavior after payment |
metadata | object | Custom 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
)List Payment Links
Returns a list of payment links.
GET /v1/payment_linksQuery Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results (1-100) |
starting_after | string | Cursor for pagination |
active | boolean | Filter 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 Payment Link
Deactivate a link to stop accepting payments:
const link = await shikacreators.paymentLinks.update('pl_abc123def456', {
active: false
})Track Payments from Links
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 })
})