Skip to content

Create Transaction

Create Transaction merupakan API yang digunakan untuk membuat Transaksi Baru dengan mengirimkan data yang dapat dilihat dari Body Request API.

POST https://h2h.amdigipay.com/api/payment/transaction
NameTypeDescription
Content-Typestringapplication/json
AuthorizationstringBearer <token>
NameTypeRequiredDescription
usernamestringYesUsername untuk login
passwordstringYesPassword untuk login
{
"payment_id": 22,
"username": "2LOMCMIUV6",
"signature": "0ef7c7e2ab7eb6fbad1fff85fc93c6866783157fe2f261155a5741b8ddda955c",
"expired_date": "2025-05-21 18:23:10",
"nominal": 10000,
"admin_fee": 3000,
"transaction_id": "0030c97b-5ccc-4482-b4af-9ffdb4a039b1",
"transaction_total": 13000,
"transaction_name": "testing",
"transaction_desc": "testing",
"customer_number": "085925065195",
"customer_name": "testing",
"customer_email": "[email protected]",
"item_details": [
{
"item_id": "testing",
"item_price": 10000,
"item_total_price": 10000,
"item_quantity": 1,
"item_name": "testing"
},
{
"item_id": "fee",
"item_price": 3000,
"item_total_price": 3000,
"item_quantity": 1,
"item_name": "fee"
}
]
}
{
"error": false,
"message": "success",
"data": {
"id": 6,
"payment_id": 37,
"payment_name": "GOPAY",
"status_id": 2,
"status": "On processing",
"transaction_id": "0030c97b-5ccc-4482-b4af-9ffdb4a039bc",
"transaction_total": "13000",
"expired_date": "2023-03-23 18:23:10",
"transaction_name": "testing",
"transaction_desc": "testing",
"customer_number": "085925065195",
"customer_name": "testing",
"customer_email": "[email protected]",
"payment_links": "https://app.midtrans.com/snap/v3/redirection/1ca52d24-1574-4f82-9f84-d4314a817348",
"payment_code": null,
"qr_code": null,
"item_details": [
{
"item_id": "testing",
"item_price": "10000",
"item_quantity": "1",
"item_total_price": "10000",
"item_name": "testing"
},
{
"item_id": "fee",
"item_price": "3000",
"item_quantity": "1",
"item_total_price": "3000",
"item_name": "fee"
}
]
}
}
{
"status": "error",
"message": "Invalid username or password",
"data": null
}

Error Response (500 Internal Server Error) (WIP)

Section titled “Error Response (500 Internal Server Error) (WIP)”
{
"status": "error",
"message": "Internal server error",
"data": null
}
  • Token yang diterima harus disimpan dan digunakan untuk autentikasi pada API lainnya.
  • Token memiliki masa aktif tertentu, biasanya 24 jam.
  • Setelah token kadaluarsa, pengguna harus melakukan login kembali.