고객 수정
curl --request PUT \
--url https://api.steppay.kr/api/v1/customers/{id} \
--header 'Content-Type: application/json' \
--header 'Secret-Token: <api-key>' \
--data '
{
"name": "고객 수정",
"email": "test_modify@gmail.com",
"phone": "010-1234-1234"
}
'import requests
url = "https://api.steppay.kr/api/v1/customers/{id}"
payload = {
"name": "고객 수정",
"email": "test_modify@gmail.com",
"phone": "010-1234-1234"
}
headers = {
"Secret-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Secret-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '고객 수정', email: 'test_modify@gmail.com', phone: '010-1234-1234'})
};
fetch('https://api.steppay.kr/api/v1/customers/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '고객 수정',
'email' => 'test_modify@gmail.com',
'phone' => '010-1234-1234'
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"고객 수정\",\n \"email\": \"test_modify@gmail.com\",\n \"phone\": \"010-1234-1234\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.steppay.kr/api/v1/customers/{id}")
.header("Secret-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"고객 수정\",\n \"email\": \"test_modify@gmail.com\",\n \"phone\": \"010-1234-1234\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.steppay.kr/api/v1/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Secret-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"고객 수정\",\n \"email\": \"test_modify@gmail.com\",\n \"phone\": \"010-1234-1234\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"username": "test@gmail.com",
"name": "고객 수정",
"email": "test_modify@gmail.com",
"phone": "01012341234",
"code": null,
"marketingSms": null,
"marketingEmail": null,
"marketingKakao": null,
"createdAt": "9999-01-01T00:00:00"
}{
"errorCode": "<string>",
"traceId": "<string>",
"errorMessage": "<string>",
"details": {}
}{
"id": 123,
"username": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"code": "<string>",
"marketingSms": true,
"marketingEmail": true,
"marketingKakao": true
}고객 API
고객 수정
고객 정보를 수정할 때 호출합니다. 파라미터로 전달된 정보로 고객 정보가 치환됩니다.
PUT
/
api
/
v1
/
customers
/
{id}
고객 수정
curl --request PUT \
--url https://api.steppay.kr/api/v1/customers/{id} \
--header 'Content-Type: application/json' \
--header 'Secret-Token: <api-key>' \
--data '
{
"name": "고객 수정",
"email": "test_modify@gmail.com",
"phone": "010-1234-1234"
}
'import requests
url = "https://api.steppay.kr/api/v1/customers/{id}"
payload = {
"name": "고객 수정",
"email": "test_modify@gmail.com",
"phone": "010-1234-1234"
}
headers = {
"Secret-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Secret-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '고객 수정', email: 'test_modify@gmail.com', phone: '010-1234-1234'})
};
fetch('https://api.steppay.kr/api/v1/customers/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '고객 수정',
'email' => 'test_modify@gmail.com',
'phone' => '010-1234-1234'
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"고객 수정\",\n \"email\": \"test_modify@gmail.com\",\n \"phone\": \"010-1234-1234\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.steppay.kr/api/v1/customers/{id}")
.header("Secret-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"고객 수정\",\n \"email\": \"test_modify@gmail.com\",\n \"phone\": \"010-1234-1234\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.steppay.kr/api/v1/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Secret-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"고객 수정\",\n \"email\": \"test_modify@gmail.com\",\n \"phone\": \"010-1234-1234\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"username": "test@gmail.com",
"name": "고객 수정",
"email": "test_modify@gmail.com",
"phone": "01012341234",
"code": null,
"marketingSms": null,
"marketingEmail": null,
"marketingKakao": null,
"createdAt": "9999-01-01T00:00:00"
}{
"errorCode": "<string>",
"traceId": "<string>",
"errorMessage": "<string>",
"details": {}
}{
"id": 123,
"username": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"code": "<string>",
"marketingSms": true,
"marketingEmail": true,
"marketingKakao": true
}Authorizations
Path Parameters
수정할 고객 번호
Body
application/json
고객 수정 데이터
이름
이메일
전화번호
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