콘텐츠로 건너뛰기

개요

  • 버전: 2.0
  • 서버: https://api.xsolla.com/merchant/v2/

본 API 참조는 정기 결제, 쿠폰 및 프로모션 관리 엔드포인트에 관하여 기술하고 있습니다. 정기 결제에 대한 더 자세한 내용은 제품 가이드용어집을 참조하십시오.

OpenAPI 설명 다운로드
언어
서버
Mock server
https://xsolla.redocly.app/_mock/ko/api/subscriptions/
작업
작업
작업

요청

Gets a specific subscription details by ID.

보안
basicAuth
경로
project_idinteger필수

Project ID.

subscription_idinteger필수

Subscription ID.

curl -i -X GET \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/ko/api/subscriptions/projects/{project_id}/subscriptions/{subscription_id}'

응답

OK(확인).

본문application/json
charge_amountnumber(float)

Billing amount.

commentstring

정기 결제 상태를 변경하는 이유

currencystring

구매 통화입니다. ISO 4217에 따른 3자리 통화 코드입니다.

date_createstring(datetime)

ISO 8601에 따라 YYYY-MM-DD’T’HH:MM:SS 형식으로 되어 있는 정기 결제 생성 날짜입니다.

date_endstring(datetime)

ISO 8601에 따라 YYYY-MM-DD’T’HH:MM:SS 형식으로 되어 있는 정기 결제 종료 날짜입니다.

date_last_chargestring or null(datetime)

ISO 8601에 따라 YYYY-MM-DD’T’HH:MM:SS 형식으로 되어 있는 마지막 정기 결제 요금 청구 날짜입니다.

date_next_chargestring or null(datetime)

ISO 8601에 따라 YYYY-MM-DD’T’HH:MM:SS 형식으로 되어 있는 다음 정기 결제 요금 청구 날짜입니다.

idinteger

정기 결제 ID

planobject
productobject or null
statusstring

상태

열거형"new""active""canceled""non_renewing""freeze"
userobject
응답
application/json
{ "charge_amount": 0.03, "comment": "The subscription was not extended in due time", "currency": "USD", "date_create": "2018-09-21T16:54:59+03:00", "date_end": "2019-02-06T12:43:04+03:00", "date_last_charge": "2018-09-21T16:55:05+03:00", "date_next_charge": "2018-09-21T16:55:05+03:00", "id": 249579, "plan": { "external_id": "lowcost", "id": 601 }, "product": { "id": 123456 }, "status": "canceled", "user": { "id": "user1", "name": "John Smith" } }

요청

상태를 변경(active, canceled, 혹은 non_renewing)하거나 다음 청구 날짜를 연기하여 정기 결제를 업데이트합니다.

보안
basicAuth
경로
project_idinteger필수

Project ID.

user_idstring필수

User ID.

subscription_idinteger필수

Subscription ID.

본문application/json필수
cancel_subscription_paymentboolean

true로 설정하면 본 정기 결제 최종 결제 금액이 환불됩니다. 이 옵션은 상태가 canceled로 설정된 경우에만 작동합니다.

statusstring

Status.

열거형"active""canceled""non_renewing"
timeshiftobject

Billing postponement.

xsolla_networkobject
curl -i -X PUT \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/ko/api/subscriptions/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}' \
  -H 'Content-Type: application/json' \
  -d '{
    "status": "active"
  }'

응답

OK(확인).

본문application/json
응답
application/json
{ "charge_amount": 0.03, "currency": "USD", "date_create": "2018-09-21T16:54:59+03:00", "date_end": null, "date_last_charge": "2018-09-21T16:55:05+03:00", "date_next_charge": "2018-09-21T16:55:05+03:00", "id": 24953579, "plan": { "billing_retry": {}, "charge": {}, "description": null, "expiration": {}, "external_id": "lowcost", "grace_period": {}, "group_id": "newPlans", "id": 66001, "localized_name": null, "name": null, "project_id": 18404, "refund_period": null, "status": {}, "tags": null, "trial": {}, "type": "all" }, "product": null, "status": "active", "user": { "id": "jb1", "name": "J.Black" } }
작업
작업
작업
작업