Create Transaction
Create Transaction
Section titled “Create Transaction”Create Transaction merupakan API yang digunakan untuk membuat Transaksi Baru dengan mengirimkan data yang dapat dilihat dari Body Request API.
Endpoint
Section titled “Endpoint”POST https://h2h.amdigipay.com/api/payment/transaction
Request
Section titled “Request”Headers
Section titled “Headers”Name | Type | Description |
---|---|---|
Content-Type | string | application/json |
Authorization | string | Bearer <token> |
Body Parameters (WIP)
Section titled “Body Parameters (WIP)”Name | Type | Required | Description |
---|---|---|---|
username | string | Yes | Username untuk login |
password | string | Yes | Password untuk login |
Example Request
Section titled “Example Request”{ "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", "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" } ]}
Response
Section titled “Response”Success Response (200 OK)
Section titled “Success Response (200 OK)”{ "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", "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" } ] }}
Error Response (401 Unauthorized) (WIP)
Section titled “Error Response (401 Unauthorized) (WIP)”{ "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}
Notes (WIP)
Section titled “Notes (WIP)”- 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.