Volcano API
๐Ÿš€ API Endpoints

๐ŸŽŸ๏ธ Promotion Codes

Promotion code creation and validation endpoints. 6 endpoints available.

๐ŸŽฏ Quick Stats

๐Ÿ“Š Methods

  • ๐Ÿ“ POST: 2 endpoints
  • ๐Ÿ” GET: 2 endpoints
  • โœ๏ธ PUT: 1 endpoints
  • ๐Ÿ—‘๏ธ DELETE: 1 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

MethodEndpointDescription
๐Ÿ“ POST/promotion-codeCreate promotion code
๐Ÿ” GET/promotion-codeGet promotion code list
๐Ÿ” GET/promotion-code/{code}Get promotion code by code
โœ๏ธ PUT/promotion-code/{code}Update promotion code
๐Ÿ—‘๏ธ DELETE/promotion-code/{code}Delete promotion code
๐Ÿ“ POST/promotion-code/validateValidate promotion code

๐Ÿ“– Detailed Documentation

Create promotion code

POST/promotion-code
Full URL
https://api.market.decenctype.com/promotion-code

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
codestringโœ…ไฟƒ้”€ไปฃ็ 
discountAmountnumberโœ…Discount amount
currencystringโœ…่ดงๅธ (้ป˜่ฎค: USD)
maxUsagenumberโœ…Maximum usage limit (้ป˜่ฎค: 1)
statusstring (active, inactive, expired)โœ…Status (้ป˜่ฎค: active)
expirationDatestringโœ…Expiration date
agentIdstringโœ…Agent ID
merchantIdstringโœ…Merchant ID

Description: Create promotion code

Operation ID: createPromotionCode

Response Status:

  • โœ… 201: Promotion code created successfully
  • โŒ 400: Bad request

๐Ÿ“‹ Response Examples

response.json
1{
2 "id": "example-id",
3 "code": "example-code",
4 "discountAmount": 1,
5 "userId": "example-id",
6 "agentId": "example-id",
7 "merchantId": "example-id",
8 "currency": "example-currency",
9 "usageCount": 1,
10 "maxUsage": 1,
11 "status": "active",
12 "expirationDate": "2024-01-01T12:00:00Z",
13 "createdAt": "2024-01-01T12:00:00Z",
14 "updatedAt": "2024-01-01T12:00:00Z",
15 "user": "example-user"
16}

๐Ÿ“ Example Request

curl -X POST "https://api.market.decenctype.com/promotion-code" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "code": "example-code",
  "discountAmount": 1,
  "currency": "USD",
  "maxUsage": 1,
  "status": "active",
  "expirationDate": "example-expirationDate",
  "agentId": "example-id",
  "merchantId": "example-id"
}'

Get promotion code list

GET/promotion-code
Full URL
https://api.market.decenctype.com/promotion-code

๐Ÿ“‹ Query Parameters

ParameterTypeRequiredDescription
pagenumberโŒPage number
pageSizenumberโŒPage size
statusstringโŒFilter by status

Description: Get promotion code list

Operation ID: getPromotionCodeList

Response Status:

  • โœ… 200: Promotion code list

๐Ÿ“‹ Response Examples

response.json
1{
2 "items": [
3 {
4 "id": "example-id",
5 "code": "example-code",
6 "discountAmount": 1,
7 "userId": "example-id",
8 "agentId": "example-id",
9 "merchantId": "example-id",
10 "currency": "example-currency",
11 "usageCount": 1,
12 "maxUsage": 1,
13 "status": "active",
14 "expirationDate": "2024-01-01T12:00:00Z",
15 "createdAt": "2024-01-01T12:00:00Z",
16 "updatedAt": "2024-01-01T12:00:00Z",
17 "user": "example-user"
18 }
19 ],
20 "meta": "example-meta"
21}

๐Ÿ“ Example Request

curl -X GET "https://api.market.decenctype.com/promotion-code" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Get promotion code by code

GET/promotion-code/{code}
Full URL
https://api.market.decenctype.com/promotion-code/{code}

๐ŸŽฏ Path Parameters

  • code (string) - โœ… Required: Promotion code

Description: Get promotion code by code

Operation ID: getPromotionCodeByCode

Response Status:

  • โœ… 200: Promotion code details
  • โŒ 404: Promotion code not found

๐Ÿ“‹ Response Examples

response.json
1{
2 "id": "example-id",
3 "code": "example-code",
4 "discountAmount": 1,
5 "userId": "example-id",
6 "agentId": "example-id",
7 "merchantId": "example-id",
8 "currency": "example-currency",
9 "usageCount": 1,
10 "maxUsage": 1,
11 "status": "active",
12 "expirationDate": "2024-01-01T12:00:00Z",
13 "createdAt": "2024-01-01T12:00:00Z",
14 "updatedAt": "2024-01-01T12:00:00Z",
15 "user": "example-user"
16}

๐Ÿ“ Example Request

curl -X GET "https://api.market.decenctype.com/promotion-code/example-code" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Update promotion code

PUT/promotion-code/{code}
Full URL
https://api.market.decenctype.com/promotion-code/{code}

๐ŸŽฏ Path Parameters

  • code (string) - โœ… Required: Promotion code

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
discountAmountnumberโœ…Discount amount
currencystringโœ…่ดงๅธ
maxUsagenumberโœ…Maximum usage limit
statusstring (active, inactive, expired)โœ…Status
expirationDatestringโœ…Expiration date
agentIdstringโœ…Agent ID
merchantIdstringโœ…Merchant ID

Description: Update promotion code

Operation ID: updatePromotionCode

Response Status:

  • โœ… 200: Promotion code updated successfully
  • โŒ 404: Promotion code not found

๐Ÿ“‹ Response Examples

response.json
1{
2 "id": "example-id",
3 "code": "example-code",
4 "discountAmount": 1,
5 "userId": "example-id",
6 "agentId": "example-id",
7 "merchantId": "example-id",
8 "currency": "example-currency",
9 "usageCount": 1,
10 "maxUsage": 1,
11 "status": "active",
12 "expirationDate": "2024-01-01T12:00:00Z",
13 "createdAt": "2024-01-01T12:00:00Z",
14 "updatedAt": "2024-01-01T12:00:00Z",
15 "user": "example-user"
16}

๐Ÿ“ Example Request

curl -X PUT "https://api.market.decenctype.com/promotion-code/example-code" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "discountAmount": 1,
  "currency": "example-currency",
  "maxUsage": 1,
  "status": "active",
  "expirationDate": "example-expirationDate",
  "agentId": "example-id",
  "merchantId": "example-id"
}'

Delete promotion code

DELETE/promotion-code/{code}
Full URL
https://api.market.decenctype.com/promotion-code/{code}

๐ŸŽฏ Path Parameters

  • code (string) - โœ… Required: Promotion code

Description: Delete promotion code

Operation ID: deletePromotionCode

Response Status:

  • โœ… 200: Promotion code deleted successfully
  • โŒ 404: Promotion code not found

๐Ÿ“ Example Request

curl -X DELETE "https://api.market.decenctype.com/promotion-code/example-code" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json"

Validate promotion code

POST/promotion-code/validate
Full URL
https://api.market.decenctype.com/promotion-code/validate

๐Ÿ“ Request Body Parameters

ParameterTypeRequiredDescription
codestringโœ…ไฟƒ้”€ไปฃ็ 
orderAmountnumberโœ…Order amount

Description: Validate promotion code

Operation ID: validatePromotionCode

Response Status:

  • โœ… 200: Promotion code validation result
  • โœ… 201: Success

๐Ÿ“‹ Response Examples

response.json
1{
2 "valid": false,
3 "discountAmount": 0,
4 "promotionCode": "example-promotionCode",
5 "error": "Promotion code not found"
6}

๐Ÿ“ Example Request

curl -X POST "https://api.market.decenctype.com/promotion-code/validate" \\
  -H "Authorization: Bearer YOUR_TOKEN" \\
  -H "Content-Type: application/json" \\
  -d '{
  "code": "example-code",
  "orderAmount": 1
}'