post
https://{URL}/v1/open-api/attractions/buy
This method enables the creation and management of travel product bookings, providing essential details about the product, buyer, and customers.
A. Request Header
| Field | Format | Mandatory | Length | Example |
|---|---|---|---|---|
| Content-Type | string | Y | application/json | |
| Open-Api-Timestamp | yyyy-mm-dd'T'hh:mm:ss+07:00 | Y | 2024-02-07T10:28:35.000+07:0 | |
| Open-Api-Signature | Digital Signature | Y | 88 | vNMoAmiDRV+paVyD5FaidgI5k Ry2pCo8oEoQN/GBpIPuO3eicY 63b7xY0WDffScvkOZsZ1442ewa bI7Wzd22pw== |
B. Request Body
| Field | Type | Description | Required | Example |
|---|---|---|---|---|
| product_code | string | Unique identifier for the product | true | “ATTO-03” |
| quantity | int | The number of items or tickets | true | 1 |
| buyer_first_name | string | First name of the buyer | true | “Oim” |
| end_date | string | End date of the event or booking | true | "2024-07-26" |
| buyer_tel_number | string | Telephone number of the buyer | true | "812959293" |
| buyer_last_name | string | Last name of the buyer | true | "Test" |
| buyer_tel_country_code | string | Country code for the buyer’s telephone number | true | "62" |
| string | Email address of the buyer | true | "oim@ yoipmail.com" | |
| locale | string | Language preference or locale | true | "en" |
| buyer_country | string | Country code of the buyer | true | "id" |
| booking_field | Array of Objects | Custom fields for booking (key-value pairs) | ||
key | string | The key for the custom field | true | "guideLang" |
value | string | The value for the custom field | true | "3b385b66-4cc1- 4ac8-bcfc 311b21fa64af" |
| event_time | string | The time when the event starts | true | "09:30" |
| state | string | The state or the region code where the event takes place | true | "id" |
| customers | Array of Objects | Details about the customers involved in the booking | ||
| customer_booking_field | Array of Objects | Custom fields for each customer | ||
value | string | The value for the customer field | true | "Test" |
key | string | The key for the customer field | true | "englishLastName" |
| start_date | string | The start date of the event or booking | true | "2024-07-26" |
| amount | string | The total amount charged for the booking | true | "15083" |
| selling_price | string | The selling price of the product | true | "16000" |
| partner_reference_id | string | A unique reference ID for the partner transaction | true | "23432-756 45466" |
C. Sample Request
{
"product_code": "ATTO-03",
"quantity": 1,
"buyer_first_name": "Oim",
"end_date": "2024-07-26",
"buyer_tel_number": "812959293",
"buyer_last_name": "Test",
"buyer_tel_country_code": "62",
"email": "[email protected]",
"locale": "en",
"buyer_country": "id",
"booking_field": [
{
"key": "guideLang",
"value": "3b385b66-4cc1-4ac8-bcfc-311b21fa64af"
}
],
"event_time": "09:30",
"state": "id",
"customers": [
{
"customer_booking_field": [
{
"value": "Test",
"key": "englishLastName"
},
{
"value": "Oim",
"key": "englishFirstName"
},
{
"value": "1996-08-16",
"key": "birth"
},
{
"value": "a2d9ee5e-2824-4239-b2d8-4f2d7ef6c338",
"key": "nationality"
},
{
"value": "testpassport",
"key": "passportNo"
}
]
}
],
"start_date": "2024-07-26",
"amount": "15083",
"selling_price": "16000",
"partner_reference_id": "23432-75645466"
}
D. Response Body
| Field | Type | Description | Example |
|---|---|---|---|
| response_code | string | Contains the OpenAPI response code | “200062000” |
| response_message | string | Contains the value of OpenAPI response message | “Sukses” |
| data | object | Contains the metadata related to user list’s pagination | |
transaction_id | string | The unique identifier for the transaction | “14429004” |
status | string | The value of transaction’s status | “WAITING” |
sn | string | The value of transaction’s serial number | “” |
E. Sample Response
{
"response_code": "200062000",
"response_message": "Sukses",
"data": {
"transaction_id": "14429004",
"status": "WAITING",
"sn": ""
}
}
Try It Here (Form)
To try the following endpoint, enter the example request data you want to use in the following form