Skip to main content
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,
  "recurringInterval": "DAY",
  "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
}
'
{
  "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",
  "status": "ACTIVE",
  "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,
            "recurringInterval": "DAY",
            "recurringIntervalCount": 123
          }
        }
      ],
      "status": "CREATED",
      "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,
  "recurringInterval": "DAY",
  "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,
          "recurringInterval": "DAY",
          "recurringIntervalCount": 123
        }
      }
    ],
    "status": "CREATED",
    "partnerOrderId": "<string>",
    "canceledDate": "2023-11-07T05:31:56Z",
    "paymentDate": "2023-11-07T05:31:56Z",
    "idKey": "<string>",
    "retryDate": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Secret-Token
string
header
required

Body

application/json

구독 생성 데이터

customerId
integer<int64>
required

고객 ID

currentPeriodStart
string<date-time>
required

현재 주기의 시작 시점

currentPeriodEnd
string<date-time>
required

현재 주기의 종료 시점

recurringIntervalCount
integer<int32>
required

구독 주기

recurringInterval
enum<string>
required

구독 주기 단위

Available options:
DAY,
WEEK,
MONTH,
YEAR
partnerSubscriptionId
string
required

가맹점에서 사용하는 구독의 unique ID

trialStart
string<date-time>

체험기간 시작 시점

trialEnd
string<date-time>

체험기간 종료 시점

start
string<date-time>

구독 시작 시점

canceledAt
string<date-time>

취소 시점

cancelAtPeriodEnd
boolean

이번 주기가 마지막인지 여부 - 이번 주기 후 만료될 경우 true 입력

initialOrderId
integer<int64>

구독이 시작되는 최초 주문의 ID

replaceIfExists
boolean

partnerSubscriptionId 이미 존재할 때 replaceIfExists가 true 이면 값을 수정하고, false 이면 exception 이 발생합니다.

Response

구독 정보가 정상적으로 등록됨

id
integer<int64>
required

구독 ID - 다른 API 호출에 사용되므로 해당 구독 정보와 함께 저장해놓고 사용하세요.

customer
object
required

고객 정보

start
string<date-time>
required

구독 시작 시점

currentPeriodStart
string<date-time>
required

현재 주기의 시작 시점

currentPeriodEnd
string<date-time>
required

현재 주기의 종료 시점

status
enum<string>
required

구독 상태

Available options:
ACTIVE,
CANCELED,
UNPAID,
PAUSE,
EXPIRED
renewalOrders
object[]
required

구독과 연관된 갱신 주문 정보

partnerSubscriptionId
string
required

가맹점에서 사용하는 구독의 unique ID

recurringIntervalCount
integer<int32>
required

구독 주기

recurringInterval
enum<string>
required

구독 주기 단위

Available options:
DAY,
WEEK,
MONTH,
YEAR
trialStart
string<date-time>

체험기간 시작 시점

trialEnd
string<date-time>

체험기간 종료 시점

canceledAt
string<date-time>

취소 시점

cancelAtPeriodEnd
boolean

이번 주기가 마지막인지 여부 - 이번 주기 후 만료될 경우 true

initialOrder
object

구독과 연관된 갱신 주문 정보