Brandbites

Multi-vendor social-media platform, where social media influencers could order brands' products and subsequently submit Instagram post with the product photo.

Instagram Post Submission

Since Instagram influencer needed to pay for the provided products with the Instagram posts, we firstly implemented API endpoint with the Instagram feed, which also indicated already submitted posts.
Secondly, we implemented API endpoint for submitting Instagram post as payment for the order within the bunch of scheduled tasks for sending email notifications, recording analytics, update partner spendings and etc.

In order to keep influencer's statistical data (followers, likes etc) up to date, we implemented scheduled task which periodically fetched the data from Instagram API.

Basket and Catalogue

As the platform is multi-vendor, which means orders fulfilled by multiple vendors, we designed appropriate basket and checkout flow architecture.
This implies, we developed API endpoint with parent basket and nested baskets, broken down by the supplying partner.

Secondly we developed wishlists API for adding/removing product from the wishlist, allowing influencer order desired products later on.

In addition, we created API endpoints, allowing to follow/unfollow brands.

Checkout and Orders

Platform had multiple conditions for purchasing products by the influencers.
For instance, user could order either product or any of its variations only once, influencer should has necessary number of Instagram followers — which is specified on the product level.
Finally, in case of platform policy violation, administration staff could forbid new orders for the particular user.

For already placed orders we implemented API endpoints with orders list, broken down by the status.

Product Restrictions

Eventually, restriction rules became quite complex, so that we had to implement indication of purchase limitation for each product for the particular user on the Django admin site.

Dashboard Product Management

As many products, listed on the platform had different variations, depending on attributes (color, size etc) we decided to revise product variants management in the dashboard.
Thus, we simplified it as much as possible and instead of managing product on the separate page, as it is in the Oscar, we introduced modal with two sections: number of items in stock and attribute values.
To save time for creation of similar products we implemented product duplication, which allowed admin user to create draft product and modify it.
We also introduced product statuses, such as "draft", "active" and "inactive" which allowed staff members to control product visibility without necessity to remove it — after deactivation it could just stay as is and re-activated later.

Dashboard Analytics

In order to provide partners overview on activities and their metrics on the platform, we significantly reworked original analytics aggregation and introduced multiple domain-specific metrics.

On the dashboard index we display chart and baseline indicators, such as: current month budget, current month spendings, recent Instagram posts, top-performing influencers, top products, unshipped orders, pending orders etc.

Dashboard Reports

We tweaked detailed reports generation and created separated reports for the admin users and vendors.
Vendors could get necessary statistics about Instagram posts, products, spendings, for the orders they supplied.
Admins respectively had statistics about all influencers, vendors and products.

Signup and Invitations

Influencers signed up using Instagram with pre-moderation: platform admins reviewed their accounts and activated it if it met conditions. To speedup review process, it was added bulk user activation for the admin site. Later on it was added automatic check for minimal required number of followers.
We also introduced whitelist and blacklist functionality:

  • Influencers included to white (VIP) list had preferences (e.g. FOC orders without Instagram post submission). They also bypass minimal followers validation on signup within automatic account activation.
  • Influencers included to black list couldn't (and order) partner's products.
Each partner could have and manage own lists independently.
In addition, we developed invitation system allowing partners invite their staff members and invite influencers to the whitelist.

Instagram Posts Management

After receiving an order, influencer had certain time for publishing Instagram post, containing provided product and submitting it to the platform.
Partner managers reviewed submitted posts and either accepted it as payment if all conditions satisfied, or rejected it and then influencer had to submit it again. Rejected posts disabled in the posts feed on the storefront and were not available for submission.
We also automatically rejected post if it was removed on the Instagram side.
In case of any issues with the submitted posts, partner managers could open a dispute with a reason and even send mail letter to the user, requesting payment.

Partner Billing

Partners were billed for the reach in the social media they got within the influencer's posts, containing their products.

In order to allow partners plan their expenses on the platform, we introduced monthly budget.
For every submitted post we calculate partner spendings and in case of budget excess — partner was automatically set as inactive.

Based on month results we issued invoices, generated by FastBill, which was integrated.

Voucher as Product

Since some vendors wanted to list coupon codes with discount as a product in the catalogue, we introduced validity date for the product, in order to send additional reminder that voucher should be used by this date.
Vouchers could be used immediately after order purchase and do not require delivery, hence we set it as shipped and send out voucher code within the order placement email.
Each product of corresponding type could have multiple vouchers, which would be allocated one by one.
For saving time we also introduced voucher codes import from the CSV file, which relieves from routine of entering them manually.

Communication System

To keep both partner users and influencers informed, we implemented bunch of email notifications:

  • Reminder about pending Instagram posts
  • Reminder about vouchers that will expire soon
  • Notifications for orders, that required fulfilment and shipment
  • Notifications about order placement, shipment and payment
  • Notification about user activation
  • User email confirmation
In addition to emails and push notifications we also created internal messages, which were system event notifications, issues on behalf of the platform itself.
Generally, messages were also for partner-admin and partner-influencer communication and available through the inbox API, where they were broken down by new and read.

API for Mobile Application

For the needs of mobile application, we implemented second version of the API and custom authentication flow via Instagram.
Added Promotions API — used to promote selected brands, categories, products.
We implemented push notification for the events and also developed mass notifications delivery through the admin site.
For the realtime data synchronization between backend and mobile application, we implemented orders and messages export to the Firebase Database.

Miscellaneous

  • Since original Python client for Instagram API is not maintained since 2016, we created our own private fork and patched it: made tests Python3 compliant, fixed pagination, Video and User models.
  • Test coverage for all major functionality.
  • CI/CD setup.
  • Deployments automation using Ansible.