Create payment link
create_payment_linkCreates a reusable Midtrans Payment Link URL that customers open to pay a specified amount in IDR.
Instructions
Create a reusable Midtrans Payment Link and return its URL. The customer opens the URL to pay. Amount is in IDR (integer).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"title": "<title>",
"amount": "<amount>"
},
"name": "create_payment_link"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title shown on the payment page. | |
| amount | Yes | Amount in IDR (integer, no decimals). | |
| description | No | Optional description shown on the payment page. | |
| expiry_unit | No | Unit for expiry_duration (default: days). | |
| usage_limit | No | Optional maximum number of times the link can be paid. | |
| expiry_duration | No | Optional link validity length, combined with expiry_unit. | |
| customer_required | No | Whether the customer must fill in their details. |