Project

General

Profile

Marketplace » History » Version 18

Ryan Supawarapong, 02/20/2026 04:16 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 1 Ryan Supawarapong
63 17 Ryan Supawarapong
## API route
64 1 Ryan Supawarapong
65 17 Ryan Supawarapong
## Lists
66 1 Ryan Supawarapong
67 8 Ryan Supawarapong
68 17 Ryan Supawarapong
| Type    | Value  |
69
| --------| ---- | 
70 18 Ryan Supawarapong
| API Path| `/marketplace/v1/marketplace/lists` |
71 17 Ryan Supawarapong
| Request Type | `GET` |
72
| Content-Type | `application/json` |
73 13 Ryan Supawarapong
74 17 Ryan Supawarapong
### Request Body
75 3 Ryan Supawarapong
76 17 Ryan Supawarapong
| Key | Type | Example | Required |
77
|-----|------|---------|----------|
78 3 Ryan Supawarapong
79 17 Ryan Supawarapong
80
81 3 Ryan Supawarapong
#### Response
82
83 1 Ryan Supawarapong
| JSON Path | Type | Example | Required |
84
|---|---|---|---|
85
| status | string | "success" | yes |
86
| xid | string | "xRequestID" | yes |
87 17 Ryan Supawarapong
| data | object | {"transactions":[...]} | yes |
88
| data.transactions | array<object| [ { ... } ] | yes |
89 1 Ryan Supawarapong
| data.marketplace[].id | integer | 1 | yes |
90
| data.marketplace[].icoCode | string | "product1" | yes |
91
| data.marketplace[].from | integer | 90000004 | yes |
92
| data.marketplace[].to | integer | 0 | yes |
93
| data.marketplace[].unitAmount | integer | 10 | yes |
94
| data.marketplace[].unitPrice | number | 2 | yes |
95
| data.marketplace[].totalPrice | number | 20 | yes |
96
| data.marketplace[].status | integer | 0 | yes |
97
| data.marketplace[].CreatedAt | string (date-time) | "2024-06-01T00:00:00Z" | yes |
98
| data.marketplace[].UpdatedAt | string (date-time) | "0001-01-01T00:00:00Z" | yes |
99 2 Ryan Supawarapong
| data.marketplace[].DeletedAt | null/object | null | yes |
100 1 Ryan Supawarapong
101 3 Ryan Supawarapong
##### Example response body
102 1 Ryan Supawarapong
| Body | Value |
103
|---|---|
104
| 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}]}} |
105 13 Ryan Supawarapong
106
107
### Sell