구독 정보 등록 API
curl --request POST \
--url https://api.steppay.kr/api/v1/cover/subscription \
--header 'Content-Type: application/json' \
--header 'Secret-Token: <api-key>' \
--data '
{
"customerId": 123,
"currentPeriodStart": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"recurringIntervalCount": 123,
"partnerSubscriptionId": "<string>",
"trialStart": "2023-11-07T05:31:56Z",
"trialEnd": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true,
"initialOrderId": 123,
"replaceIfExists": true
}
'import requests
url = "https://api.steppay.kr/api/v1/cover/subscription"
payload = {
"customerId": 123,
"currentPeriodStart": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"recurringIntervalCount": 123,
"partnerSubscriptionId": "<string>",
"trialStart": "2023-11-07T05:31:56Z",
"trialEnd": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": True,
"initialOrderId": 123,
"replaceIfExists": True
}
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({
customerId: 123,
currentPeriodStart: '2023-11-07T05:31:56Z',
currentPeriodEnd: '2023-11-07T05:31:56Z',
recurringIntervalCount: 123,
partnerSubscriptionId: '<string>',
trialStart: '2023-11-07T05:31:56Z',
trialEnd: '2023-11-07T05:31:56Z',
start: '2023-11-07T05:31:56Z',
canceledAt: '2023-11-07T05:31:56Z',
cancelAtPeriodEnd: true,
initialOrderId: 123,
replaceIfExists: true
})
};
fetch('https://api.steppay.kr/api/v1/cover/subscription', 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/cover/subscription",
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([
'customerId' => 123,
'currentPeriodStart' => '2023-11-07T05:31:56Z',
'currentPeriodEnd' => '2023-11-07T05:31:56Z',
'recurringIntervalCount' => 123,
'partnerSubscriptionId' => '<string>',
'trialStart' => '2023-11-07T05:31:56Z',
'trialEnd' => '2023-11-07T05:31:56Z',
'start' => '2023-11-07T05:31:56Z',
'canceledAt' => '2023-11-07T05:31:56Z',
'cancelAtPeriodEnd' => true,
'initialOrderId' => 123,
'replaceIfExists' => true
]),
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/cover/subscription"
payload := strings.NewReader("{\n \"customerId\": 123,\n \"currentPeriodStart\": \"2023-11-07T05:31:56Z\",\n \"currentPeriodEnd\": \"2023-11-07T05:31:56Z\",\n \"recurringIntervalCount\": 123,\n \"partnerSubscriptionId\": \"<string>\",\n \"trialStart\": \"2023-11-07T05:31:56Z\",\n \"trialEnd\": \"2023-11-07T05:31:56Z\",\n \"start\": \"2023-11-07T05:31:56Z\",\n \"canceledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelAtPeriodEnd\": true,\n \"initialOrderId\": 123,\n \"replaceIfExists\": true\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/cover/subscription")
.header("Secret-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": 123,\n \"currentPeriodStart\": \"2023-11-07T05:31:56Z\",\n \"currentPeriodEnd\": \"2023-11-07T05:31:56Z\",\n \"recurringIntervalCount\": 123,\n \"partnerSubscriptionId\": \"<string>\",\n \"trialStart\": \"2023-11-07T05:31:56Z\",\n \"trialEnd\": \"2023-11-07T05:31:56Z\",\n \"start\": \"2023-11-07T05:31:56Z\",\n \"canceledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelAtPeriodEnd\": true,\n \"initialOrderId\": 123,\n \"replaceIfExists\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.steppay.kr/api/v1/cover/subscription")
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 \"customerId\": 123,\n \"currentPeriodStart\": \"2023-11-07T05:31:56Z\",\n \"currentPeriodEnd\": \"2023-11-07T05:31:56Z\",\n \"recurringIntervalCount\": 123,\n \"partnerSubscriptionId\": \"<string>\",\n \"trialStart\": \"2023-11-07T05:31:56Z\",\n \"trialEnd\": \"2023-11-07T05:31:56Z\",\n \"start\": \"2023-11-07T05:31:56Z\",\n \"canceledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelAtPeriodEnd\": true,\n \"initialOrderId\": 123,\n \"replaceIfExists\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"customer": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"partnerCustomerId": "<string>"
},
"start": "2023-11-07T05:31:56Z",
"currentPeriodStart": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"renewalOrders": [
{
"id": 123,
"customer": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"partnerCustomerId": "<string>"
},
"amount": 123,
"amountReturned": 123,
"items": [
{
"quantity": 123,
"price": {
"id": 123,
"name": "<string>",
"partnerPriceId": "<string>",
"product": {
"id": 123,
"name": "<string>",
"partnerProductId": "<string>",
"featuredImageUrl": "<string>"
},
"price": 123,
"isRecurring": true,
"recurringIntervalCount": 123
}
}
],
"partnerOrderId": "<string>",
"canceledDate": "2023-11-07T05:31:56Z",
"paymentDate": "2023-11-07T05:31:56Z",
"idKey": "<string>",
"retryDate": "2023-11-07T05:31:56Z"
}
],
"partnerSubscriptionId": "<string>",
"recurringIntervalCount": 123,
"trialStart": "2023-11-07T05:31:56Z",
"trialEnd": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true,
"initialOrder": {
"id": 123,
"customer": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"partnerCustomerId": "<string>"
},
"amount": 123,
"amountReturned": 123,
"items": [
{
"quantity": 123,
"price": {
"id": 123,
"name": "<string>",
"partnerPriceId": "<string>",
"product": {
"id": 123,
"name": "<string>",
"partnerProductId": "<string>",
"featuredImageUrl": "<string>"
},
"price": 123,
"isRecurring": true,
"recurringIntervalCount": 123
}
}
],
"partnerOrderId": "<string>",
"canceledDate": "2023-11-07T05:31:56Z",
"paymentDate": "2023-11-07T05:31:56Z",
"idKey": "<string>",
"retryDate": "2023-11-07T05:31:56Z"
}
}{
"errorCode": "<string>",
"traceId": "<string>",
"errorMessage": "<string>",
"details": {}
}{
"errorCode": "<string>",
"traceId": "<string>",
"errorMessage": "<string>",
"details": {}
}커버 API
구독 정보 등록 API
구독 정보를 스텝커버에 등록할 때 사용합니다.
POST
/
api
/
v1
/
cover
/
subscription
구독 정보 등록 API
curl --request POST \
--url https://api.steppay.kr/api/v1/cover/subscription \
--header 'Content-Type: application/json' \
--header 'Secret-Token: <api-key>' \
--data '
{
"customerId": 123,
"currentPeriodStart": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"recurringIntervalCount": 123,
"partnerSubscriptionId": "<string>",
"trialStart": "2023-11-07T05:31:56Z",
"trialEnd": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true,
"initialOrderId": 123,
"replaceIfExists": true
}
'import requests
url = "https://api.steppay.kr/api/v1/cover/subscription"
payload = {
"customerId": 123,
"currentPeriodStart": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"recurringIntervalCount": 123,
"partnerSubscriptionId": "<string>",
"trialStart": "2023-11-07T05:31:56Z",
"trialEnd": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": True,
"initialOrderId": 123,
"replaceIfExists": True
}
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({
customerId: 123,
currentPeriodStart: '2023-11-07T05:31:56Z',
currentPeriodEnd: '2023-11-07T05:31:56Z',
recurringIntervalCount: 123,
partnerSubscriptionId: '<string>',
trialStart: '2023-11-07T05:31:56Z',
trialEnd: '2023-11-07T05:31:56Z',
start: '2023-11-07T05:31:56Z',
canceledAt: '2023-11-07T05:31:56Z',
cancelAtPeriodEnd: true,
initialOrderId: 123,
replaceIfExists: true
})
};
fetch('https://api.steppay.kr/api/v1/cover/subscription', 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/cover/subscription",
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([
'customerId' => 123,
'currentPeriodStart' => '2023-11-07T05:31:56Z',
'currentPeriodEnd' => '2023-11-07T05:31:56Z',
'recurringIntervalCount' => 123,
'partnerSubscriptionId' => '<string>',
'trialStart' => '2023-11-07T05:31:56Z',
'trialEnd' => '2023-11-07T05:31:56Z',
'start' => '2023-11-07T05:31:56Z',
'canceledAt' => '2023-11-07T05:31:56Z',
'cancelAtPeriodEnd' => true,
'initialOrderId' => 123,
'replaceIfExists' => true
]),
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/cover/subscription"
payload := strings.NewReader("{\n \"customerId\": 123,\n \"currentPeriodStart\": \"2023-11-07T05:31:56Z\",\n \"currentPeriodEnd\": \"2023-11-07T05:31:56Z\",\n \"recurringIntervalCount\": 123,\n \"partnerSubscriptionId\": \"<string>\",\n \"trialStart\": \"2023-11-07T05:31:56Z\",\n \"trialEnd\": \"2023-11-07T05:31:56Z\",\n \"start\": \"2023-11-07T05:31:56Z\",\n \"canceledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelAtPeriodEnd\": true,\n \"initialOrderId\": 123,\n \"replaceIfExists\": true\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/cover/subscription")
.header("Secret-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": 123,\n \"currentPeriodStart\": \"2023-11-07T05:31:56Z\",\n \"currentPeriodEnd\": \"2023-11-07T05:31:56Z\",\n \"recurringIntervalCount\": 123,\n \"partnerSubscriptionId\": \"<string>\",\n \"trialStart\": \"2023-11-07T05:31:56Z\",\n \"trialEnd\": \"2023-11-07T05:31:56Z\",\n \"start\": \"2023-11-07T05:31:56Z\",\n \"canceledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelAtPeriodEnd\": true,\n \"initialOrderId\": 123,\n \"replaceIfExists\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.steppay.kr/api/v1/cover/subscription")
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 \"customerId\": 123,\n \"currentPeriodStart\": \"2023-11-07T05:31:56Z\",\n \"currentPeriodEnd\": \"2023-11-07T05:31:56Z\",\n \"recurringIntervalCount\": 123,\n \"partnerSubscriptionId\": \"<string>\",\n \"trialStart\": \"2023-11-07T05:31:56Z\",\n \"trialEnd\": \"2023-11-07T05:31:56Z\",\n \"start\": \"2023-11-07T05:31:56Z\",\n \"canceledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelAtPeriodEnd\": true,\n \"initialOrderId\": 123,\n \"replaceIfExists\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"customer": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"partnerCustomerId": "<string>"
},
"start": "2023-11-07T05:31:56Z",
"currentPeriodStart": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"renewalOrders": [
{
"id": 123,
"customer": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"partnerCustomerId": "<string>"
},
"amount": 123,
"amountReturned": 123,
"items": [
{
"quantity": 123,
"price": {
"id": 123,
"name": "<string>",
"partnerPriceId": "<string>",
"product": {
"id": 123,
"name": "<string>",
"partnerProductId": "<string>",
"featuredImageUrl": "<string>"
},
"price": 123,
"isRecurring": true,
"recurringIntervalCount": 123
}
}
],
"partnerOrderId": "<string>",
"canceledDate": "2023-11-07T05:31:56Z",
"paymentDate": "2023-11-07T05:31:56Z",
"idKey": "<string>",
"retryDate": "2023-11-07T05:31:56Z"
}
],
"partnerSubscriptionId": "<string>",
"recurringIntervalCount": 123,
"trialStart": "2023-11-07T05:31:56Z",
"trialEnd": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true,
"initialOrder": {
"id": 123,
"customer": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"partnerCustomerId": "<string>"
},
"amount": 123,
"amountReturned": 123,
"items": [
{
"quantity": 123,
"price": {
"id": 123,
"name": "<string>",
"partnerPriceId": "<string>",
"product": {
"id": 123,
"name": "<string>",
"partnerProductId": "<string>",
"featuredImageUrl": "<string>"
},
"price": 123,
"isRecurring": true,
"recurringIntervalCount": 123
}
}
],
"partnerOrderId": "<string>",
"canceledDate": "2023-11-07T05:31:56Z",
"paymentDate": "2023-11-07T05:31:56Z",
"idKey": "<string>",
"retryDate": "2023-11-07T05:31:56Z"
}
}{
"errorCode": "<string>",
"traceId": "<string>",
"errorMessage": "<string>",
"details": {}
}{
"errorCode": "<string>",
"traceId": "<string>",
"errorMessage": "<string>",
"details": {}
}Authorizations
Body
application/json
구독 생성 데이터
고객 ID
현재 주기의 시작 시점
현재 주기의 종료 시점
구독 주기
구독 주기 단위
Available options:
DAY, WEEK, MONTH, YEAR 가맹점에서 사용하는 구독의 unique ID
체험기간 시작 시점
체험기간 종료 시점
구독 시작 시점
취소 시점
이번 주기가 마지막인지 여부 - 이번 주기 후 만료될 경우 true 입력
구독이 시작되는 최초 주문의 ID
partnerSubscriptionId 이미 존재할 때 replaceIfExists가 true 이면 값을 수정하고, false 이면 exception 이 발생합니다.
Response
구독 정보가 정상적으로 등록됨
구독 ID - 다른 API 호출에 사용되므로 해당 구독 정보와 함께 저장해놓고 사용하세요.
고객 정보
Show child attributes
Show child attributes
구독 시작 시점
현재 주기의 시작 시점
현재 주기의 종료 시점
구독 상태
Available options:
ACTIVE, CANCELED, UNPAID, PAUSE, EXPIRED 구독과 연관된 갱신 주문 정보
Show child attributes
Show child attributes
가맹점에서 사용하는 구독의 unique ID
구독 주기
구독 주기 단위
Available options:
DAY, WEEK, MONTH, YEAR 체험기간 시작 시점
체험기간 종료 시점
취소 시점
이번 주기가 마지막인지 여부 - 이번 주기 후 만료될 경우 true
구독과 연관된 갱신 주문 정보
Show child attributes
Show child attributes
⌘I