Create Snap transaction
create_snap_transactionCreate a Midtrans Snap transaction to get a payment token and redirect URL for the Snap payment page, using a unique order ID and gross amount in IDR.
Instructions
Create a Midtrans Snap transaction and get back a token and redirect_url for the Snap payment page. gross_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": {
"order_id": "<order_id>",
"gross_amount": "<gross_amount>"
},
"name": "create_snap_transaction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Unique order id for this transaction. | |
| gross_amount | Yes | Total amount in IDR (integer, no decimals). | |
| item_details | No | Optional item list. If given, the sum of price*quantity must equal gross_amount. | |
| customer_details | No | Optional customer information shown on the Snap page. | |
| enabled_payments | No | Optional list of payment channels to enable, e.g. ['gopay','bca_va','credit_card']. |