Get all payment information created using a specific payment link.
Request
Endpoints: /v1/payment-links/{order_id}
HTTP Method: GET
Headers:
Accept: application/json
Content-Type: application/json
Authorization: Basic AUTH_STRING
AUTH_STRING
value is result of basicAuth("YourServerKey"+":"
)
order_id
refers to your payment link Order ID.
Midtrans API validates HTTP request by using Basic Authentication method. The username is your Server Key while the password is empty. The authorization header value is represented by AUTH_STRING. AUTH_STRING is base-64 encoded string of your username and password separated by colon symbol (:). For more details, refer to API Authorization and Headers.
Response
Sample Response
{
"id": "1",
"payment_link_url": "https://app.midtrans.com/payment-links/abc",
"order_id": "001",
"payment_link_type": "FIXED_AMOUNT",
"merchant_id": "M001",
"payment_link_id": "abc",
"enabled_payments": [
"credit_card",
"bca_va",
"indomaret"
],
"usage_limit": 2,
"gross_amount": 190000,
"credit_card_3d_secure": true,
"whitelist_bins": [
"4645",
"4811111",
"bca",
"mandiri"
],
"expiry_start": "2020-12-31 18:00 +0700",
"expiry_duration": 2,
"expiry_unit": "days",
"usage": 2,
"item_details": [
{
"id": "1",
"name": "Pillow",
"price": 95000,
"quantity": 2,
"brand": "Midtrans",
"category": "Furniture",
"merchant_name": "PT. Midtrans",
"item_id": "pil-001",
"payment_link_id": "1",
"created_at": "2017-11-02T10:53:21.000Z",
"updated_at": "2017-11-02T10:53:21.000Z"
}
],
"customer_details": {
"id": "1",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone": "+62181000000000",
"notes": "Thank you for your purchase. Please follow the instructions to pay.",
"payment_link_id": "1",
"created_at": "2017-11-02T10:53:21.000Z",
"updated_at": "2017-11-02T10:53:21.000Z"
},
"purchases": [
{
"id": 49118,
"snap_token": "4fdbd319-0706-4cc7-9fb5-508bf8824886",
"order_id": "1525840754698-1658897316-1658897332986",
"payment_status": "EXPIRE",
"payment_method": "BANK_TRANSFER",
"created_at": "2022-07-27T04:48:53.000Z",
"updated_at": "2022-07-27T04:49:09.000Z",
"payment_link_id": 54210
},
{
"id": 49119,
"snap_token": "b50ac063-32e3-4e94-b951-86099bc42dc6",
"order_id": "1525840754698-1658897316-1658897356076",
"payment_status": "PENDING",
"payment_method": "BANK_TRANSFER",
"created_at": "2022-07-27T04:49:16.000Z",
"updated_at": "2022-07-27T04:49:27.000Z",
"payment_link_id": 54210
}
],
//the following info are only for dynamic_amount type :
"dynamic_amount": {
"min_amount": 5000,
"max_amount": 5000,
"preset_amount": 5000
},
}
Response Detail
Parameter | Type | Description |
---|---|---|
id | String | ID of payment link |
order_id | String | Order ID of payment link or Transactions. Order ID returned under purchases refer to transaction's order ID |
payment_link_type | String | Type of payment link whether it's DYNAMIC_AMOUNT and FIXED_AMOUNT |
merchant_id | String | Merchant's Midtrans account ID |
payment_link_id | String | Payment link ID, refers to last part of payment link URL. E.g. if payment link URL is https://app.midtrans.com/payment-links/abc , payment link ID refers to abc |
usage_limit | Integer | Maximum usage of payment link (counted by # of successful payment that can be made) |
usage | Integer | Current count of payment link usage (counted by # of successful payment that have been made) |
gross_amount | Integer | Transaction amount |
enabled_payments | Array | List of payment methods that are enabled for said payment link |
item_details | Object | Transaction's item details |
customer_details | Object | Details of customer of each transactions |
expiry_start | String | Payment link's expiry start time |
expiry_duration | Integer | Payment link's expiry duration |
expiry_unit | String | Time unit of payment link's expiry duration |
purchases | Array | List of transactions made using the specified payment link |