Paymenku Docs
Referensi APIPayment link

Buat payment link

POST
/payment-link/create

Membuat tautan pembayaran. Merchant tidak memilih kanal — pelanggan memilih sendiri di halaman checkout.

Tautan ini melahirkan transaksi nyata, sehingga kunci sandbox ditolak dengan 403. Pakai kunci live.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Kirim kunci API sebagai bearer token pada header Authorization, dengan format Bearer YOUR_APIKEY.

Ada dua jenis kunci:

  • sk_live_ — produksi. Transaksi nyata, dan butuh KYC yang sudah disetujui.
  • sk_test_ — sandbox. Tanpa perpindahan dana, tanpa syarat KYC.

Ambil kunci di Dashboard Merchant, menu Settings lalu API Keys.

Kunci API adalah kredensial rahasia: simpan di environment variable atau secret manager. Jangan pernah menaruhnya di frontend, aplikasi mobile, atau repositori publik.

Request Body

application/json
  1. body
amount*number
Range1000 <= value
title?string

Bila kosong, memakai nama item pertama atau "Pembayaran".

Lengthlength <= 255
description?string
Lengthlength <= 1000
customer_name*string
Lengthlength <= 255
customer_email*string
Formatemail
Lengthlength <= 255
return_url?string
Formaturi
expires_in_minutes?integer

Masa berlaku 5 menit sampai 30 hari. Bawaan 24 jam.

Range5 <= value <= 43200
Default1440
is_single_use?boolean

Bila true, tautan mati setelah satu pembayaran berhasil.

Defaulttrue
order_items?array<>
Itemsitems <= 100

Response Body

Tautan dibuat.

application/json
  1. response
status?string
message?string
data?
Example Request
curl -X POST 'https://paymenku.com/api/v1/payment-link/create' \  -H 'Content-Type: application/json' \  -d '{  "amount": 150000,  "title": "Invoice",  "customer_name": "Budi Santoso",  "customer_email": "budi@example.com",  "return_url": "https://tokoanda.com/selesai",  "order_items": [    {      "name": "Paket Internet 30 Hari",      "quantity": 1    }  ]}'
Example Response
{  "status": "success",  "message": "Payment link berhasil dibuat",  "data": {    "link_id": "PLAB12CD34EF56",    "payment_url": "https://paymenku.com/link/PLAB12CD34EF56",    "title": "Invoice",    "description": null,    "amount": 150000,    "items": [      {        "name": "Paket Internet 30 Hari",        "quantity": 1      }    ],    "status": "active",    "is_single_use": true,    "expires_at": "2026-10-28T09:00:00+07:00",    "expires_in_minutes": 1440,    "customer_name": "Budi Santoso",    "customer_email": "budi@example.com",    "return_url": "https://tokoanda.com/selesai",    "created_at": "2026-10-27T09:00:00+07:00"  }}