5.7: Release a Reservation
In this section, we will guide you through the process of releasing a reservation using the Golfdigg OTA API. This action is used to cancel a booking that has not been paid yet.
5.7.1: Endpoint
To release a reservation, you will use the following endpoint:
- Endpoint:
/api/v1/ext/order/{id}/cancel - Method: DELETE
5.7.2: Request Parameters
In your API request, include the following parameter:
Authorization(Header): Use Basic Authentication with your API credentials.
5.7.3: Request Example
Here's an example of how to structure your API request to release a reservation by providing the reservation ID (replace {id} with the actual reservation ID):
DELETE /api/v1/ext/order/abcd1234/cancel
Host: ota-api.golfdigg.com
Authorization: Basic base64_encoded(apiKey)
5.7.4: Response Example
The API will respond with a confirmation of the reservation release. Here's a sample response:
{
"id": "654c8186b6efd4994d3de2c1",
"status": "CANCEL",
"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": {
"gdInvoiceId": "",
"status": "CANCEL",
"paidAt": 1699512725689,
"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:52:04.689Z"
}
This response confirms the release of the reservation and updates its status to "CANCELLED."