Initiate flow
The initiate flow API can be called to start a chatflow. An example chatflow can look like below.

info
Either email or phoneNumber must be provided; both cannot be empty at the same time.
Get your sessionId using externalAPI block in the journey builder and scope of the sessionId is with in the flow.
Request parameters
| Name | Type | Required/Optional | Description |
|---|---|---|---|
medium | string | Required | Messages will be send through this medium |
flowId | string | Required | Chatbot flow id |
phoneNumber | string | Optional | Phone number of the user |
email | string | Optional | email of the user |
name | string | Optional | Name of the user |
nodeName | string | Optional | Name of the chatbot flow's node |
businessPhoneNumber | string | Optional | Business phone number from which you want to trigger the flow |
sessionId | string | Optional | Bik session Id |
carryPayload | [key: string]: string[] | Optional | Initiate chat flow payload |
payload | AbandonedCartPayload | Optional | AbandonedCart Payload |
AbandonedCartPayload Type
| Name | Type | Required/Optional | Description |
|---|---|---|---|
checkoutId | string | Required | Checkout Id |
phoneNumber | string | Required | Customer Phone number |
email | string | Optional | Customer email |
abandonedCart | AbandonedCart | Required | AbandonedCart details |
AbandonedCart Type
| Name | Type | Required/Optional | Description |
|---|---|---|---|
id | string | Required | Id |
phoneNumber | string | Required | Customer Phone number |
converted | boolean | Required | Convert to order |
cartPrice | number | Required | Total cart value |
partnersData | PartnerData | Required | PartnerData |
cart | BikOrderItem[] | Required | Total order items |
BikOrderItem Type
| Name | Type | Required/Optional | Description |
|---|---|---|---|
name | string | Required | Product name |
price | number | Required | Product price |
quantity | number | Required | Product quantity |
productId | number | Required | product id |
variantId | number | Optional | Product variant id |
Request Information
| Category | Value |
|---|---|
| Http request | POST |
| URL | https://bikapi.bikayi.app/integrations/bikPlatformFunctions-initiateFlow |
Sample request
You can start the chatflow by calling the below API :
curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-initiateFlow' \
--header 'Authorization: Basic AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"medium": "whatsapp",
"flowId": "test_flow_id",
"phoneNumber": "+919090909090",
"carryPayload: {
"id": "1234"
}
}'
JSON response example:
{
"status": 200
}
Abandoned Cart
If you're triggering the abandoned cart flow you can also pass in the abandoned cart context in the initiate flow API
{
"medium": "whatsapp",
"flowId": "test_flow_id",
"phoneNumber": "+919090909090",
"payload": {
"checkoutId": "CHECKOUT_ID",
"abandonedCart": {
"id": "ID",
"phoneNumber": "PHONE_NUMBER",
"cart": [{
"name": "NAME";
"price": 2000;
"quantity": 2;
"productId": 1234;
"variantId": 7890;
}],
"converted": true,
"cartPrice": 1000,
"partnersData": {
id: "PARTNER_ID";
source: "shopify";
customerId?: 1111;
},
},
"phoneNumber": "PHONE_NUMBER",
"email": "EMAIL",
}
}
Response parameters
| Name | Type | Description |
|---|---|---|
status | number | Flow status |