Skip to main content

API Contract Affiliate (1.0.1)

Download OpenAPI specification:Download

This is an Api Contract for Affiliate project. use Token and application id to consumes endpoint.

Authentication

bearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

Registration, Authentication and Authorization

Registration, login, and authorization

checking the email before registration

query Parameters
email
required
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success fetching data.",
  • "data": {
    }
}

registration to application

Request Body schema: application/json
object

email should be in email format, else would be error. Full name shouldnt contain numbers or else. Max character for phone number is 15, min 8. Password min 8 char.

Responses

Request samples

Content type
application/json
{
  • "email": "[email protected]",
  • "full_name": "rocky de stars",
  • "phone_no": "088127361231",
  • "password": "12345678a"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 201,
  • "message": "Register success."
}

registration to application with existing account

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 201,
  • "message": "Register success."
}

resend verification

query Parameters
email
required
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success resend verification."
}

login to application

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "username_email": "[email protected]",
  • "password": "12345678a",
  • "fcm_token": "fMFJVmT_vCk:APA91bEwLh3_5dGKDFJI9M4ISZrqD9sOuN_mtYKxj85ZyaLaxo1sBIi9Iq8X5ZUieX5GyGDfkl_woikKVfJCp5j-U7MxNWDE5GlNg8E3IpnsP7GQARlsbcMsLmiM9eMD5xXYTSGXUUKS"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Login success.",
  • "data": {
    }
}

forgot password

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Successfully Send Link Forgot Password!"
}

reset password

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "code": "eyjqoweqkweqwndodlqwiqpowiequ1236124r1bjk31324",
  • "password": "hehebuay123",
  • "expired_at": "2023-01-02 10:22:05"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Successfully update password."
}

get profile

Authorizations:

Responses

Response samples

Content type
application/json
{}

Custom coupon code

create or update coupon code

create coupon code

Authorizations:
Request Body schema: application/json
coupon_name
string [ 4 .. 12 ]

must uppercase

service_name
Array of any[ items ]

Responses

Request samples

Content type
application/json
{
  • "coupon_name": "KMJASDASD",
  • "service_name": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 201,
  • "message": "Success create coupon."
}

Update coupon code

Authorizations:
Request Body schema: application/json
old_coupon
string [ 4 .. 12 ]

must uppercase

new_coupon
string [ 4 .. 12 ]

must uppercase

service_name
Array of any[ items ]

Responses

Request samples

Content type
application/json
{
  • "old_coupon": "BLAZYNGZF",
  • "new_coupon": "STAKELY",
  • "service_name": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 201,
  • "message": "Success update coupon."
}

Affiliate Dashboard

Dashboard for affiliator

Get affiliator balance

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success fetch data.",
  • "data": {
    }
}

count number of member

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success fetch data.",
  • "data": 10
}

affiliator member cart data

Authorizations:
query Parameters
month
required
string
Example: month=2022-10

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": [
    ]
}

members data

Authorizations:
query Parameters
start_date
required
string
Example: start_date=2022-10-01 00:00:01
end_date
required
string
Example: end_date=2022-10-31 23:59:59
service_name
required
string
Example: service_name=komship
page
required
integer
Example: page=1
per_page
required
integer
Example: per_page=50
search
string
Example: search=boedi poernomo

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": {
    }
}

affiliator get coupon

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success fetch data.",
  • "data": {
    }
}

leaderboard transaction

Authorizations:
query Parameters
start_month
required
string
Example: start_month=2023-01-01
end_month
required
string
Example: end_month=2023-02-01

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetch data.",
  • "data": {
    }
}

Admin Dashboard

Dashboard for admin

get count admin dashboard info

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success fetch data.",
  • "data": {
    }
}

get affiliator balances

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success fetch data.",
  • "data": {
    }
}

Get affiliator chart

Authorizations:
query Parameters
month
required
string
Example: month=2022-10

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": [
    ]
}

All Affiliator info

Authorizations:
query Parameters
month
required
string
Example: month=2022-10
service_name
required
string
Example: service_name=komship
page
required
integer
Example: page=1
per_page
required
integer
Example: per_page=50
search
string
Example: search=boedi poernomo

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": {
    }
}

Get detail affiliator info

Authorizations:
path Parameters
affiliator_id
required
integer
Example: 16

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": {
    }
}

Get affiliator member cart

Authorizations:
path Parameters
affiliator_id
required
integer
Example: 16
query Parameters
month
required
string
Example: month=2022-10

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": [
    ]
}

members data

Authorizations:
path Parameters
affiliator_id
required
integer
Example: 255
query Parameters
month
string
Example: month=2022-10
service_name
required
string
Example: service_name=komship
warehouse_address
string
Example: warehouse_address=banyumas
page
required
integer
Example: page=1
per_page
required
integer
Example: per_page=50
order_by
string
Example: order_by=name, join_date, total_shipping, total_commission
sort_by
string
Example: sort_by=asc

asc / desc

search
string
Example: search=boedi poernomo

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": {
    }
}

members data

Authorizations:
path Parameters
affiliator_id
required
integer
Example: 255

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": {
    }
}

leaderboard transaction

Authorizations:
query Parameters
service_name
required
string
Example: service_name=komship
start_month
required
string
Example: start_month=2023-01-01
end_month
required
string
Example: end_month=2023-02-01
limits
integer
Example: limits=20
offset
integer
Example: offset=0
search
string
Example: search=sachio

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetch data.",
  • "data": [
    ]
}

Admin Withdrawal

Withdrawal for admin

withdrawal list

Authorizations:
query Parameters
start_date
required
string
Example: start_date=2022-10-01
end_date
required
string
Example: end_date=2022-10-31
filter
integer
Example: filter=1

1="semua", 2="request", 3="on-review", 4="reject", 5="accepted"

page
required
integer
Example: page=1
per_page
required
integer
Example: per_page=50
search
string
Example: search=boedi poernomo

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": {
    }
}

withdrawal detail

Authorizations:
path Parameters
withdrawal_id
required
integer
Example: 255

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": {
    }
}

affiliator transaction history

Authorizations:
path Parameters
withdrawal_id
required
integer
Example: 16
query Parameters
page
required
integer
Example: page=1
per_page
required
integer
Example: per_page=5

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "success fetching data",
  • "data": {
    }
}

Withdrawal action

Authorizations:
path Parameters
withdrawal_id
required
integer
Example: 250
Request Body schema: application/json
action
required
integer

1=auto, 2=manual, 3=review, 4=reject

notes
string

Responses

Request samples

Content type
application/json
{
  • "action": 1,
  • "notes": "Penarikan anda belum dapat dilakukan karena ..."
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Action applied successfully."
}

upload transfer proof

Authorizations:
path Parameters
withdrawal_id
required
integer
Example: 250
Request Body schema: multipart/form-data
attachment
string <binary>

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 201,
  • "message": "Success upload file",
  • "data": "8718-1676534936.png"
}

Withdrawal

Affiliator withdrawal

Fetch all affiliator bank

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success get bank.",
  • "data": [
    ]
}

Fetch withdrawal history

Authorizations:
query Parameters
start_date
required
string
Example: start_date=2022-10-01
end_date
required
string
Example: end_date=2022-10-31
service_name
required
string
Example: service_name=komship
page
required
integer
Example: page=1
per_page
required
integer
Example: per_page=50

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success fetching data.",
  • "data": {
    }
}

Affiliator withdrawal request

Authorizations:
Request Body schema: application/json
bank_account_id
integer
nominal
integer

Responses

Request samples

Content type
application/json
{
  • "bank_account_id": 18650,
  • "nominal": 100000
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 201,
  • "message": "Withdrawal success."
}

Transaction

Affiliator Transaction history

Fetch mutation history

Authorizations:
query Parameters
start_date
required
string
Example: start_date=2022-10-01
end_date
required
string
Example: end_date=2022-10-31
service_name
required
string
Example: service_name=komship
page
required
integer
Example: page=1
per_page
required
integer
Example: per_page=50

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success fetching data.",
  • "data": {
    }
}

Member Register Komship

Member register

Checking the coupon and affiliate status

query Parameters
coupon_name
required
string
Example: coupon_name=coupon1asdq
member_email
required
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 200,
  • "message": "Success fetch data.",
  • "data": {
    }
}

Save member to affiliate db [Komtim to Affiliate]

Request Body schema: application/json
affiliator_id
integer
member_user_id
integer
member_partner_id
integer
member_name
string
member_email
string

Responses

Request samples

Content type
application/json
{
  • "affiliator_id": 203,
  • "member_user_id": 1440,
  • "member_partner_id": 704,
  • "member_name": "Agiel Laei",
  • "member_email": "[email protected]"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 201,
  • "message": "Success create member."
}

Callback API

Api for callback to Komship and Komtim

Save member to affiliate db [Komtim to Affiliate]

Request Body schema: application/json
member_partner_id
integer
order_id
integer
shipping_price
integer

Responses

Request samples

Content type
application/json
{
  • "member_partner_id": 704,
  • "order_id": 10003,
  • "shipping_price": 20000
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "code": 201,
  • "message": "Success insert komship transaction."
}