Trigger Webhook
This endpoint will trigger our system to send new order webhook request by order id and webhook type.
Path
post
/v1/fs/:fs_id/trigger
Request Parameters
Parameter | Type | Required | Location | Description |
---|---|---|---|---|
fs_id | Integer | Required | path | Fulfillment service unique identifier |
order_id | Integer | Required | body | Order service unique identifier |
type | String | Required | body | Webhook Type. Currently only two types available order_status and order_notification |
url | String | Required | body | Custom URL to send webhook. If empty then the URL that will be used are from registered URL |
is_encrypted | Boolean | Required | body | Temporary parameter, can send webhook with encrypted result if the value is true or not encrypted if the value is false for testing purpose |
Example Request
- Curl
curl -X POST \
https://fs.tokopedia.net/v1/fs/13398/trigger \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer JhgtdgUAQ5OJIrQMJjCiHA' \
-d '{
"Type": "order_notification",
"order_id": 576694264,
"url": "https://webhook.site/662b4823-599f-4455-b349-32c43701f72b",
"is_encrypted": true
}'
Response Parameters
Name | Type | Demo Value | Description |
---|---|---|---|
String | success | Response Data |
Success Response Examples
{
"header": {
"process_time": 0.042723386,
"messages": "Your request has been processed successfully"
},
"data": "success"
}
Error Response Examples
{
"header": {
"process_time": 0.007438284,
"messages": "Our server encounters an error, please try again later",
"reason": "There Are Error From Ext Service",
"error_code": "ORD_API_006"
},
"data": null
}
Error Codes
Error Code | Error Message | Description |
---|---|---|
SHP_GRPC_001 | Failed Send GRPC Request | Failed sending request to upstream |
SHP_GRPC_003 | Data Not Found | Failed finding data from upstream |