Skip to content
ZytePedevelopersDashboard
DocsAPI reference
API reference

Create Payment Link

Creates a collection intent and returns the checkout URL/slug for customer payment.

POST/api/v1/collections/intents/apiMerchant HMAC
Use your enabled merchant account. Examples run on your server, never in this documentation.

Authentication

Use merchant HMAC headers and sign the exact path, query and raw body.

See authentication.

Workflow notes

  • Use notify_url when a single link needs its own callback destination. The merchant profile notify URLs remain the account-level defaults.
  • The returned short_id is the slug used by the checkout flow and the public link-status endpoint. Observed test condition: This specific merchant received HTTP 400 with CCAvenue PSP MID is not assigned to this merchant. despite passing authentication. PSP mapping/merchant enablement must be verified; do not imply a sandbox exists. The sample request sets max_limit but the sample response has max_limit: null; confirm actual field semantics before writing parameter rules.

Before you send

Check the field labels and use your enabled merchant account. Examples illustrate the API contract; confirm deployment-specific limits and error handling before launch. This page never sends a request.

Request example

Choose Node.js, Python, PHP, Ruby, Java or cURL. Run signed requests on your backend. PHP, Ruby and Java include signing directly. Java requires JDK 17 or newer.

import { signedHeaders } from './signing.mjs';
const path = `/api/v1/collections/intents/api`;
const query = '';
const payload = {
  "title": "Invoice INV-2042",
  "description": "April subscription renewal",
  "usage_limit": 1,
  "amount": 2500,
  "min_limit": 1,
  "max_limit": 50000,
  "currency": "INR",
  "expiry_days": 7,
  "external_id": "INV-2042",
  "notify_url": "https://merchant.example.com/hooks/collection-link",
  "customer_context": {
    "full_name": "Rahul Sharma",
    "email_address": "rahul@example.com",
    "phone_number": "9876543210",
    "dial_code": "+91"
  },
  "tags": {
    "source": "merchant-api",
    "channel": "web"
  }
};
const body = JSON.stringify(payload);
const headers = signedHeaders({
  method: 'POST', path, query, body,
  keyId: process.env.ZYTEPE_API_KEY_ID,
  secret: process.env.ZYTEPE_API_SECRET,
});
headers['Content-Type'] = 'application/json';
const url = 'https://api.zytepe.com' + path + (query ? '?' + query : '');
const response = await fetch(url, { method: 'POST', headers, body });
if (!response.ok) throw new Error('Request failed: HTTP ' + response.status);
const result = await response.json();
// Store the returned identifiers securely. Do not log customer data.

Request fields

Optional fields can be omitted. Conditional fields depend on the payment method. Labels reflect the reviewed API schemas and handler checks.

titleRequired

Checkout title.

amountRequired

Payment amount in the documented currency.

external_idRequired

Your order or invoice reference; required by the API checkout handler.

customer_contextRequired

Customer identity; required by the API checkout handler.

customer_context.full_nameRequired

Required customer detail.

customer_context.email_addressRequired

Required customer detail.

customer_context.phone_numberRequired

Required customer detail.

descriptionOptional

Additional checkout description.

usage_limitOptional

Defaults to 1.

min_limitOptional

Defaults to 1.0000.

max_limitOptional

Upper amount limit; source examples do not establish its effect on a fixed-amount checkout.

currencyOptional

Defaults to INR.

expiry_daysOptional

Defaults to 7 days.

customer_context.dial_codeOptional

Defaults to +91.

notify_urlOptional

Link-specific callback destination.

tagsOptional

Additional business context.

Request body

JSON · request.json
{
  "title": "Invoice INV-2042",
  "description": "April subscription renewal",
  "usage_limit": 1,
  "amount": 2500,
  "min_limit": 1,
  "max_limit": 50000,
  "currency": "INR",
  "expiry_days": 7,
  "external_id": "INV-2042",
  "notify_url": "https://merchant.example.com/hooks/collection-link",
  "customer_context": {
    "full_name": "Rahul Sharma",
    "email_address": "rahul@example.com",
    "phone_number": "9876543210",
    "dial_code": "+91"
  },
  "tags": {
    "source": "merchant-api",
    "channel": "web"
  }
}

Example response

JSON · response
{
  "success": true,
  "message": "Payment link created via API.",
  "data": {
    "id": "49c2ebf2-f651-473e-ab78-6c154665df92",
    "short_id": "s0oJRkuT6OY",
    "title": "Invoice INV-2042",
    "description": "April subscription renewal",
    "fixed_amount": "2500.0000",
    "min_limit": "1.0000",
    "max_limit": null,
    "currency": "INR",
    "usage_limit": 1,
    "current_usage_count": 0,
    "status": "active",
    "is_active": true,
    "expires_at": "2026-05-10T10:30:00Z",
    "checkout_url": "https://pay.zytepe.com/s0oJRkuT6OY"
  }
}