Project

General

Profile

Marketplace » History » Version 16

karnake ruengchaicharnkij, 02/20/2026 02:51 AM

1 1 Ryan Supawarapong
# Marketplace
2
3 13 Ryan Supawarapong
There are the following API:
4
- Get
5
- Sell
6
- Reserve
7
- Update
8
  - Confirm
9
  - Cancel
10 16 karnake ruengchaicharnkij
  - Remove
11 13 Ryan Supawarapong
12 4 Ryan Supawarapong
## Diagram
13 1 Ryan Supawarapong
<img src="market_place.png"><br>
14 16 karnake ruengchaicharnkij
```
15
title Market Place
16 1 Ryan Supawarapong
17 16 karnake ruengchaicharnkij
actor "customer" as c
18
actor "owner" as o
19
actor "admin" as a
20
participant "frontend" as fe
21
participant "admin" as adm
22
participant "backend" as be
23
database "database" as db
24
participant "notification" as n
25
26
o->fe: post sell asset
27
fe->be: verify asset and quantities
28
be<->db: query database
29
be->fe: true/false
30
fe->c: true: dispaly new post
31
c->fe: click "interest" button
32
fe->be: update status and count down 15 minutes
33
be<->db: update database
34
be->fe: true/false
35
fe->c: show status "locked"
36
be->n: update payment notification
37
n->c: email bank account info and payment noti within 15 minutes
38
c->n: click confirm payment
39
c->fe: totp to confirm payment
40
fe->be: update payment
41
fe->fe: update status to "pending payment confirm"
42
be<->db: update database
43
be->n: update payment confirmation
44
n->o: email payment acknowledge confirmation and pay service fees
45
o->n: click confirm service fees
46
o->fe: totp to confirm service fees
47
fe->be: update service fees transaction
48
fe->fe: update status to "pending service fees confirm"
49
be<->db: update database
50
be->n: send service fees notification
51
n->a: get noti for new service fees
52
adm<->be: get new service fees
53
a->adm: verify service fees
54
adm<->be: show service fees
55
a->adm: approved service fees
56
adm->be: update service fees status
57
be<->db: update database
58
be->n: send notification
59
n->o: get noti service fees approved
60
fe->fe: update status to "complete"
61
```
62 12 Ryan Supawarapong
### Get
63
<img style="width: 264px;" src="clipboard-202602171558-lepmv.png"><br>
64 7 Ryan Supawarapong
<img style="width: 324px;" src="clipboard-202602171559-izoj5.png"><br>
65 6 Ryan Supawarapong
66 7 Ryan Supawarapong
### Sell
67 4 Ryan Supawarapong
Flowchart and sequence diagram for sell api.
68 1 Ryan Supawarapong
<img style="width: 226px;" src="clipboard-202602171357-fmt5h.png"><br>
69
<img style="width: 380px;" src="clipboard-202602171359-nyduz.png"><br>
70 12 Ryan Supawarapong
71
### Reserve
72 11 Ryan Supawarapong
<img style="width: 282px;" src="clipboard-202602171527-anmwr.png"><br>
73 8 Ryan Supawarapong
<img style="width: 439px;" src="clipboard-202602171557-yqhga.png"><br>
74 2 Ryan Supawarapong
75
## API route
76 1 Ryan Supawarapong
77 13 Ryan Supawarapong
### Get
78 2 Ryan Supawarapong
Allow authenticated user to get listing of market place
79
80 3 Ryan Supawarapong
| Type | Value |
81
| ---- | ----- | 
82
| API URL | /api/v1/customer/marketplace/listing/get |
83
| Type | Get |
84
| Param/Body Input | N/A |
85 1 Ryan Supawarapong
86
87 3 Ryan Supawarapong
#### Response
88
89 1 Ryan Supawarapong
| JSON Path | Type | Example | Required |
90
|---|---|---|---|
91
| status | string | "success" | yes |
92
| xid | string | "xRequestID" | yes |
93
| data | object | {"marketplace":[...]} | yes |
94
| data.marketplace | array<object| [ { ... } ] | yes |
95
| data.marketplace[].id | integer | 1 | yes |
96
| data.marketplace[].icoCode | string | "product1" | yes |
97
| data.marketplace[].from | integer | 90000004 | yes |
98
| data.marketplace[].to | integer | 0 | yes |
99
| data.marketplace[].unitAmount | integer | 10 | yes |
100
| data.marketplace[].unitPrice | number | 2 | yes |
101
| data.marketplace[].totalPrice | number | 20 | yes |
102
| data.marketplace[].status | integer | 0 | yes |
103
| data.marketplace[].CreatedAt | string (date-time) | "2024-06-01T00:00:00Z" | yes |
104
| data.marketplace[].UpdatedAt | string (date-time) | "0001-01-01T00:00:00Z" | yes |
105 2 Ryan Supawarapong
| data.marketplace[].DeletedAt | null/object | null | yes |
106 1 Ryan Supawarapong
107 3 Ryan Supawarapong
##### Example response body
108 1 Ryan Supawarapong
| Body | Value |
109
|---|---|
110
| JSON | {"status":"success","xid":"xRequestID","data":{"marketplace":[{"id":1,"icoCode":"product1","from":90000004,"to":0,"unitAmount":10,"unitPrice":2,"totalPrice":20,"status":0,"CreatedAt":"2024-06-01T00:00:00Z","UpdatedAt":"0001-01-01T00:00:00Z","DeletedAt":null},{"id":2,"icoCode":"product2","from":90000005,"to":0,"unitAmount":5,"unitPrice":3,"totalPrice":15,"status":0,"CreatedAt":"2024-06-01T00:00:10Z","UpdatedAt":"0001-01-01T00:00:00Z","DeletedAt":null},{"id":3,"icoCode":"product3","from":90000006,"to":90000005,"unitAmount":8,"unitPrice":1.5,"totalPrice":12,"status":2,"CreatedAt":"2024-06-01T00:00:20Z","UpdatedAt":"0001-01-01T00:00:00Z","DeletedAt":null}]}} |
111 13 Ryan Supawarapong
112
113
### Sell