Consultation Order Notification Webhook
There are 2 endpoints you need to provide, Authentication and Consultation Order Webhook.
- Notification for the new consultation order
- Notification for the changes in consultation statuses
Authenticationโ
Pathโ
post
{partner-host}/v1/partner/authentication
Request Headerโ
Parameter | Type | Description |
---|---|---|
x-key | string | public key |
x-secret | string | secret key |
Request Parametersโ
No request parameter
Example Requestโ
curl --location --request POST 'https://consultapi.d2d.co.id/v1/partner/authentication' \
--header 'x-key: 6a19c84b-f745-42f1-a8e1-2cb73d068942' \
--header 'x-secret: <secret>'
Success Response Exampleโ
{
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhU3RyaW5nIjoiNTBmYWQ4MzNkNjcyOTRiMjIzMzU4NDRkMmYwNWZiNzQzZDlkY2RlYzZhZjVlODBjZjVmMWEyMmZmZTI4OGYwYTk3ZGJhYzhlMjdlNDZhZjhhZjkxM2VkZWQ3M2M3NjJhZjQxMzQxYTA0MDc5M2U5YWEyYjQ0MTA2YjhmMTNiMzA0NzU2OWM0ZmI3YjczOTNlZGRhNmQ4YjYwY2NiNzg3ZDg0NGYxMDQyMmM0MWMzNDY5MDdmN2FlZThmNzJjZWJlZDQ2ZDA2YTkyM2JjMWI2ODNmMDlmYThlYTM0ZTJmMDZjMGIwZDQ5N2FkY2VmYTQ1Mzg4MDI2NTA0MTc2NjYzZDVlZTkzYzIyOTY5OTcxNzVlZjllYzUyYWI4ZGUwODM0N2ViYzQ3NDNhYjY1ODI3YzBlODI2NWUxNjY4NTkwMDE0NTcyYjUxNDBkYmQ4ZmIzN2Y1Y2Q4MTVhMjJlMzQxZjk1NGE5ZjlhMzBmY2M0NDZjOGIyOWUzN2YxZTMwYjUzY2JjMzQxZDA2MDU4NmY2YzA0MmYzODA3MWUyYzVlMmY0ZTZmYzZiNjAwODJhMzVlYmE5NTYyMGVkNjlhNzg0ZV9fOEY1Q1ZpYVpjM3A4TGVVNiIsImlhdCI6MTcxMTM0MTY2MSwiZXhwIjoxNzExMzQzNDYxfQ.0U1WnLOFb1dXr-iJ6QKfCcC1kFJAaFgZ87vUSbtBrgE"
}
}
Consultation Order Webhookโ
Pathโ
post
{partner-host}/v1/partner/send-consultation-order-data
Request Headerโ
Parameter | Type | Description |
---|---|---|
x-key | string | public key |
x-authorization | string | access token |
Request Parametersโ
Name | Type | Example | Description |
---|---|---|---|
data | Object |
Order Status Codeโ
Order Status | Description |
---|---|
NEW_ORDER_VERIFIED | Consultation has been paid |
CONSULTATION_START | Consultation has started |
WAITING_FOR_CANCELLATION | Buyer requested to cancellation and waiting partner to ack/nack |
CANCELLATION_REJECTED | Partner nack the cancellation |
FINISH_UNREDEEMED | Doctor has approved the consultation |
FINISH_UNREDEEMED_EXPIRED | Doctor has approved the consultation but prescription hasn't redemeed |
FINISH_REDEEMED | Doctor has approved the consultation and prescription has redemeed |
FINISH_RECONCILED | Prescription has redemeed after 24 hours |
FINISH_NO_PRESCRIPTION | Doctor has rejected the consultation |
FINISH_EXPIRED | Consultation just expired without started |
FINISH_EXPIRED_REFUNDED | Consultation has been refunded |
WAITING_FOR_COMPLAINT_APPROVAL | Buyer requested complaint |
COMPLAINT_REJECTED | Complaint has been rejected |
SYSTEM_REJECT | System rejected |
Example Requestโ
curl --location 'https://consultapi.d2d.co.id/v1/partner/send-consultation-order-data' \
--header 'x-key: 6a19c84b-f745-42f1-a8e1-123456' \
--header 'x-authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhU3RyaW5nIjoiNWVkZTBmOGFjZTliZWU2MmViODAzYTBmMDMyMjZkYTliN2M1N2RkNzE0MDI0NDM3YzFkM2U3ZWFmZjQ5YjQ1OTVkN2E2NTRhYTMzNTk3ZTQ0OGM5ZjQzNjhi' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"toko_consultation_id": 12345,
"order_id": 514466482116558851,
"payment_id": 12345,
"payment_method": "Gopay",
"payment_amount": 10000,
"payment_date": "2021-08-26T09:41:22.235377511+07:00",
"invoice_number": "PRC/20191223/XIX/XII/514466482116558851",
"rate_tokopedia_percentage": 10,
"tax_percentage": 5,
"order_status": "NEW_ORDER_VERIFIED"
}
}'
Success Response Exampleโ
{
"header": {
"server_process_time": "399.238721ms",
"code": 200
},
"status": "ok",
"error" : ""
}
Error Response Exampleโ
{
"header": {
"server_process_time": "718.792ยตs",
"code": 400
},
"status": null,
"error": "error message"
}