고객 생성
curl --request POST \
--url https://api.steppay.kr/api/v1/customers \
--header 'Content-Type: application/json' \
--header 'Secret-Token: <api-key>' \
--data '
{
"name": "테스트 고객",
"username": "test@gmail.com",
"email": "test@gmail.com",
"phone": "010-1234-5678"
}
'import requests
url = "https://api.steppay.kr/api/v1/customers"
payload = {
"name": "테스트 고객",
"username": "test@gmail.com",
"email": "test@gmail.com",
"phone": "010-1234-5678"
}
headers = {
"Secret-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Secret-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '테스트 고객',
username: 'test@gmail.com',
email: 'test@gmail.com',
phone: '010-1234-5678'
})
};
fetch('https://api.steppay.kr/api/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.steppay.kr/api/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '테스트 고객',
'username' => 'test@gmail.com',
'email' => 'test@gmail.com',
'phone' => '010-1234-5678'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Secret-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.steppay.kr/api/v1/customers"
payload := strings.NewReader("{\n \"name\": \"테스트 고객\",\n \"username\": \"test@gmail.com\",\n \"email\": \"test@gmail.com\",\n \"phone\": \"010-1234-5678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Secret-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.steppay.kr/api/v1/customers")
.header("Secret-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"테스트 고객\",\n \"username\": \"test@gmail.com\",\n \"email\": \"test@gmail.com\",\n \"phone\": \"010-1234-5678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.steppay.kr/api/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Secret-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"테스트 고객\",\n \"username\": \"test@gmail.com\",\n \"email\": \"test@gmail.com\",\n \"phone\": \"010-1234-5678\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"username": "test@gmail.com",
"name": "테스트 고객",
"email": "test@gmail.com",
"phone": "01012345678",
"code": "customer_AbCdEfGhI",
"marketingSms": false,
"marketingEmail": false,
"marketingKakao": false,
"createdAt": "9999-01-01T00:00:00.000000"
}{
"errorCode": "<string>",
"traceId": "<string>",
"errorMessage": "<string>",
"details": {}
}고객 API
고객 생성
고객을 생성할 때 호출합니다.
POST
/
api
/
v1
/
customers
고객 생성
curl --request POST \
--url https://api.steppay.kr/api/v1/customers \
--header 'Content-Type: application/json' \
--header 'Secret-Token: <api-key>' \
--data '
{
"name": "테스트 고객",
"username": "test@gmail.com",
"email": "test@gmail.com",
"phone": "010-1234-5678"
}
'import requests
url = "https://api.steppay.kr/api/v1/customers"
payload = {
"name": "테스트 고객",
"username": "test@gmail.com",
"email": "test@gmail.com",
"phone": "010-1234-5678"
}
headers = {
"Secret-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Secret-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '테스트 고객',
username: 'test@gmail.com',
email: 'test@gmail.com',
phone: '010-1234-5678'
})
};
fetch('https://api.steppay.kr/api/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.steppay.kr/api/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '테스트 고객',
'username' => 'test@gmail.com',
'email' => 'test@gmail.com',
'phone' => '010-1234-5678'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Secret-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.steppay.kr/api/v1/customers"
payload := strings.NewReader("{\n \"name\": \"테스트 고객\",\n \"username\": \"test@gmail.com\",\n \"email\": \"test@gmail.com\",\n \"phone\": \"010-1234-5678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Secret-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.steppay.kr/api/v1/customers")
.header("Secret-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"테스트 고객\",\n \"username\": \"test@gmail.com\",\n \"email\": \"test@gmail.com\",\n \"phone\": \"010-1234-5678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.steppay.kr/api/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Secret-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"테스트 고객\",\n \"username\": \"test@gmail.com\",\n \"email\": \"test@gmail.com\",\n \"phone\": \"010-1234-5678\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"username": "test@gmail.com",
"name": "테스트 고객",
"email": "test@gmail.com",
"phone": "01012345678",
"code": "customer_AbCdEfGhI",
"marketingSms": false,
"marketingEmail": false,
"marketingKakao": false,
"createdAt": "9999-01-01T00:00:00.000000"
}{
"errorCode": "<string>",
"traceId": "<string>",
"errorMessage": "<string>",
"details": {}
}Authorizations
Body
application/json
고객 생성 데이터
고객 아이디 (미입력 시 email을 username으로 사용합니다.)
Required string length:
1 - 64이메일
이름
전화번호
Pattern:
^(0\d{1,2}-?\d{3,4}-?\d{4}|(\+\d{2,3}|\d{2,3}\)|\d{2,3})[ -]?\d{1,2}[ -]?\d{3,4}[ -]?\d{4})$배송지 정보
Show child attributes
Show child attributes
고객이 허가한 마케팅 채널 - Email (기본값: false)
고객이 허가한 마케팅 채널 - SMS (기본값: false)
고객이 허가한 마케팅 채널 - Kakao (기본값: false)
고객의 추가 정보 (커스텀 필드)
Show child attributes
Show child attributes
Response
정상적으로 생성됨
⌘I