Skip to main content

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.

Written from Horoshop documentation

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​

  1. Open Flows → Connections, press Connect a system and choose Horoshop.
  2. Press Copy address. It looks like https://events.alphasms.net/hooks/<TOKEN> — keep it secret.

Step 2. Subscribe Horoshop to the events​

  1. 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.

  2. 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.

  3. 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 201 with the id of the subscription, {"id": …}. Keep it: you need it to unsubscribe.

  4. Run the same command for order_paid, order_update and request_call_me. Change two things: event and 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 eventAlphaFlow eventProperties
order_created — an order is placedorder_createdorder_id, total, currency, status, delivery, delivery_city, payment, paid, no_callback
order_paid with payed = 1 — the order is paidorder_paidorder_id, paid
order_paid with payed = 0— no event
order_update — the status Deliveredorder_deliveredorder_id, status
order_update — any other statusorder_status_changedorder_id, status
request_call_me — a callback requestlead_submittedlead_id, page_url
  • total includes discounts and excludes delivery. paid is 1 for a paid order and 0 otherwise. no_callback is the field order_without_callback of the order.
  • status is the number of the status. By default: 1 New, 2 Processing, 3 Delivered, 4 Canceled. 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 as order_shipped. The tracking number does not come with the status.
  • page_url is the page where the callback request was left.

Where the contact comes from:

  • order_created and order_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 from order_created of the same buyer; otherwise it is refused with no_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 20x is repeated about 10 minutes later, up to 10 times.
  • Horoshop sends the requests with the PUT method and a fixed body, without a signature: the secret in the address is enough. When a subscription is deleted by hand, Horoshop sends DELETE to the address — AlphaFlow ignores it.
  • order_paid carries 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 with quota_exceeded and shown in the journal; the subscription in Horoshop stays on.

Horoshop documentation​