๐ช Merchant Management
Merchant account and application management endpoints. 12 endpoints available.
๐ฏ Quick Stats
- Total Endpoints: 12
- Base URL:
https://api.market.decenctype.com - Authentication: Bearer Token / API Key
๐ Methods
- ๐ POST: 3 endpoints
- ๐ GET: 6 endpoints
- โ๏ธ PUT: 3 endpoints
๐ Authentication
All endpoints in this section use the same authentication methods. Choose one:
๐ Bearer Token (Recommended)
For user session authentication
Add to request headers:
Authorization: Bearer YOUR_TOKEN๐ง API Key
For server-side authentication
Add to request headers:
X-API-KEY: YOUR_API_KEYโ ๏ธ Important: Do not use both authentication methods simultaneously in the same request.
๐ Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
๐ POST | /merchant | create a merchant |
๐ GET | /merchant | Get merchant list, supports filtering by merchant name |
๐ GET | /merchant/{merchantId} | Get merchant by merchant id |
โ๏ธ PUT | /merchant/{merchantId} | Update merchant |
๐ POST | /merchant/app/create | Create an app for merchant |
๐ GET | /merchant/app/list | Get merchant's apps by merchant id |
๐ GET | /merchant/app/{appKey} | Get an app by app key |
๐ GET | /merchant/app/{appId} | Get an app by app id |
โ๏ธ PUT | /merchant/app/{appId}/suspend | Revoke an app for merchant with app id |
๐ GET | /merchant/app/scopes | Get available permission scopes for oauth app |
โ๏ธ PUT | /merchant/app/scopes | Update application permission scopes |
๐ POST | /merchant/user/create | Create a user for merchant |
๐ Detailed Documentation
create a merchant
/merchanthttps://api.market.decenctype.com/merchant๐ Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
merchantName | string | โ | The name of the merchant |
description | string | โ | The description of the merchant |
Description: create a merchant
Operation ID: create
Response Status:
- โ 201: Success
This endpoint is only accessible by super admin
๐ Response Examples
1{2 "merchantId": "example-id",3 "merchantName": "example-merchantName",4 "description": "example-description",5 "status": "example-status",6 "settings": "example-settings",7 "oauthApps": [8 {9 "appId": "550e8400-e29b-41d4-a716-446655440000",10 "merchantId": "550e8400-e29b-41d4-a716-446655440000",11 "merchant": "example-merchant",12 "appName": "My OAuth App",13 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",14 "appKey": "ak_123456789",15 "appSecret": "as_987654321",16 "redirectUrl": "https://example.com/callback",17 "scopes": [18 "read",19 "write",20 "delete"21 ],22 "ipWhitelist": [23 "192.168.1.1",24 "10.0.0.1"25 ],26 "status": "active",27 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"28 }29 ],30 "cardProducts": [31 {32 "cardProductId": "example-id",33 "issuerId": "example-id",34 "issuer": "example-issuer",35 "channelId": "example-id",36 "channel": "example-channel",37 "status": "example-status",38 "product": "example-product",39 "price": 1,40 "currency": "example-currency",41 "type": "example-type",42 "cardDesign": "example-cardDesign",43 "designId": "example-id",44 "country": "example-country",45 "bin": "example-bin",46 "description": "example-description",47 "isGlobal": true,48 "settings": "example-settings"49 }50 ]51}๐ Example Request
curl -X POST "https://api.market.decenctype.com/merchant" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{
"merchantName": "Merchant 1"
}'Get merchant list, supports filtering by merchant name
/merchanthttps://api.market.decenctype.com/merchant๐ Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | โ | No description |
sortField | string | โ | ๆๅบๅญๆฎต |
sort | string | โ | ๆๅบๆนๅผ |
page | number | โ | ้กต็ ๏ผไป1ๅผๅง๏ผ |
pageSize | number | โ | ๆฏ้กตๆกๆฐ |
Description: Get merchant list, supports filtering by merchant name
Operation ID: getByName
Response Status:
- โ 200: The list of merchants.
๐ Response Examples
1{2 "items": [3 {4 "merchantId": "example-id",5 "merchantName": "example-merchantName",6 "description": "example-description",7 "status": "example-status",8 "settings": "example-settings",9 "oauthApps": [10 {11 "appId": "550e8400-e29b-41d4-a716-446655440000",12 "merchantId": "550e8400-e29b-41d4-a716-446655440000",13 "merchant": "example-merchant",14 "appName": "My OAuth App",15 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",16 "appKey": "ak_123456789",17 "appSecret": "as_987654321",18 "redirectUrl": "https://example.com/callback",19 "scopes": [20 "read",21 "write",22 "delete"23 ],24 "ipWhitelist": [25 "192.168.1.1",26 "10.0.0.1"27 ],28 "status": "active",29 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"30 }31 ],32 "cardProducts": [33 {34 "cardProductId": "example-id",35 "issuerId": "example-id",36 "issuer": "example-issuer",37 "channelId": "example-id",38 "channel": "example-channel",39 "status": "example-status",40 "product": "example-product",41 "price": 1,42 "currency": "example-currency",43 "type": "example-type",44 "cardDesign": "example-cardDesign",45 "designId": "example-id",46 "country": "example-country",47 "bin": "example-bin",48 "description": "example-description",49 "isGlobal": true,50 "settings": "example-settings"51 }52 ]53 }54 ],55 "meta": "example-meta"56}๐ Example Request
curl -X GET "https://api.market.decenctype.com/merchant" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"Get merchant by merchant id
/merchant/{merchantId}https://api.market.decenctype.com/merchant/{merchantId}๐ฏ Path Parameters
merchantId(string) - โ Required: No description
Description: Get merchant by merchant id
Operation ID: getById
Response Status:
- โ 200: Success
๐ Response Examples
1{2 "merchantId": "example-id",3 "merchantName": "example-merchantName",4 "description": "example-description",5 "status": "example-status",6 "settings": "example-settings",7 "oauthApps": [8 {9 "appId": "550e8400-e29b-41d4-a716-446655440000",10 "merchantId": "550e8400-e29b-41d4-a716-446655440000",11 "merchant": "example-merchant",12 "appName": "My OAuth App",13 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",14 "appKey": "ak_123456789",15 "appSecret": "as_987654321",16 "redirectUrl": "https://example.com/callback",17 "scopes": [18 "read",19 "write",20 "delete"21 ],22 "ipWhitelist": [23 "192.168.1.1",24 "10.0.0.1"25 ],26 "status": "active",27 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"28 }29 ],30 "cardProducts": [31 {32 "cardProductId": "example-id",33 "issuerId": "example-id",34 "issuer": "example-issuer",35 "channelId": "example-id",36 "channel": "example-channel",37 "status": "example-status",38 "product": "example-product",39 "price": 1,40 "currency": "example-currency",41 "type": "example-type",42 "cardDesign": "example-cardDesign",43 "designId": "example-id",44 "country": "example-country",45 "bin": "example-bin",46 "description": "example-description",47 "isGlobal": true,48 "settings": "example-settings"49 }50 ]51}๐ Example Request
curl -X GET "https://api.market.decenctype.com/merchant/example-id" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"Update merchant
/merchant/{merchantId}https://api.market.decenctype.com/merchant/{merchantId}๐ฏ Path Parameters
merchantId(string) - โ Required: No description
๐ Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
merchantName | string | โ | The name of the merchant |
description | string | โ | The description of the merchant |
Description: Update merchant
Operation ID: updateMerchant
Response Status:
- โ 200: Success
๐ Response Examples
1{2 "merchantId": "example-id",3 "merchantName": "example-merchantName",4 "description": "example-description",5 "status": "example-status",6 "settings": "example-settings",7 "oauthApps": [8 {9 "appId": "550e8400-e29b-41d4-a716-446655440000",10 "merchantId": "550e8400-e29b-41d4-a716-446655440000",11 "merchant": "example-merchant",12 "appName": "My OAuth App",13 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",14 "appKey": "ak_123456789",15 "appSecret": "as_987654321",16 "redirectUrl": "https://example.com/callback",17 "scopes": [18 "read",19 "write",20 "delete"21 ],22 "ipWhitelist": [23 "192.168.1.1",24 "10.0.0.1"25 ],26 "status": "active",27 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"28 }29 ],30 "cardProducts": [31 {32 "cardProductId": "example-id",33 "issuerId": "example-id",34 "issuer": "example-issuer",35 "channelId": "example-id",36 "channel": "example-channel",37 "status": "example-status",38 "product": "example-product",39 "price": 1,40 "currency": "example-currency",41 "type": "example-type",42 "cardDesign": "example-cardDesign",43 "designId": "example-id",44 "country": "example-country",45 "bin": "example-bin",46 "description": "example-description",47 "isGlobal": true,48 "settings": "example-settings"49 }50 ]51}๐ Example Request
curl -X PUT "https://api.market.decenctype.com/merchant/example-id" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{
"merchantName": "Merchant 1"
}'Create an app for merchant
/merchant/app/createhttps://api.market.decenctype.com/merchant/app/create๐ Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
appName | string | โ | The name of the app |
description | string | โ | The description of the app |
redirectUri | string | โ | The redirect uri of the app |
ipWhitelist | string | โ | The ip whitelist of the app |
Description: Create an app for merchant
Operation ID: createOauthApp
Response Status:
- โ 201: Success
๐ Response Examples
1{2 "appId": "550e8400-e29b-41d4-a716-446655440000",3 "merchantId": "550e8400-e29b-41d4-a716-446655440000",4 "merchant": "example-merchant",5 "appName": "My OAuth App",6 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",7 "appKey": "ak_123456789",8 "appSecret": "as_987654321",9 "redirectUrl": "https://example.com/callback",10 "scopes": [11 "read",12 "write",13 "delete"14 ],15 "ipWhitelist": [16 "192.168.1.1",17 "10.0.0.1"18 ],19 "status": "active",20 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"21}๐ Example Request
curl -X POST "https://api.market.decenctype.com/merchant/app/create" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{
"appName": "My App"
}'Get merchant's apps by merchant id
/merchant/app/listhttps://api.market.decenctype.com/merchant/app/list๐ Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sortField | string | โ | ๆๅบๅญๆฎต |
sort | string | โ | ๆๅบๆนๅผ |
page | number | โ | ้กต็ ๏ผไป1ๅผๅง๏ผ |
pageSize | number | โ | ๆฏ้กตๆกๆฐ |
Description: Get merchant's apps by merchant id
Operation ID: getOauthApps
Response Status:
- โ 200: The list of merchant apps.
๐ Response Examples
1{2 "items": [3 {4 "appId": "550e8400-e29b-41d4-a716-446655440000",5 "merchantId": "550e8400-e29b-41d4-a716-446655440000",6 "merchant": "example-merchant",7 "appName": "My OAuth App",8 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",9 "appKey": "ak_123456789",10 "appSecret": "as_987654321",11 "redirectUrl": "https://example.com/callback",12 "scopes": [13 "read",14 "write",15 "delete"16 ],17 "ipWhitelist": [18 "192.168.1.1",19 "10.0.0.1"20 ],21 "status": "active",22 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"23 }24 ],25 "meta": "example-meta"26}๐ Example Request
curl -X GET "https://api.market.decenctype.com/merchant/app/list" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"Get an app by app key
/merchant/app/{appKey}https://api.market.decenctype.com/merchant/app/{appKey}๐ฏ Path Parameters
appKey(string) - โ Required: No description
Description: Get an app by app key
Operation ID: getOauthAppByKey
Response Status:
- โ 200: Success
๐ Response Examples
1{2 "appId": "550e8400-e29b-41d4-a716-446655440000",3 "merchantId": "550e8400-e29b-41d4-a716-446655440000",4 "merchant": "example-merchant",5 "appName": "My OAuth App",6 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",7 "appKey": "ak_123456789",8 "appSecret": "as_987654321",9 "redirectUrl": "https://example.com/callback",10 "scopes": [11 "read",12 "write",13 "delete"14 ],15 "ipWhitelist": [16 "192.168.1.1",17 "10.0.0.1"18 ],19 "status": "active",20 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"21}๐ Example Request
curl -X GET "https://api.market.decenctype.com/merchant/app/example-appKey" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"Get an app by app id
/merchant/app/{appId}https://api.market.decenctype.com/merchant/app/{appId}๐ฏ Path Parameters
appId(string) - โ Required: No description
Description: Get an app by app id
Operation ID: getOauthAppById
Response Status:
- โ 200: Success
๐ Response Examples
1{2 "appId": "550e8400-e29b-41d4-a716-446655440000",3 "merchantId": "550e8400-e29b-41d4-a716-446655440000",4 "merchant": "example-merchant",5 "appName": "My OAuth App",6 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",7 "appKey": "ak_123456789",8 "appSecret": "as_987654321",9 "redirectUrl": "https://example.com/callback",10 "scopes": [11 "read",12 "write",13 "delete"14 ],15 "ipWhitelist": [16 "192.168.1.1",17 "10.0.0.1"18 ],19 "status": "active",20 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"21}๐ Example Request
curl -X GET "https://api.market.decenctype.com/merchant/app/example-id" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"Revoke an app for merchant with app id
/merchant/app/{appId}/suspendhttps://api.market.decenctype.com/merchant/app/{appId}/suspend๐ฏ Path Parameters
appId(string) - โ Required: No description
Description: Revoke an app for merchant with app id
Operation ID: suspendOauthApp
Response Status:
- โ 200: Success
๐ Response Examples
1{2 "appId": "550e8400-e29b-41d4-a716-446655440000",3 "merchantId": "550e8400-e29b-41d4-a716-446655440000",4 "merchant": "example-merchant",5 "appName": "My OAuth App",6 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",7 "appKey": "ak_123456789",8 "appSecret": "as_987654321",9 "redirectUrl": "https://example.com/callback",10 "scopes": [11 "read",12 "write",13 "delete"14 ],15 "ipWhitelist": [16 "192.168.1.1",17 "10.0.0.1"18 ],19 "status": "active",20 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"21}๐ Example Request
curl -X PUT "https://api.market.decenctype.com/merchant/app/example-id/suspend" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"Get available permission scopes for oauth app
/merchant/app/scopeshttps://api.market.decenctype.com/merchant/app/scopes๐ Authentication: Required (see authentication section above)
Description: Get available permission scopes for oauth app
Operation ID: getAvailableScopes
Response Status:
- โ 200: The available permission scopes for oauth app.
๐ Response Examples
1[2 {3 "permissionId": 1,4 "action": {},5 "resource": "example-resource",6 "name": "example-name",7 "description": "example-description",8 "scope": {},9 "roles": [10 {11 "roleId": 1,12 "name": "example-name",13 "description": "example-description",14 "permissions": [],15 "users": [16 {17 "basicKyc": 3,18 "userId": "example-id",19 "username": "example-username",20 "firstName": "example-firstName",21 "lastName": "example-lastName",22 "email": "user@example.com",23 "emailVerified": true,24 "number": 1,25 "path": "example-path",26 "inviteCode": "example-inviteCode",27 "parentInviteCode": "example-parentInviteCode",28 "level": 1,29 "status": {},30 "merchantId": "example-id",31 "lastLoginIp": "example-lastLoginIp",32 "lastLoginAt": "2024-01-01T12:00:00Z",33 "permissions": [],34 "merchant": "example-merchant",35 "groupMemberships": [36 {37 "membershipId": "123e4567-e89b-12d3-a456-426614174000",38 "userId": "123e4567-e89b-12d3-a456-426614174000",39 "groupId": "123e4567-e89b-12d3-a456-426614174000",40 "role": "member",41 "status": "active",42 "user": "example-user",43 "userGroup": "example-userGroup"44 }45 ]46 }47 ]48 }49 ],50 "users": [51 {52 "basicKyc": 3,53 "userId": "example-id",54 "username": "example-username",55 "firstName": "example-firstName",56 "lastName": "example-lastName",57 "email": "user@example.com",58 "emailVerified": true,59 "number": 1,60 "path": "example-path",61 "inviteCode": "example-inviteCode",62 "parentInviteCode": "example-parentInviteCode",63 "level": 1,64 "status": {},65 "merchantId": "example-id",66 "lastLoginIp": "example-lastLoginIp",67 "lastLoginAt": "2024-01-01T12:00:00Z",68 "permissions": [],69 "merchant": "example-merchant",70 "groupMemberships": [71 {72 "membershipId": "123e4567-e89b-12d3-a456-426614174000",73 "userId": "123e4567-e89b-12d3-a456-426614174000",74 "groupId": "123e4567-e89b-12d3-a456-426614174000",75 "role": "member",76 "status": "active",77 "user": "example-user",78 "userGroup": "example-userGroup"79 }80 ]81 }82 ]83 }84]๐ Example Request
curl -X GET "https://api.market.decenctype.com/merchant/app/scopes" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"Update application permission scopes
/merchant/app/scopeshttps://api.market.decenctype.com/merchant/app/scopes๐ Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
appId | string | โ | ๅบ็จID |
scopes | array | โ | ๆ้่ๅดIDๅ่กจ |
Description: Update application permission scopes
Operation ID: updateOauthAppScopes
Response Status:
- โ 200: Success
๐ Response Examples
1{2 "appId": "550e8400-e29b-41d4-a716-446655440000",3 "merchantId": "550e8400-e29b-41d4-a716-446655440000",4 "merchant": "example-merchant",5 "appName": "My OAuth App",6 "description": "่ฟๆฏไธไธชOAuthๅบ็จ็ๆ่ฟฐ",7 "appKey": "ak_123456789",8 "appSecret": "as_987654321",9 "redirectUrl": "https://example.com/callback",10 "scopes": [11 "read",12 "write",13 "delete"14 ],15 "ipWhitelist": [16 "192.168.1.1",17 "10.0.0.1"18 ],19 "status": "active",20 "reason": "ๅบ็จๆๅไฝฟ็จๅๅ ่ฏดๆ"21}๐ Example Request
curl -X PUT "https://api.market.decenctype.com/merchant/app/scopes" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{
"appId": "550e8400-e29b-41d4-a716-446655440000",
"scopes": [
1,
2,
3
]
}'Create a user for merchant
/merchant/user/createhttps://api.market.decenctype.com/merchant/user/create๐ Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | โ | |
password | string | โ | password |
username | string | โ | ็จๆทๅ |
merchantId | string | โ | merchantId |
Description: Create a user for merchant
Operation ID: createUser
Response Status:
- โ 201: The user has been successfully created.
๐ Response Examples
1{2 "basicKyc": 3,3 "advancedKyc": 0,4 "userId": "example-id",5 "username": "example-username",6 "firstName": "example-firstName",7 "lastName": "example-lastName",8 "email": "user@example.com",9 "emailVerified": true,10 "password": "example-password",11 "number": 1,12 "path": "example-path",13 "inviteCode": "example-inviteCode",14 "parentInviteCode": "example-parentInviteCode",15 "level": 1,16 "status": {},17 "merchantId": "example-id",18 "lastLoginIp": "example-lastLoginIp",19 "lastLoginAt": "2024-01-01T12:00:00Z",20 "role": "example-role",21 "roles": [22 {23 "roleId": 1,24 "name": "example-name",25 "description": "example-description",26 "permissions": [27 {28 "permissionId": 1,29 "action": {},30 "resource": "example-resource",31 "name": "example-name",32 "description": "example-description",33 "scope": {},34 "roles": [],35 "users": []36 }37 ],38 "users": []39 }40 ],41 "permissions": [42 {43 "permissionId": 1,44 "action": {},45 "resource": "example-resource",46 "name": "example-name",47 "description": "example-description",48 "scope": {},49 "roles": [50 {51 "roleId": 1,52 "name": "example-name",53 "description": "example-description",54 "permissions": [],55 "users": []56 }57 ],58 "users": []59 }60 ],61 "merchant": "example-merchant",62 "groupMemberships": [63 {64 "membershipId": "123e4567-e89b-12d3-a456-426614174000",65 "userId": "123e4567-e89b-12d3-a456-426614174000",66 "groupId": "123e4567-e89b-12d3-a456-426614174000",67 "role": "member",68 "status": "active",69 "user": "example-user",70 "userGroup": "example-userGroup"71 }72 ]73}๐ Example Request
curl -X POST "https://api.market.decenctype.com/merchant/user/create" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{
"email": "mail@example.com",
"password": "123456",
"username": "john doe",
"merchantId": "1234567890"
}'