콘텐츠로 건너뛰기

개요

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

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

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

요청

임의의 사용자 매개 변수로 토큰을 생성할 수 있습니다. 토큰을 받을 때 이러한 매개 변수를 보내고 성공적인 결제 후에 다시 받습니다. 토큰은 이 문서에 설명되어 있거나 사용자가 미리 정의한 매개 변수만 포함할 수 있습니다.

매개 변수가 잘못된 형식으로 전송되거나 잘못된 유형인 경우 토큰이 발급되지 않습니다. JSON 본문에 오류 설명이 포함된 422 HTTP 코드를 받게 됩니다. extended_message에서 정확히 어떤 매개 변수가 잘못 전송되었는지에 대한 정보를 받게 됩니다.

주의

이 API 호출에는 project_id 경로 매개 변수가 포함되어 있지 않으므로 회사의 모든 프로젝트에서 유효한 API 키를 사용하여 인증을 설정해야 합니다.

보안
basicAuth
경로
merchant_idinteger필수

판매자 ID입니다.

본문application/json필수
custom_parametersobject

custom_parameters 개체의 토큰에서 추가 매개 변수를 전달하여 부정 결제 방지 필터를 구성하세요. 권장 매개 변수는 드롭다운 목록에 표시됩니다. 페이 스테이션 설명서 를 참조하십시오.

custom_parameters.​active_datestring

ISO 8601에 따른 마지막 확인 날짜입니다.

custom_parameters.​additional_verificationboolean

Whether the player uses account verification procedures.

custom_parameters.​character_customizedboolean

Whether the player has customized their character.

custom_parameters.​chat_activityboolean

Whether the player uses the chat function.

custom_parameters.​completed_tasksinteger

Number of tasks/objectives completed.

custom_parameters.​forum_activityboolean

Whether the player uses the forum function.

custom_parameters.​items_usedboolean

Whether the player uses purchased in-game items.

custom_parameters.​karma_pointsinteger

Player’s karma.

custom_parameters.​last_change_password_datestring

ISO 8601에 따른 마지막 암호 변경 날짜입니다.

custom_parameters.​non_premium_currencyinteger(float)

Amount of non-premium currency.

custom_parameters.​notifications_enabledboolean

Whether the player enabled notifications.

custom_parameters.​profile_completedboolean

Whether the player added additional information to their profile.

custom_parameters.​profile_image_addedboolean

Whether the player has uploaded a profile image.

custom_parameters.​pvp_activityboolean

Whether the player takes part in PvP battles.

custom_parameters.​registration_datestring

ISO 8601에 따른 계정 생성일입니다.

custom_parameters.​session_timestring

ISO 8601에 따른 평균 세션 시간입니다.

custom_parameters.​social_networks_addedboolean

Whether the player has connected social media profiles.

custom_parameters.​total_bansinteger

Number of times the player was banned in the chat/forum.

custom_parameters.​total_charactersinteger

Number of in-game characters.

custom_parameters.​total_clansinteger

Number of clans the player is a member of.

custom_parameters.​total_friendsinteger

Number of friends.

custom_parameters.​total_game_eventsinteger

Number of in-game events the player took part in.

custom_parameters.​total_giftsinteger

Number of in-game gifts the player has sent/received.

custom_parameters.​total_hoursinteger

Total number of in-game hours.

custom_parameters.​total_inventory_valueinteger(float)

Total inventory value (in-game currency).

custom_parameters.​total_suminteger(float)

Total amount of payments.

custom_parameters.​tutorial_completedboolean

Whether the player has completed the game’s tutorial.

custom_parameters.​unlocked_achievementsinteger

Number of achievements unlocked.

custom_parameters.​user_levelinteger

Player’s level, reputation, or rank.

custom_parameters.​win_rateinteger

Win rate.

purchaseobject

구매 데이터 관련 값입니다.

예제: {"checkout":{"amount":10,"currency":"USD"},"subscription":{"gift":{"email":"recipient_email@email.com","recipient":"test_recipient_v1"}}}
purchase.​checkoutobject

Object containing checkout details.

예제: {"amount":10,"currency":"USD"}
purchase.​checkout.​amountinteger(float)

구매 금액입니다.

예제: 10
purchase.​checkout.​currencystring

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

예제: "USD"
purchase.​subscriptionobject

정기 결제 데이터 관련 값입니다.

예제: {"gift":{"email":"recipient_email@email.com","recipient":"test_recipient_v1"}}
purchase.​subscription.​available_plansArray of strings

결제 UI에 표시되는 정기 결제 요금제입니다.

purchase.​subscription.​currencystring

Currency of the subscription plan to use in all calculations.

purchase.​subscription.​giftobject

정기 결제 선물 세부 정보입니다.

예제: {"email":"recipient_email@email.com","recipient":"test_recipient_v1"}
purchase.​subscription.​gift.​anonymousboolean

선물한 사람의 이름을 숨길지 여부입니다. true인 경우 이메일 알림에서 발신자 이름이 숨겨집니다. 기본값은 false입니다.

purchase.​subscription.​gift.​emailstring필수

수신자 이메일입니다.

예제: "recipient_email@email.com"
purchase.​subscription.​gift.​messagestring

수신자에게 표시되는 메시지입니다.

purchase.​subscription.​gift.​recipientstring필수

수신자의 ID입니다.

예제: "test_recipient_v1"
purchase.​subscription.​gift.​redirect_urlstring

정기 결제 선물에 대한 추가 정보가 있는 페이지 또는 계정 생성 페이지로 연결되는 링크를 여기에 입력합니다. 선물 받는 사람은 정기 결제 선물 이메일 알림에서 이 페이지로 이동할 수 있습니다.

purchase.​subscription.​operationstring

사용자의 정기 결제 요금제에 적용되는 작업 유형입니다. 정기 결제 요금제을 변경하려면 change_plan 값을 전달합니다. purchase.subscription.plan_id 매개 변수에서 새 요금제 ID를 지정해야 합니다.

purchase.​subscription.​plan_idstring

정기 결제 요금제 외부 ID입니다. 관리자 페이지의 정기 결제 > 정기 결제 요금제 섹션에서 확인할 수 있습니다.

purchase.​subscription.​product_idstring

Product ID.

purchase.​subscription.​trial_daysinteger

평가 기간(일)입니다.

settingsobject

사용자 지정 프로젝트 설정과 관련된 값입니다.

예제: {"currency":"USD","language":"en","project_id":16184,"ui":{"components":{"virtual_currency":{"custom_amount":true}},"desktop":{"virtual_item_list":{"button_with_price":true,"layout":"list"}},"size":"medium"}}
settings.​currencystring

선호하는 결제 통화입니다. ISO 4217에 따른 3자릿수 통화 코드입니다.

예제: "USD"
settings.​external_idstring

게임의 트랜잭션 ID입니다. 각 사용자 결제마다 고유해야 합니다.

settings.​languagestring

인터페이스 언어입니다. 두 자릿수 소문자 언어 코드입니다.

예제: "en"
settings.​modestring

결제 프로세스를 테스트하기 위한 sandbox 값을 설정합니다. 이 경우 https://sandbox-secure.xsolla.com을 사용하여 테스트 결제 UI에 액세스합니다.

settings.​payment_methodinteger

결제 수단의 ID입니다.

settings.​payment_widgetstring

결제 위젯입니다. 'paybycash' 혹은 'giftcard'일 수 있습니다. 매개 변수가 설정되면, 사용자는 각각 페이바이캐쉬(Pay by Cash) 혹은 기프트 카드(Gift Cards) 위젯으로 리디렉션됩니다.

열거형"paybycash""giftcard"
settings.​project_idinteger필수

Game’s Xsolla ID. Can be found in Publisher Account.

예제: 16184
settings.​redirect_policyobject

정책 설정을 리디렉션합니다.

settings.​redirect_policy.​autoredirect_from_status_pageboolean

상태 페이지에서 자동 리디렉션 여부입니다.

settings.​redirect_policy.​delayinteger

사용자가 자동으로 복귀 URL로 리디렉션된 이후 지연 시간(초)입니다.

settings.​redirect_policy.​manual_redirection_actionstring

페이 스테이션 동작은 닫기 버튼 또는 게임으로 돌아가기 버튼을 사용자가 클릭하면 트리거됩니다. redirect(기본값) 및 postmessage일 수 있습니다. redirect로 설정된 경우 사용자는 토큰에서 전달되었거나 관리자 페이지에서 지정된 URL로 리디렉션됩니다. postmessage로 설정된 경우 사용자는 다른 페이지로 리디렉션되지 않습니다. 닫기 아이콘을 클릭하면 close 이벤트 전송이 시작되고 게임으로 돌아가기 버튼을 클릭하면 return 이벤트 전송이 시작됩니다.

열거형"redirect""postmessage"
settings.​redirect_policy.​redirect_button_captionstring

수동 리디렉션을 위한 버튼 텍스트입니다.

settings.​redirect_policy.​redirect_conditionsstring

사용자가 복귀 URL로 리디렉션되는 결제 상태입니다. 이는 none, successful, successful_or_canсeled, 혹은 any일 수 있습니다.

열거형"none""successful""successful_or_canceled""any"
settings.​redirect_policy.​status_for_manual_redirectionstring

사용자를 복귀 URL로 리디렉션하는 버튼이 표시되는 결제 상태입니다. 이는 none, successful, successful_or_canсeled, 혹은 any일 수 있습니다.

열거형"none""successful""successful_or_canceled""any"
settings.​return_urlstring

사용자를 결제 이후로 리디렉션하는 페이지입니다. 매개 변수 user_id, foreigninvoice, invoice_idstatus는 자동으로 링크에 추가됩니다.

settings.​uiobject

인터페이스 설정과 관련된 값입니다.

예제: {"components":{"virtual_currency":{"custom_amount":true}},"desktop":{"virtual_item_list":{"button_with_price":true,"layout":"list"}},"size":"medium"}
settings.​ui.​componentsobject

메뉴 설정과 관련된 값입니다.

예제: {"virtual_currency":{"custom_amount":true}}
settings.​ui.​components.​subscriptionsobject

정기 결제 요금제 하위 메뉴 설정과 관련된 값입니다.

settings.​ui.​components.​subscriptions.​hiddenboolean

Whether to show the submenu.

settings.​ui.​components.​subscriptions.​orderinteger

Position of the submenu in the menu.

settings.​ui.​components.​virtual_currencyobject

인게임 재화 하위 메뉴 설정과 관련된 값입니다.

예제: {"custom_amount":true}
settings.​ui.​components.​virtual_currency.​custom_amountboolean

Whether the user can enter an arbitrary quantity of the virtual currency in the payment UI.

예제: true
settings.​ui.​components.​virtual_currency.​hiddenboolean

Whether to show the submenu.

settings.​ui.​components.​virtual_currency.​orderinteger

Position of the submenu in the menu.

settings.​ui.​components.​virtual_itemsobject

가상 아이템 하위 메뉴 설정과 관련된 값입니다.

settings.​ui.​components.​virtual_items.​hiddenboolean

Whether to show the submenu.

settings.​ui.​components.​virtual_items.​orderinteger

Position of the submenu in the menu.

settings.​ui.​components.​virtual_items.​selected_groupstring

Group to show after opening the virtual items tab.

settings.​ui.​components.​virtual_items.​selected_itemstring

Item to show after opening the virtual items tab (item SKU).

settings.​ui.​desktopobject

PC 버전의 인터페이스 설정과 관련된 값입니다.

예제: {"virtual_item_list":{"button_with_price":true,"layout":"list"}}
settings.​ui.​desktop.​headerobject

헤더 설정과 관련된 값입니다.

settings.​ui.​desktop.​header.​close_buttonboolean

페이 스테이션 데스크탑에서 닫기 버튼을 표시할지 여부입니다. 이 버튼을 누르면 페이 스테이션이 종료되고settings.return_url 매개 변수에 지정된 URL로 사용자를 리디렉션합니다(기본값: false).

settings.​ui.​desktop.​header.​is_visibleboolean

Whether to show the header in the payment UI.

settings.​ui.​desktop.​header.​typestring

헤더를 표시하는 설정 방식입니다. compact(프로젝트 이름 및 사용자 ID 표시 안 함) 또는 normal(기본값)을 설정할 수 있습니다.

열거형"compact""normal"
settings.​ui.​desktop.​header.​visible_logoboolean

true인 경우, 로고가 헤더에 표시됩니다(먼저 고객 성공 관리자에게 이미지를 제공하세요).

settings.​ui.​desktop.​header.​visible_nameboolean

Whether to show the project name in the header.

settings.​ui.​desktop.​header.​visible_purchaseboolean

구매 설명(purchase.description.value)이 헤더에 표시되는지 여부입니다. 기본값은 true입니다.

settings.​ui.​desktop.​subscription_listobject

정기 결제 요금제 목록 설정과 관련된 값입니다.

settings.​ui.​desktop.​subscription_list.​descriptionstring

Any text to show above the list of available subscription plans in the payment UI.

settings.​ui.​desktop.​subscription_list.​display_local_priceboolean

true인 경우 및 사용자의 현지 통화가 정기 결제 요금제의 통화와 다른 경우, 사용자는 현지 통화의 가격 및 기본 통화의 가격 등 두 가지 가격을 볼 수 있습니다.

settings.​ui.​desktop.​subscription_list.​layoutstring

정기 결제 목록 패턴입니다. list(기본값) 또는 grid일 수 있습니다.

열거형"list""grid"
settings.​ui.​desktop.​virtual_currency_listobject

인게임 재화 목록 설정과 관련된 값입니다.

settings.​ui.​desktop.​virtual_currency_list.​button_with_priceboolean

true인 경우, 가격이 버튼에 표시됩니다. false인 경우, 가격이 버튼 왼쪽에 표시됩니다. 기본값은 false입니다.

settings.​ui.​desktop.​virtual_currency_list.​descriptionstring

Any text to show above the list of virtual currencies.

settings.​ui.​desktop.​virtual_item_listobject

가상 아이템 목록 설정과 관련된 값입니다.

예제: {"button_with_price":true,"layout":"list"}
settings.​ui.​desktop.​virtual_item_list.​button_with_priceboolean

true인 경우, 가격이 버튼에 표시됩니다. false인 경우, 가격이 버튼 왼쪽에 표시됩니다. 기본값은 false입니다.

예제: true
settings.​ui.​desktop.​virtual_item_list.​layoutstring

정기 결제 목록 패턴입니다. list(기본값) 또는 grid일 수 있습니다.

열거형"list""grid"
예제: "list"
settings.​ui.​desktop.​virtual_item_list.​viewstring

가상 아이템 그룹을 세로/가로 보기 메뉴로 표시합니다. horizontal_navigation 또는 vertical_navigation(기본값)일 수 있습니다.

열거형"horizontal_navigation""vertical_navigation"
settings.​ui.​headerobject
settings.​ui.​header.​visible_virtual_currency_balanceboolean

결제 UI에서 이 요소를 숨길 수 있는지 여부입니다. 기본값은 true입니다.

settings.​ui.​is_prevent_external_link_openboolean

외부 리소스에 대한 리디렉션 링크가 비활성화되었는지 여부입니다. true가 기본값입니다. 외부 링크를 클릭하면external-link-open이벤트가 postMessage 메커니즘을 통해 전송됩니다. 리디렉션 링크용 주소는url 매개 변수에서 전달됩니다.

settings.​ui.​license_urlstring

EULA의 링크입니다.

settings.​ui.​mobileobject
settings.​ui.​mobile.​footerobject
settings.​ui.​mobile.​footer.​is_visibleboolean

모바일 버전의 결제 UI에서 바닥글을 표시하거나 숨길지 여부입니다.

settings.​ui.​mobile.​headerobject
settings.​ui.​mobile.​header.​close_buttonboolean

페이 스테이션 모바일에서 닫기 버튼을 표시할지 여부입니다. 이 버튼을 누르면 페이 스테이션이 종료되고 settings.return_url 매개 변수에 지정된 URL로 사용자를 리디렉션합니다(기본값: false).

settings.​ui.​mobile.​modestring

사용자는 저장된 결제 방식을 통해서만 결제를 할 수 있습니다. saved_accounts일 수 있습니다.

"saved_accounts"
settings.​ui.​modestring

페이 스테이션의 인터페이스 모드입니다. user_account만 가능합니다. 헤더는 계정 탐색 메뉴만 포함하고 사용자는 제품을 선택하거나 결제를 진행할 수 없습니다. 이 모드는 데스크탑에서만 사용할 수 있습니다.

settings.​ui.​sizestring

결제 UI의 크기입니다. 이 매개 변수는 결제 UI의 필요한 크기에 따라 값이 다음과 같을 수 있습니다.

  • small: 결제 UI의 가능한 최소 크기입니다. 창 크기가 엄격히 제한되는 경우 이 값을 사용합니다. (크기: 620 x 630)
  • medium: 결제 UI의 권장 크기입니다. 이 값을 사용하여 라이트박스에 결제 UI를 표시합니다. (크기: 740 x 760)
  • large: 새 창 또는 탭에 결제 UI 표시를 위한 최적의 크기입니다. (크기: 820 x 840)
열거형"small""medium""large"
예제: "medium"
settings.​ui.​themestring

결제 UI의 모양 테마입니다. default(기본값) 또는 default_dark일 수 있습니다.

열거형"default""default_dark"
settings.​ui.​user_accountobject

사용자 계정 세부 정보입니다.

settings.​ui.​user_account.​historyobject

기록 하위 메뉴입니다.

settings.​ui.​user_account.​history.​enableboolean

하위 메뉴를 표시할지 여부입니다. 기본값은 false입니다.

settings.​ui.​user_account.​history.​orderinteger

Position of the submenu in the menu.

settings.​ui.​user_account.​infoobject

내 계정 페이지입니다.

settings.​ui.​user_account.​info.​enableboolean

하위 메뉴를 표시할지 여부입니다. 기본값은 false입니다.

settings.​ui.​user_account.​info.​orderinteger

Position of the submenu in the menu.

settings.​ui.​user_account.​payment_accountsobject

내 결제 계정 하위 메뉴입니다.

settings.​ui.​user_account.​payment_accounts.​enableboolean

하위 메뉴를 표시할지 여부입니다. 기본값은 false입니다.

settings.​ui.​user_account.​payment_accounts.​orderinteger

Position of the submenu in the menu.

settings.​ui.​user_account.​subscriptionsobject

정기 결제 관리 하위 메뉴입니다.

settings.​ui.​user_account.​subscriptions.​enableboolean

하위 메뉴를 표시할지 여부입니다. 기본값은 false입니다.

settings.​ui.​user_account.​subscriptions.​orderinteger

Position of the submenu in the menu.

settings.​ui.​versionstring

장치 유형입니다. desktop(기본값) 또는 mobile일 수 있습니다.

열거형"desktop""mobile"
userobject

사용자의 세부 정보입니다.

예제: {"age":19,"country":{"allow_modify":true,"value":"US"},"email":{"value":"john.smith@mail.com"},"id":{"value":"user_2"},"name":{"value":"John Smith"}}
user.​ageinteger

사용자 나이입니다.

예제: 19
user.​attributesobject

User attributes for filtering the item list, represented as a valid JSON set of key-value pairs.

user.​countryobject
예제: {"allow_modify":true,"value":"US"}
user.​country.​allow_modifyboolean

결제 UI에서 사용자의 국가 변경 가능 여부입니다. country.value가 토큰에서 전달되면 기본값은 false입니다.

예제: true
user.​country.​valuestring

ISO 3166-1 alpha-2 standard에 따른 두 자릿수 국가 코드입니다.

예제: "US"
user.​emailobject

user.email 개체는 부정 결제 방지 모델 만들기의 정수 부분이며 수락률을 높여줍니다. 해당 개체는 엑솔라와 결제 시스템 양쪽 모두의 요구 사항입니다. 매개 변수가 전달되지 않으면 이메일 입력용 필수 필드가 결제 페이지에 나타납니다. 사용자는 매개 변수에서 전달되었거나 결제 페이지에 입력된 이메일로 구매 영수증을 받습니다.

예제: {"value":"john.smith@mail.com"}
user.​email.​valuestring필수

사용자 이메일입니다. RFC 822 프로토콜에 따라 유효해야 합니다.

예제: "john.smith@mail.com"
user.​idobject필수
예제: {"value":"user_2"}
user.​id.​valuestring필수

User ID.

예제: "user_2"
user.​is_legalboolean

Whether the user is a legal entity.

user.​legalobject

법인 세부 정보가 있는 개체입니다.

user.​legal.​addressstring

Full legal address.

user.​legal.​countrystring

기업이 속한 국가입니다. ISO 3166-1 alpha-2에 따른 두 자릿수 대문자 국가 코드입니다.

user.​legal.​namestring

Full legal name.

user.​legal.​vat_idstring

Individual taxpayer identifier.

user.​nameobject
예제: {"value":"John Smith"}
user.​name.​valuestring

User screen name.

예제: "John Smith"
user.​phoneobject
user.​phone.​valuestring

User phone number.

user.​public_idobject
user.​public_id.​valuestring

Parameter that uniquely identifies the user and is known to the user (email, screen name, etc). Allows the user to make purchases outside the game store (e.g., via cash kiosks).

user.​steam_idobject
user.​steam_id.​valuestring

Steam ID입니다.

user.​tracking_idobject
user.​tracking_id.​valuestring

고유한 추적 ID(마케팅 캠페인에 사용됨)입니다.

user.​utmobject

트래픽 특성입니다.

user.​utm.​utm_campaignstring

Campaign title, transliterated or translated to English.

user.​utm.​utm_contentstring

Campaign content.

user.​utm.​utm_mediumstring

Traffic channel (contextual ads, media ads, email lists, etc.).

user.​utm.​utm_sourcestring

Traffic source.

user.​utm.​utm_termstring

캠페인 키워드입니다. 설정된 경우 특정 검색 질의보다 타켓 광고에 사용하는 키워드 데이터에 기반하여 통계가 만들어집니다. Google Analytics에서는 지정된 utm_term이 일반 검색 용어 보고서의 일부입니다.

curl -i -X POST \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/ko/api/subscriptions/merchants/{merchant_id}/token' \
  -H 'Content-Type: application/json' \
  -d '{
    "purchase": {
      "checkout": {
        "amount": 10,
        "currency": "USD"
      },
      "subscription": {
        "gift": {
          "email": "recipient_email@email.com",
          "recipient": "test_recipient_v1"
        }
      }
    },
    "settings": {
      "currency": "USD",
      "language": "en",
      "project_id": 16184,
      "ui": {
        "components": {
          "virtual_currency": {
            "custom_amount": true
          }
        },
        "desktop": {
          "virtual_item_list": {
            "button_with_price": true,
            "layout": "list"
          }
        },
        "size": "medium"
      }
    },
    "user": {
      "age": 19,
      "country": {
        "allow_modify": true,
        "value": "US"
      },
      "email": {
        "value": "john.smith@mail.com"
      },
      "id": {
        "value": "user_2"
      },
      "name": {
        "value": "John Smith"
      }
    }
  }'

응답

생성됨.

본문application/json
tokenstring
응답
application/json
{ "token": "eop57k1boA7nnYPtewZ6KEXJyJADEwRT" }
작업
작업
작업
작업
작업
작업
작업