curl -X POST https://juadah-backend.vercel.app/api/products/1/payments \
-H "Content-Type: application/json" \
-H "Cookie: accessToken=your_access_token" \
-d '{
"transaction_details": {
"product_id": 1,
"gross_amount": 50000,
"product_count_total": 5
},
"customer_details": {
"email": "customer@example.com",
"fullname": "John Doe",
"address_id": 1
}
}'
{
"status": "success",
"data": {
"token": "66e4fa55-fdac-4ef9-91b5-733b97d1b862",
"redirect_url": "https://app.sandbox.midtrans.com/snap/v2/vtweb/66e4fa55-fdac-4ef9-91b5-733b97d1b862"
}
}
Initiates a payment transaction and returns a payment token from Midtrans
curl -X POST https://juadah-backend.vercel.app/api/products/1/payments \
-H "Content-Type: application/json" \
-H "Cookie: accessToken=your_access_token" \
-d '{
"transaction_details": {
"product_id": 1,
"gross_amount": 50000,
"product_count_total": 5
},
"customer_details": {
"email": "customer@example.com",
"fullname": "John Doe",
"address_id": 1
}
}'
{
"status": "success",
"data": {
"token": "66e4fa55-fdac-4ef9-91b5-733b97d1b862",
"redirect_url": "https://app.sandbox.midtrans.com/snap/v2/vtweb/66e4fa55-fdac-4ef9-91b5-733b97d1b862"
}
}
Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zulfikarrosadi/juadah-backend/llms.txt
Use this file to discover all available pages before exploring further.
curl -X POST https://juadah-backend.vercel.app/api/products/1/payments \
-H "Content-Type: application/json" \
-H "Cookie: accessToken=your_access_token" \
-d '{
"transaction_details": {
"product_id": 1,
"gross_amount": 50000,
"product_count_total": 5
},
"customer_details": {
"email": "customer@example.com",
"fullname": "John Doe",
"address_id": 1
}
}'
{
"status": "success",
"data": {
"token": "66e4fa55-fdac-4ef9-91b5-733b97d1b862",
"redirect_url": "https://app.sandbox.midtrans.com/snap/v2/vtweb/66e4fa55-fdac-4ef9-91b5-733b97d1b862"
}
}
order_id (UUID) for each requestgross_amount should match the calculation: product price × product_count_totalredirect_url can be used to redirect customers directly to the payment page