Horoshop
Horoshop is a platform for online shops. Through its API it calls an address when an order is placed, when it is paid, when its status changes and when a visitor asks for a callback. Pointed at the Flows address, these calls start your flows: the order is confirmed in Viber, the payment is thanked for, the visitor who asked for a callback gets a message within minutes.
This page is written from the public documentation of Horoshop and has not been checked on a live account yet.
What you need
- Plan Pro or B2B. On the pricing page of Horoshop, which exists only in Ukrainian and Russian, the row
"API" says «Не включено» (not included) for Basic and Standard.
The payment event (
order_paid) exists since version 4.26. - The admin of Horoshop has no field for a webhook address: the shop is subscribed to each event with a call of its API. It takes two commands, given below. If there is nobody to run them, our support will do it.
- A user of the shop for the API, with a login and a password.
- One address for all events. Each event is subscribed separately, with no more than 5 subscriptions per event.
Step 1. Create a connection
- Open
Flows → Connections, press Connect a system and choose Horoshop. - Press Copy address. It looks like
https://events.alphasms.net/hooks/<TOKEN>— keep it secret.
Step 2. Subscribe Horoshop to the events
-
In the admin of the shop create a user for the API with a login and a password. The API documentation calls this tab Settings - Users; it is in the Settings section of the admin menu.
-
Get a token. It lives 600 seconds, so run the next commands within this time:
curl -X POST "https://<shop domain>/api/auth/" \-H "Content-Type: application/json" \-d '{"login": "<login>", "password": "<password>"}'The token is in the answer, in
response.token. -
Subscribe the shop to the event
order_created:curl -X POST "https://<shop domain>/api/hooks/subscribe/" \-H "Content-Type: application/json" \-d '{"token": "<token>", "event": "order_created", "target_url": "<address from the cabinet>?horoshop=order_created"}'The answer is
201with the id of the subscription,{"id": …}. Keep it: you need it to unsubscribe. -
Run the same command for
order_paid,order_updateandrequest_call_me. Change two things:eventand the label at the end of the address — for example"event": "order_paid"and?horoshop=order_paid.
The label ?horoshop=… lets AlphaFlow recognise Horoshop even in a connection that detects the system by itself; in a
connection where Horoshop is chosen it is not required. Whether Horoshop keeps the label in the saved address is
not confirmed by the documentation.
Always subscribe order_created as well: status changes (order_update) come without a phone and reach only the
contacts AlphaFlow already knows from order_created.
Without a programmer
Write to our support and send the login and the password of the API user. We make the subscriptions, and then you change the password of this user.
Step 3. Send a test
Place a test order on the site. The request does not come at once: Horoshop sends its queue by cron every
5 minutes. To test the other events, mark the test order as paid, change its status (to any status except
New) or leave a callback request on the site. The requests are listed in the log of the API,
https://<shop domain>/api/logs/.
The event appears in Flows → Connections → Event journal, and
the connection shows Recognised: Horoshop.
Events
| Horoshop event | AlphaFlow event | Properties |
|---|---|---|
order_created — an order is placed | order_created | order_id, total, currency, status, delivery, delivery_city, payment, paid, no_callback |
order_paid with payed = 1 — the order is paid | order_paid | order_id, paid |
order_paid with payed = 0 | — no event | |
order_update — the status Delivered | order_delivered | order_id, status |
order_update — any other status | order_status_changed | order_id, status |
request_call_me — a callback request | lead_submitted | lead_id, page_url |
totalincludes discounts and excludes delivery.paidis1for a paid order and0otherwise.no_callbackis the fieldorder_without_callbackof the order.statusis the number of the status. By default:1New,2Processing,3Delivered,4Canceled. The statuses are matched by a table that you can correct in the connection: a shop with statuses of its own adds their numbers — for example, its Shipped asorder_shipped. The tracking number does not come with the status.page_urlis the page where the callback request was left.
Where the contact comes from:
order_createdandorder_paid— the phone, the email and the full name of the buyer from the delivery details, and the id of the buyer in Horoshop (user).order_update— only the id of the buyer, no phone. The event reaches a contact AlphaFlow already knows fromorder_createdof the same buyer; otherwise it is refused withno_contact.request_call_me— the phone and the name from the callback form.
The names of the events are the ones the ready-made templates expect — see Recommended events.
Good to know
- The requests come with the cron queue, up to about 5 minutes after the event. An answer other than
20xis repeated about 10 minutes later, up to 10 times. - Horoshop sends the requests with the
PUTmethod and a fixed body, without a signature: the secret in the address is enough. When a subscription is deleted by hand, Horoshop sendsDELETEto the address — AlphaFlow ignores it. order_paidcarries neither the sum nor the currency — only the number of the order.- The built-in SMS of Horoshop work only with SMS-fly; this does not affect the webhooks.
- The address always answers
200. Above the daily event limit the event is refused in AlphaFlow withquota_exceededand shown in the journal; the subscription in Horoshop stays on.