5.9: Retrieve a Reservation by ID
In this section, we will guide you through the process of retrieving detailed information about a specific reservation using the Golfdigg OTA API.
You will need the reservation ID to perform this operation.
5.9.1: Endpoint
To retrieve a reservation by its ID, you will use the following endpoint:
- Endpoint:
/api/v1/ext/order/{id} - Method: GET
5.9.2: Request Parameters
In your API request, include the following parameter:
Authorization(Header): Use Basic Authentication with your API credentials.
5.9.3: Request Example
Here's an example of how to structure your API request to retrieve a reservation by its ID (replace {id} with the actual reservation ID):
GET /api/v1/ext/order/abcd1234
Host: ota-api.golfdigg.com
Authorization: Basic base64_encoded(apiKey)
5.9.4: Response Example
The API will respond with detailed information about the specified reservation. Here's a sample response:
{
"id": "654c8186b6efd4994d3de2c1",
"status": "REFUND",
"txNo": "ORDER-2023-11-09-314104581",
"agencyId": "6538dd8d227235165f374846",
"agencyName": "golfdigg test2",
"slotId": "653f6746e4b0fb16f3e2d292",
"courseId": "5c9c8252ef0ab53dcf12e8d2",
"courseName": "331 GOLF CLUB-test",
"walletId": "6538dd8e227235165f374847",
"customerName": "testApi",
"customerEmail": "testApi",
"customerMobile": "testApi",
"amount": 172000,
"priceAfterDiscount": 172000,
"reserveId": "654c8186e4b0d75122af75be",
"reserve": {
"id": "654c8186e4b0d75122af75be",
"code": "G231109-00003",
"gdInvoiceId": "TESTGDTH331G2023110028",
"status": "CANCEL",
"paidAt": 1699512725689,
"refundAt": 1699512727689,
"golf": {
"slotTime": 1700131800000,
"slotTimeString": "2023-11-16T17:50:00+0700",
"persons": 1,
"carts": 1,
"caddies": 1
}
},
"createdAt": "2023-11-09T06:51:49.601Z",
"updatedAt": "2023-11-09T06:55:06.86Z"
}