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.
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
- Payload
Content type
application/json
{- "full_name": "rocky de stars",
- "phone_no": "088127361231",
- "password": "12345678a"
}
Response samples
- 201
- 400
- 409
- 500
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
- Payload
Content type
application/json
{- "email": "[email protected]"
}
Response samples
- 201
- 400
- 404
- 409
- 500
Content type
application/json
{- "status": "success",
- "code": 201,
- "message": "Register success."
}
Response samples
- 200
- 400
- 404
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success resend verification."
}
Request samples
- Payload
Content type
application/json
{- "password": "12345678a",
- "fcm_token": "fMFJVmT_vCk:APA91bEwLh3_5dGKDFJI9M4ISZrqD9sOuN_mtYKxj85ZyaLaxo1sBIi9Iq8X5ZUieX5GyGDfkl_woikKVfJCp5j-U7MxNWDE5GlNg8E3IpnsP7GQARlsbcMsLmiM9eMD5xXYTSGXUUKS"
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Login success.",
- "data": {
- "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI1IiwianRpIjoiZWViZTUwYzA1MzZiODE2OTA4YTIyNTQ0NWNhYzBlMTRiNTlmMWFkNjJmMTc0Nzc0ZDM2ZjhhMDBiZWRiYjU2M2JiMDgzNTk3NmQ2ZDIzZmMiLCJpYXQiOjE2NjQ3NjA1OTEsIm5iZiI6MTY2NDc2MDU5MSwiZXhwIjoxNjk2Mjk2NTkxLCJzdWIiOiIyNzk3Iiwic2NvcGVzIjpbXX0.aovuhLtuT4eAbIb53FkiBBxMkzxhxdv8ss1X0_j1jOSoghLGTZSx-C8apx8ZJyHsWMSKWqsyhoxWgMSNNMB-AIYx8028IS4hiJHv0UaDbJRpQYJZpLMCsinlPhWyL5yMp6t5Uwapek3fzh3uoyH4GvCkA4n1-mAIKbTJpdSqbSB_BVj-8PAfeYtvZ7zGNMXrZYNN_G6HpOC9CZAx94TUDoiyHrbGEkv9HhsGmHxDr4XiFKaeOb2JCNDCrqVyzqJ_A2K3FX1APx4c2vCjgo6Yng43TbrrYzDGGRMFk8U4rAtRqPOHAOY7rQNQTxFlAcGhtvQGk9q_fLvFW9tcZfx0t6bgUFjOD4KvIQUFUQ5u2ukmi0kpUQUKBRmw-zp9MXxJgbEARgVWfhiNbbA4GeNCEfYZXXorZy157wkiSwK4TPEJzqO27REuZ6-ubc0H0jCQsUNQ4_BeQyPrYDVCRMRYvhSF8cV3e8Obo_rwinhycvzK-zTTwbTQKdSlmW8Hx0i27VGVvZpX-xr98tY9DV2WI229lDatqg14vf2igP19ttNzyhDCmKlKaEbqtFceLLhp5XP9GdBuKs4sikMJTHl_Oy4q6xiQHjYKvu19H_9IgCKk5kFnYkCTOWHfflHIpTn50yFidenDdcBWk8jn0ccFrQ4skkuhXzDkCr2SBl9tvPQ",
- "token_type": "bearer",
- "expires_at": "2023-10-03 08:29:51",
- "user_id": 2727,
- "username": "rocky",
- "img_path": "string"
}
}
Request samples
- Payload
Content type
application/json
{- "email": "[email protected]"
}
Response samples
- 200
- 400
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Successfully Send Link Forgot Password!"
}
Request samples
- Payload
Content type
application/json
{- "code": "eyjqoweqkweqwndodlqwiqpowiequ1236124r1bjk31324",
- "password": "hehebuay123",
- "expired_at": "2023-01-02 10:22:05"
}
Response samples
- 200
- 400
- 401
- 404
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Successfully update password."
}
Response samples
- 200
- 401
- 403
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success fetch data.",
- "data": {
- "user_id": 3262,
- "affiliator_id": 16,
- "full_name": "Keluarga Cemara",
- "join_date": "2021-12-17",
- "no_hp": "0852266517231",
- "partner_id": 747,
- "photo_profile_url": "http://localhost:8000/storage/photo_profile/P4YsdjN7mWyEoA79AbCutci660gRUru4Fs6ZZg73.jpg",
- "pin": 123456
}
}
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
- Payload
Content type
application/json
{- "coupon_name": "KMJASDASD",
- "service_name": [
- "KOMSHIP"
]
}
Response samples
- 201
- 400
- 409
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
- Payload
Content type
application/json
{- "old_coupon": "BLAZYNGZF",
- "new_coupon": "STAKELY",
- "service_name": [
- "komship"
]
}
Response samples
- 201
- 400
- 403
- 409
Content type
application/json
{- "status": "success",
- "code": 201,
- "message": "Success update coupon."
}
Response samples
- 200
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success fetch data.",
- "data": {
- "pending_balance": 20000,
- "withdrawal_history_value": 50000
}
}
Response samples
- 200
- 500
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
- 200
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": [
- {
- "date": "2022-10-01",
- "count_members": 1,
- "count_commission": 3200
}
]
}
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
- 200
- 400
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": {
- "data": [
- {
- "member_name": "boedi poernomo",
- "join_date": "2022-10-05",
- "performance": 10,
- "total_shipping": 20000,
- "commission": 200
}
], - "page": 1,
- "per_page": 50,
- "page_count": 7,
- "total": 332,
- "link": {
- "current": "?page=5&per_page=50",
- "first": "?page=1&per_page=50",
- "previous": "?page=4&per_page=50",
- "next": "?page=6&per_page=50",
- "last": "?page=7&per_page=50"
}
}
}
Response samples
- 200
- 401
- 403
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success fetch data.",
- "data": {
- "coupon_name": "DUATIGA23",
- "service_name": [
- "KOMSHIP"
]
}
}
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
- 200
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetch data.",
- "data": {
- "affiliator_no": 8,
- "leaderboards": [
- {
- "false": 1,
- "name": "testing",
- "total_transaction": 100
}
]
}
}
Response samples
- 200
- 401
- 403
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success fetch data.",
- "data": {
- "count_register": 16,
- "count_verified": 2,
- "count_members": 10,
- "count_member_with_commission": 3
}
}
Response samples
- 200
- 401
- 403
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success fetch data.",
- "data": {
- "pending_balance": 1500000,
- "withdrawal_history_value": 750000
}
}
Get affiliator chart
Authorizations:
query Parameters
month required | string Example: month=2022-10 |
Responses
Response samples
- 200
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": [
- {
- "date": "2022-10-01",
- "count_register": 3,
- "count_commission": 12000
}
]
}
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
- 200
- 400
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": {
- "data": [
- {
- "affiliator_id": 16,
- "affiliator_name": "boedi poernomo",
- "phone_no": "081225667872",
- "join_date": "2022-10-05",
- "total_member": 10,
- "total_commission": 20000
}
], - "page": 1,
- "per_page": 50,
- "page_count": 7,
- "total": 332,
- "link": {
- "current": "?page=5&per_page=50",
- "first": "?page=1&per_page=50",
- "previous": "?page=4&per_page=50",
- "next": "?page=6&per_page=50",
- "last": "?page=7&per_page=50"
}
}
}
Get detail affiliator info
Authorizations:
path Parameters
affiliator_id required | integer Example: 16 |
Responses
Response samples
- 200
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": {
- "is_komship": 1,
- "is_kompack": 1,
- "affiliator_name": "Boedi Akatsuki",
- "affiliator_address": "Purbalingga",
- "join_date": "2022-11-27",
- "warehouse_address": "2022-11-27",
- "total_member": 101,
- "total_commission": 101000
}
}
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
- 200
- 404
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": [
- {
- "date": "2022-10-01",
- "count_members": 1,
- "count_commission": 3200
}
]
}
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
- 200
- 400
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": {
- "data": [
- {
- "member_name": "boedi poernomo",
- "warehouse_address": {
- "district_name": "Purbalingga",
- "subdistrict_name": "Mewek"
}, - "bank_info": [
- {
- "bank_account_name": "Candra Budi",
- "bank_account_no": "97725213"
}
], - "join_date": "2022-10-05",
- "total_shipping": 20000,
- "total_commission": 200
}
], - "page": 1,
- "per_page": 50,
- "page_count": 7,
- "total": 332,
- "link": {
- "current": "?page=5&per_page=50",
- "first": "?page=1&per_page=50",
- "previous": "?page=4&per_page=50",
- "next": "?page=6&per_page=50",
- "last": "?page=7&per_page=50"
}
}
}
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
- 200
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetch data.",
- "data": [
- {
- "false": 1,
- "name": "testing",
- "total_transaction": 100,
- "join_date": "2022-12-05",
- "total_member": 10,
- "total_commission": 100000
}
]
}
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
- 200
- 400
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": {
- "data": [
- {
- "user_id": 16,
- "withdrawal_id": 255,
- "affiliator_name": "Boedi Poernomo",
- "bank_name": "BCA",
- "bank_account_no": "977653122",
- "nominal": 1000000,
- "status": "requested"
}
], - "page": 1,
- "per_page": 50,
- "page_count": 7,
- "total": 332,
- "link": {
- "current": "?page=5&per_page=50",
- "first": "?page=1&per_page=50",
- "previous": "?page=4&per_page=50",
- "next": "?page=6&per_page=50",
- "last": "?page=7&per_page=50"
}
}
}
withdrawal detail
Authorizations:
path Parameters
withdrawal_id required | integer Example: 255 |
Responses
Response samples
- 200
- 404
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": {
- "user_id": 16,
- "status": "requested",
- "request_time": "2022-11-29 10:29",
- "affiliator_name": "Boedi Poernomo",
- "affiliator_phone_no": "081265735125",
- "bank_name": "BCA",
- "bank_account_no": "977653122",
- "commision": 2500000,
- "request_nominal": 1000000,
- "commission_when_accepted": 1500000,
- "account_check": {
}
}
}
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
- 200
- 400
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "success fetching data",
- "data": {
- "data": [
- {
- "transaction_id": 40,
- "timestamp": "2022-11-28 12:30",
- "mutation_type": "credit",
- "nominal": 1000000,
- "saldo": 1000000
}
], - "page": 1,
- "per_page": 50,
- "page_count": 7,
- "total": 332,
- "link": {
- "current": "?page=5&per_page=50",
- "first": "?page=1&per_page=50",
- "previous": "?page=4&per_page=50",
- "next": "?page=6&per_page=50",
- "last": "?page=7&per_page=50"
}
}
}
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
- Payload
Content type
application/json
{- "action": 1,
- "notes": "Penarikan anda belum dapat dilakukan karena ..."
}
Response samples
- 200
- 400
- 404
- 409
- 422
- 500
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
- 201
- 400
- 409
- 500
Content type
application/json
{- "status": "success",
- "code": 201,
- "message": "Success upload file",
- "data": "8718-1676534936.png"
}
Response samples
- 200
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success get bank.",
- "data": [
- {
- "account_name": "Felina Felisa",
- "account_no": "5231671723",
- "bank_account_id": 2610,
- "bank_name": "BCA",
- "is_default": "string"
}
]
}
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
- 200
- 400
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success fetching data.",
- "data": {
- "data": [
- {
- "withdrawal_id": 251,
- "timestamp": "2022-11-03 10:45",
- "status": "done",
- "nominal": 125000,
- "saldo": 57500
}
], - "page": 1,
- "per_page": 50,
- "page_count": 7,
- "total": 332,
- "link": {
- "current": "?page=5&per_page=50",
- "first": "?page=1&per_page=50",
- "previous": "?page=4&per_page=50",
- "next": "?page=6&per_page=50",
- "last": "?page=7&per_page=50"
}
}
}
Affiliator withdrawal request
Authorizations:
Request Body schema: application/json
bank_account_id | integer |
nominal | integer |
Responses
Request samples
- Payload
Content type
application/json
{- "bank_account_id": 18650,
- "nominal": 100000
}
Response samples
- 201
- 400
- 404
- 409
- 422
- 500
Content type
application/json
{- "status": "success",
- "code": 201,
- "message": "Withdrawal success."
}
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
- 200
- 400
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success fetching data.",
- "data": {
- "data": [
- {
- "transaction_id": 251,
- "timestamp": "2022-11-03 10:45",
- "mutation_type": "withdraw",
- "nominal": 125000,
- "saldo": 57500
}
], - "page": 1,
- "per_page": 50,
- "page_count": 7,
- "total": 332,
- "link": {
- "current": "?page=5&per_page=50",
- "first": "?page=1&per_page=50",
- "previous": "?page=4&per_page=50",
- "next": "?page=6&per_page=50",
- "last": "?page=7&per_page=50"
}
}
}
Checking the coupon and affiliate status
query Parameters
coupon_name required | string Example: coupon_name=coupon1asdq |
member_email required |
Responses
Response samples
- 200
- 400
- 404
- 409
- 500
Content type
application/json
{- "status": "success",
- "code": 200,
- "message": "Success fetch data.",
- "data": {
- "affiliator_id": 16,
- "coupon_name": "coupon1qwejqow"
}
}
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
- Payload
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
- 201
- 400
- 409
- 500
Content type
application/json
{- "status": "success",
- "code": 201,
- "message": "Success create member."
}
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
- Payload
Content type
application/json
{- "member_partner_id": 704,
- "order_id": 10003,
- "shipping_price": 20000
}
Response samples
- 201
- 400
- 500
Content type
application/json
{- "status": "success",
- "code": 201,
- "message": "Success insert komship transaction."
}