Getting Started with CAFE24 API
With CAFE24 API, you can programmatically manage various data such as products, orders, and customers in your shopping mall.
API Overview
| Item | Description |
|---|---|
| Base URL | https://{mall_id}.cafe24api.com/api/v2 |
| Protocol | HTTPS (TLS 1.2 or higher) |
| Authentication | OAuth 2.0 |
| Response Format | JSON |
| Character Encoding | UTF-8 |
Quick Start
1. Register App
Register your app at CAFE24 Developer Center and obtain Client ID and Client Secret.
2. Issue Access Token
curl -X POST "https://{mall_id}.cafe24api.com/api/v2/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code" \
-d "code={authorization_code}" \
-d "redirect_uri={redirect_uri}" \
-d "client_id={client_id}" \
-d "client_secret={client_secret}"
3. Call API
curl -X GET "https://{mall_id}.cafe24api.com/api/v2/admin/products" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json"
4. Check Response
{
"products": [
{
"product_no": 1,
"product_name": "Sample Product",
"price": "10000.00",
"created_date": "2024-01-15T09:00:00+09:00"
}
]
}
API Types
Admin API
API for shopping mall administrators. Provides admin functions such as product registration, order management, and customer management.
- Product Management (Products)
- Order Management (Orders)
- Customer Management (Customers)
- Category Management (Categories)
Front API
API for shopping mall frontend. Provides customer functions such as product inquiry, shopping cart, and ordering.
- Product Inquiry
- Shopping Cart
- Order/Payment
Authentication (OAuth 2.0)
CAFE24 API uses OAuth 2.0 authentication.
┌─────────┐ 1. Auth Request ┌─────────────┐
│ App │ ──────────────────▶ │ CAFE24 │
│ │ │ OAuth │
│ │ ◀────────────────── │ Server │
└─────────┘ 2. Access Token └─────────────┘
│
│ 3. API Call (Bearer Token)
▼
┌─────────────┐
│ CAFE24 │
│ API │
└─────────────┘
Token Types
| Token | Validity Period | Purpose |
|---|---|---|
| Access Token | 2 hours | Authentication for API calls |
| Refresh Token | 14 days | Refresh Access Token |
Rate Limit
API calls have the following limits:
| Type | Limit |
|---|---|
| Requests per second | 10 requests |
| Requests per minute | 300 requests |
When Rate Limit is exceeded, a 429 Too Many Requests response is returned.
Error Handling
HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
429 | Rate Limit Exceeded |
500 | Internal Server Error |
Error Response Format
{
"error": {
"code": "INVALID_REQUEST",
"message": "Required parameter is missing.",
"more_info": "https://developers.cafe24.com/errors/INVALID_REQUEST"
}
}
Next Steps
- Admin API Documentation - Admin API Reference
- OAuth Authentication Guide - Detailed Authentication Guide
- Error Code List - Complete Error Code List