5.6: Confirm a Reservation
Confirming a reservation will finalize the booking, and your credit balance will be deducted.
5.6.1: Endpoint
To confirm a reservation, you will use the following endpoint:
- Endpoint:
/api/v1/ext/order/{id}/confirm - Method: POST
5.6.2: Request Parameters
In your API request, include the following parameters:
Authorization(Header): Use Basic Authentication with your API credentials.
5.6.3: Response Format
5.6.3: Request Example
Here's an example of how to structure your API request to confirm a reservation by providing the reservation ID (replace {id} with the actual reservation ID):
POST /api/v1/ext/order/abcd1234/confirm
Host: ota-api.golfdigg.com
Authorization: Basic base64_encoded(apiKey)
5.6.4: Response Example
The API will respond with a confirmation of the reservation. Here's a sample response:
{
"id": "654c8186b6efd4994d3de2c1",
"status": "PAID",
"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": "TESTGDTH331G2023110028",
"status": "PAID",
"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 reservation and provides essential information about it.
5.6.5: Credit Balance Deduction
When a reservation is confirmed, your credit balance will be automatically deducted by the corresponding amount.
5.6.6: Handling Errors
In case of errors, you may receive an error response with a relevant HTTP status code and an error message. Handle errors based on the information provided in the response.
This section guides partners through the process of confirming a reservation and provides information on the associated credit balance deduction. If you have specific details to include or additional considerations, please add them as necessary.