Logo

External APIs

Buxale Affiliate Platform Integration Documentation

Introduction

Buxale is an affiliate platform developed for BKF. It provides a way for affiliates to earn commissions by referring new users to the platform. The Buxale service handles all payment and commission logic. In this documentation, we will provide an overview of the integration and usage of the Buxale service in the BKF application.

Overview

The BkfAffiliateService class is used to interact with the Buxale API. It is responsible for creating and managing user accounts, affiliate codes, and service users. During the checkout process, users can provide an affiliate code which will be used to match the affiliate.

The BkfAffiliateService class is located in the App\Services namespace and has the following main functions:

  • searchUserAccount(User $user): ?array
  • createUserAccount(User $user): ?int
  • createAffiliateCode(User $user): ?string
  • createServiceUser(User $user, string $code): ?int
  • getServiceUser(User $user): ?array
  • deleteServiceUser(User $user): bool
  • sendCodeEvent(User $user, string $event, ?float $purchaseValueNet = null): bool
  • getCodeCommissions(User $user): ?array
  • updateEmail(User $user, string $oldEmail, string $newEmail)
  • helperGetLocalAffiliateProgramUser(User $user): User
  • getAffiliateCodeData(User $user): ?array

Workflow

  1. When a user registers on the platform, a Buxale user account is created using the createUserAccount(User $user) method. This method returns the Buxale user ID.
  2. An affiliate code is generated for the user using the createAffiliateCode(User $user) method. This method returns the affiliate code.
  3. During the checkout process, users can provide an affiliate code. This code is used to match the affiliate by creating a service user using the createServiceUser(User $user, string $code) method. This method returns the service user ID.
  4. Commissions are calculated and tracked by the external Buxale service. You can retrieve the commission stats for a user using the getCodeCommissions(User $user) method.

Important Notes

  • All payments and commission logic are handled by the external Buxale service.
  • The affiliate code provided during the checkout process is used to match the affiliate and track commissions. Please refer to the BkfAffiliateService class for the full implementation and additional methods.
Previous
SendInBlue (SMS & Mail)