스토어 API v2.0

개요

본 섹션은 스토어 모듈을 사용하여 작업하는 방법을 설명합니다. API 방식을 가져오려면 Basic Authentication을 사용하십시오. 스토어 UI를 열고 안전한 결제를 활성화하려면 토큰을 가져와야 합니다.

Endpoint 경로: https://api.xsolla.com.

스토어 UI

스토어 열기

다음 링크를 사용하여 새 창에서 스토어 UI를 엽니다. https://secure.xsolla.com/paystation2/?access_token=ACCESS_TOKEN, 여기에서 ACCESS_TOKENAPI의해 입수한 토큰입니다.

테스트 목적을 위해 다음 URL을 사용하십시오. https://sandbox-secure.xsolla.com/paystation2/?access_token=ACCESS_TOKEN.

Notice: access_token 매개변수에 비공개 사용자 데이터가 포함되어 있습니다. 이 매개변수를 가져오는 경우 서버 간 통신을 사용해야 합니다.

테스트 카드 목록

샌드박스 내에서 모의 결제를 해 볼 수 있는 카드는 다음과 같습니다.

카드 3-D Secure
카드 번호: 4111111111111111
만료 날짜: 12/20
CVV2: 123
카드 유형: VISA
아니요
카드 번호: 5555555555554444
만료 날짜: 11/19
CVV2: 321
카드 유형: MasterCard
아니요
카드 번호: 4000000000000010
만료 날짜: 12/20
CVV2: 123
카드 유형: VISA
카드 번호: 5200000000000114
만료 날짜: 11/19
CVV2: 321
카드 유형: MasterCard
카드 번호: 6759649826438453
만료 날짜: 12/25
CVV2: 321
카드 유형: Maestro

또한, 다음 데이터를 사용해 트랜잭션 거부를 시뮬레이션해 볼 수 있습니다.

카드 3-D Secure 설명
카드 번호: 4000000000000002
만료 날짜: 12/20
CVV2: 123
카드 유형: VISA
아니요 불충분 한 자금
카드 번호: 5200000000000007
만료 날짜: 11/19
CVV2: 321
카드 유형: MasterCard
아니요 불충분 한 자금
카드 번호: 4000000000000036
만료 날짜: 12/20
CVV2: 123
카드 유형: VISA
거부 됨
카드 번호: 5200000000000031
만료 날짜: 11/19
CVV2: 321
카드 유형: MasterCard
거부 됨

오류 목록

코드 설명
0004-0001 만료되었거나 올바르지 않은 토큰.
0004-0008 잘못된 URL (secure.xsolla.com에서 샌드박스 모드 또는 샌드박스-secure.xsolla.com에서 라이브 모드로 접근을 시도함).
0002-0004 동의서에 서명하지 않음.
0004-0010 금지된 토큰리스 통합.
0010-0001 패키지를 찾지 못함.
0010-0003 패키지에 DRM이 설정되지 않음.
1000-0003 해당 프로젝트에 대하여 활성화된 모듈이 없음.

가상 머니

패키지 가져오기

프로젝트 게임머니 설정을 가져옵니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency

파라미터 Type 설명
project_id
integer 프로젝트 ID.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/virtual_currency/packages", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
[
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 500,
    "bonus": 40.002,
    "description": null,
    "enabled": true,
    "id": 377,
    "image_url": "//cdn.xsolla.net/img/misc/images/3dc83a77a205ca439fc9c4d7cba9ff68.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 299.99
      }
    ],
    "sku": null
  },
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 1000,
    "bonus": 40.101,
    "description": null,
    "enabled": true,
    "id": 349,
    "image_url": "//cdn.xsolla.net/img/misc/images/6582a0e94d87e88273574725f76c6609.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 598.99
      }
    ],
    "sku": null
  }
]
[
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 500,
    "bonus": 40.002,
    "description": null,
    "enabled": true,
    "id": 377,
    "image_url": "//cdn.xsolla.net/img/misc/images/3dc83a77a205ca439fc9c4d7cba9ff68.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 299.99
      }
    ],
    "sku": null
  },
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 1000,
    "bonus": 40.101,
    "description": null,
    "enabled": true,
    "id": 349,
    "image_url": "//cdn.xsolla.net/img/misc/images/6582a0e94d87e88273574725f76c6609.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 598.99
      }
    ],
    "sku": null
  }
]
[
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 500,
    "bonus": 40.002,
    "description": null,
    "enabled": true,
    "id": 377,
    "image_url": "//cdn.xsolla.net/img/misc/images/3dc83a77a205ca439fc9c4d7cba9ff68.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 299.99
      }
    ],
    "sku": null
  },
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 1000,
    "bonus": 40.101,
    "description": null,
    "enabled": true,
    "id": 349,
    "image_url": "//cdn.xsolla.net/img/misc/images/6582a0e94d87e88273574725f76c6609.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 598.99
      }
    ],
    "sku": null
  }
]
[
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 500,
    "bonus": 40.002,
    "description": null,
    "enabled": true,
    "id": 37743,
    "image_url": "//cdn.xsolla.net/img/misc/images/3dc83a77a205ca439fc9c4d7cba9ff68.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 299.99
      }
    ],
    "sku": null
  },
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 1000,
    "bonus": 40.101,
    "description": null,
    "enabled": true,
    "id": 37749,
    "image_url": "//cdn.xsolla.net/img/misc/images/6582a0e94d87e88273574725f76c6609.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 598.99
      }
    ],
    "sku": null
  }
]
[
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 500,
    "bonus": 40.002,
    "description": null,
    "enabled": true,
    "id": 377,
    "image_url": "//cdn.xsolla.net/img/misc/images/3dc83a77a205ca439fc9c4d7cba9ff68.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 299.99
      }
    ],
    "sku": null
  },
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 1000,
    "bonus": 40.101,
    "description": null,
    "enabled": true,
    "id": 349,
    "image_url": "//cdn.xsolla.net/img/misc/images/6582a0e94d87e88273574725f76c6609.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 598.99
      }
    ],
    "sku": null
  }
]
[
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 500,
    "bonus": 40.002,
    "description": null,
    "enabled": true,
    "id": 377,
    "image_url": "//cdn.xsolla.net/img/misc/images/3dc83a77a205ca439fc9c4d7cba9ff68.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 299.99
      }
    ],
    "sku": null
  },
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 1000,
    "bonus": 40.101,
    "description": null,
    "enabled": true,
    "id": 349,
    "image_url": "//cdn.xsolla.net/img/misc/images/6582a0e94d87e88273574725f76c6609.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 598.99
      }
    ],
    "sku": null
  }
]
[
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 500,
    "bonus": 40.002,
    "description": null,
    "enabled": true,
    "id": 377,
    "image_url": "//cdn.xsolla.net/img/misc/images/3dc83a77a205ca439fc9c4d7cba9ff68.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 299.99
      }
    ],
    "sku": null
  },
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 1000,
    "bonus": 40.101,
    "description": null,
    "enabled": true,
    "id": 349,
    "image_url": "//cdn.xsolla.net/img/misc/images/6582a0e94d87e88273574725f76c6609.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 598.99
      }
    ],
    "sku": null
  }
]
[
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 500,
    "bonus": 40.002,
    "description": null,
    "enabled": true,
    "id": 377,
    "image_url": "//cdn.xsolla.net/img/misc/images/3dc83a77a205ca439fc9c4d7cba9ff68.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 299.99
      }
    ],
    "sku": null
  },
  {
    "advertisement_type": null,
    "advertisement_type_custom": null,
    "amount": 1000,
    "bonus": 40.101,
    "description": null,
    "enabled": true,
    "id": 349,
    "image_url": "//cdn.xsolla.net/img/misc/images/6582a0e94d87e88273574725f76c6609.png",
    "label": null,
    "prices_array": [
      {
        "name": "RUB",
        "value": 598.99
      }
    ],
    "sku": null
  }
]

패키지 업데이트

프로젝트 게임머니 설정을 업데이트합니다.

HTTP 요청

PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency

파라미터 유형 설명
project_id
integer 프로젝트 ID.
vc_name
array of strings

제품 이름입니다. 값은 : 쌍으로 구성되어 있습니다.

base
array 기본 제품 통화의 Json 개체입니다. 여기서 키는 통화(ISO 4217)에 따라 통화의 3자 정의가 사용됨)이고 값은 해당 통화 금액입니다.
default_currency
string 기본 통화입니다.
min
float 최소 구매 금액입니다.
max
float 최대 구매 금액입니다.
is_currency_discrete
boolean 게임머니에 센트를 사용할 수 있는지 여부입니다.
allow_user_sum
boolean 패키지 간에 어느 금액이든지 지불하도록 허용되는지 여부입니다.
amount
float 패키지의 게임머니 금액입니다.
sku
string 게임머니 패키지의 고유한 ID입니다.
price
float 게임머니 패키지 가격입니다.
image_url
string 이미지의 URL입니다.
description
array of strings

지역화된 패키지 이름이 포함된 배열입니다. 값은 : 쌍으로 구성되어 있습니다.

label
array of strings

지역화된 패키지 레이블이 포함된 배열입니다. 값은 : 쌍으로 구성되어 있습니다.

bonus
float 패키지에 대한 할인율 금액입니다.
advertisement_type
string 게임머니 패키지에 대한 레이블 유형입니다. 'recommended', 'best_deal', 'special_offer' 또는 null일 수 있습니다.
enabled
boolean 게임머니 패키지가 사용되는지 여부입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages/{package_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "advertisement_type": null,
  "advertisement_type_custom": null,
  "amount": 1010,
  "bonus": 40.01,
  "description": null,
  "enabled": true,
  "image_url": "//cdn.xsolla.net/img/misc/images/e69ec3dee89b51237aa01a60b4374c23.png",
  "label": null,
  "prices_array": [
    {
      "name": "RUB",
      "value": 59.99
    }
  ],
  "sku": null
}
curl --request PUT \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages/{package_id} \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"advertisement_type":null,"advertisement_type_custom":null,"amount":1010,"bonus":40.01,"description":null,"enabled":true,"image_url":"//cdn.xsolla.net/img/misc/images/e69ec3dee89b51237aa01a60b4374c23.png","label":null,"prices_array":[{"name":"RUB","value":59.99}],"sku":null}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"advertisement_type":null,"advertisement_type_custom":null,"amount":1010,"bonus":40.01,"description":null,"enabled":true,"image_url":"//cdn.xsolla.net/img/misc/images/e69ec3dee89b51237aa01a60b4374c23.png","label":null,"prices_array":[{"name":"RUB","value":59.99}],"sku":null}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages/{package_id}');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages/{package_id}");
var request = new RestRequest(Method.PUT);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"advertisement_type\":null,\"advertisement_type_custom\":null,\"amount\":1010,\"bonus\":40.01,\"description\":null,\"enabled\":true,\"image_url\":\"//cdn.xsolla.net/img/misc/images/e69ec3dee89b51237aa01a60b4374c23.png\",\"label\":null,\"prices_array\":[{\"name\":\"RUB\",\"value\":59.99}],\"sku\":null}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"advertisement_type\":null,\"advertisement_type_custom\":null,\"amount\":1010,\"bonus\":40.01,\"description\":null,\"enabled\":true,\"image_url\":\"//cdn.xsolla.net/img/misc/images/e69ec3dee89b51237aa01a60b4374c23.png\",\"label\":null,\"prices_array\":[{\"name\":\"RUB\",\"value\":59.99}],\"sku\":null}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("PUT", "/merchant/v2/projects/{project_id}/virtual_currency/packages/{package_id}", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages/{package_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"advertisement_type\":null,\"advertisement_type_custom\":null,\"amount\":1010,\"bonus\":40.01,\"description\":null,\"enabled\":true,\"image_url\":\"//cdn.xsolla.net/img/misc/images/e69ec3dee89b51237aa01a60b4374c23.png\",\"label\":null,\"prices_array\":[{\"name\":\"RUB\",\"value\":59.99}],\"sku\":null}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"advertisement_type\":null,\"advertisement_type_custom\":null,\"amount\":1010,\"bonus\":40.01,\"description\":null,\"enabled\":true,\"image_url\":\"//cdn.xsolla.net/img/misc/images/e69ec3dee89b51237aa01a60b4374c23.png\",\"label\":null,\"prices_array\":[{\"name\":\"RUB\",\"value\":59.99}],\"sku\":null}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages/{package_id}")
  .put(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "advertisement_type": null,
  "advertisement_type_custom": null,
  "amount": 1010,
  "bonus": 40.01,
  "description": null,
  "enabled": true,
  "image_url": "//cdn.xsolla.net/img/misc/images/e69ec3dee89b51237aa01a60b4374c23.png",
  "label": null,
  "prices_array": [
    {
      "name": "RUB",
      "value": 59.99
    }
  ],
  "sku": null
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency/packages/{package_id}");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

가상 아이템

아이템 생성

게임 아이템을 생성합니다.

HTTP 요청

POST https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items

파라미터 유형 설명
project_id
integer 프로젝트 ID.
sku
string 아이템 고유 ID입니다. SKU에는 소문자 라틴어 영숫자, 대시, 밑줄만 사용할 수 있습니다.
item_code
string 아이템의 추가 코드입니다. 옵션.
name
array of strings 항목에 대한 지역화된 이름의 배열입니다.
description
array of strings 항목에 대한 지역화된 설명의 배열입니다.
long_description
array of strings 아이템의 현지화된 설명의 배열입니다.
prices
array 아이템 가격의 배열입니다
default_currency
string 구매의 기본 통화입니다. ISO 4217에 따른 세자리 코드.
enabled
boolean 아이템을 활성화합니다.
permanent
boolean 'true'인 경우, 아이템을 한 번만 구매할 수 있습니다.
image_url
string 이미지의 URL입니다.
item_type
string 항목의 유형: Consumable/Expiration/Permanent/Lootboxes/Physical.
expiration
integer 만료 시간(초)입니다. "Expiration" 아이템 유형에만 사용됩니다.
groups
array of integers 아이템 그룹 목록입니다.
deleted
boolean 아이템이 삭제된 여부.
user_attribute_conditions
array of objects 게임유저 특성 조건의 목록입니다.
user_attribute_conditions.right_operand
array 사용자 특성을 비교하는 값.
user_attribute_conditions.user_attribute_key
string 사용자 특성 조건 키.
user_attribute_conditions.operation
string 작업 유형입니다. 'greater', 'greaterOrEqual', 'equal', 'notEqual', 'less', 'lessOrEqual', 'between', 'in', 'notIn' 등.
user_attribute_conditions.action
string 동작 유형. 'hide', 'block', 'warning' 등.
advertisement_type
string 결제 UI에서 아이템에 표시되는 특수 배너 유형. 'recommended', 'best_deal', 'special_offer', null 등.
virtual_currency_price
integer 게임 내 통화 가격. 'null'인 경우, 실제 통화로만 아이템 구매 가능.
purchase_limit
integer 아이템을 구매할 수 있는 횟수. 'null'인 경우, 구매 횟수 제한 없음.
keywords
array 결제 UI에서 아이템을 찾을 때 사용할 수 있는 키워드.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "advertisement_type": null,
  "default_currency": "USD",
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "image_url": "",
  "item_code": "chinese-medium-tank",
  "item_type": null,
  "keywords": {},
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": "1",
    "USD": "2"
  },
  "sku": "1234",
  "user_attribute_conditions": [
    {},
    {},
    {}
  ]
}
curl --request POST \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"name":{"en":"T-34-3"},"description":{"en":"Chinese Tier VIII medium tank."},"long_description":{"en":"This Chinese Tier VIII medium tank is a real beast in its class."},"enabled":true,"item_code":"chinese-medium-tank","advertisement_type":null,"item_type":null,"keywords":{},"groups":[],"default_currency":"USD","expiration":null,"image_url":"","permanent":true,"prices":{"USD":"2","EUR":"1"},"sku":"1234","user_attribute_conditions":[{},{},{}]}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"name":{"en":"T-34-3"},"description":{"en":"Chinese Tier VIII medium tank."},"long_description":{"en":"This Chinese Tier VIII medium tank is a real beast in its class."},"enabled":true,"item_code":"chinese-medium-tank","advertisement_type":null,"item_type":null,"keywords":{},"groups":[],"default_currency":"USD","expiration":null,"image_url":"","permanent":true,"prices":{"USD":"2","EUR":"1"},"sku":"1234","user_attribute_conditions":[{},{},{}]}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"name\":{\"en\":\"T-34-3\"},\"description\":{\"en\":\"Chinese Tier VIII medium tank.\"},\"long_description\":{\"en\":\"This Chinese Tier VIII medium tank is a real beast in its class.\"},\"enabled\":true,\"item_code\":\"chinese-medium-tank\",\"advertisement_type\":null,\"item_type\":null,\"keywords\":{},\"groups\":[],\"default_currency\":\"USD\",\"expiration\":null,\"image_url\":\"\",\"permanent\":true,\"prices\":{\"USD\":\"2\",\"EUR\":\"1\"},\"sku\":\"1234\",\"user_attribute_conditions\":[{},{},{}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"name\":{\"en\":\"T-34-3\"},\"description\":{\"en\":\"Chinese Tier VIII medium tank.\"},\"long_description\":{\"en\":\"This Chinese Tier VIII medium tank is a real beast in its class.\"},\"enabled\":true,\"item_code\":\"chinese-medium-tank\",\"advertisement_type\":null,\"item_type\":null,\"keywords\":{},\"groups\":[],\"default_currency\":\"USD\",\"expiration\":null,\"image_url\":\"\",\"permanent\":true,\"prices\":{\"USD\":\"2\",\"EUR\":\"1\"},\"sku\":\"1234\",\"user_attribute_conditions\":[{},{},{}]}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("POST", "/merchant/v2/projects/{project_id}/virtual_items/items", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"name\":{\"en\":\"T-34-3\"},\"description\":{\"en\":\"Chinese Tier VIII medium tank.\"},\"long_description\":{\"en\":\"This Chinese Tier VIII medium tank is a real beast in its class.\"},\"enabled\":true,\"item_code\":\"chinese-medium-tank\",\"advertisement_type\":null,\"item_type\":null,\"keywords\":{},\"groups\":[],\"default_currency\":\"USD\",\"expiration\":null,\"image_url\":\"\",\"permanent\":true,\"prices\":{\"USD\":\"2\",\"EUR\":\"1\"},\"sku\":\"1234\",\"user_attribute_conditions\":[{},{},{}]}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":{\"en\":\"T-34-3\"},\"description\":{\"en\":\"Chinese Tier VIII medium tank.\"},\"long_description\":{\"en\":\"This Chinese Tier VIII medium tank is a real beast in its class.\"},\"enabled\":true,\"item_code\":\"chinese-medium-tank\",\"advertisement_type\":null,\"item_type\":null,\"keywords\":{},\"groups\":[],\"default_currency\":\"USD\",\"expiration\":null,\"image_url\":\"\",\"permanent\":true,\"prices\":{\"USD\":\"2\",\"EUR\":\"1\"},\"sku\":\"1234\",\"user_attribute_conditions\":[{},{},{}]}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items")
  .post(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "name": {
    "en": "T-34-3"
  },
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "enabled": true,
  "item_code": "chinese-medium-tank",
  "advertisement_type": null,
  "item_type": null,
  "keywords": {},
  "groups": [],
  "default_currency": "USD",
  "expiration": null,
  "image_url": "",
  "permanent": true,
  "prices": {
    "USD": "2",
    "EUR": "1"
  },
  "sku": "1234",
  "user_attribute_conditions": [
    {},
    {},
    {}
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "item_id": 163099
}
{
  "item_id": 163099
}
{
  "item_id": 163099
}
{
  "item_id": 163099
}
{
  "item_id": 163099
}
{
  "item_id": 163099
}
{
  "item_id": 163099
}
{
  "item_id": 163099
}

아이템 가져오기

게임 아이템을 가져옵니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}

파라미터 유형 설명
item_id
integer 아이템 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id} \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "advertisement_type": null,
  "default_currency": "USD",
  "deleted": false,
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "id": 163099,
  "image_url": "//cdn.xsolla.net/img/misc/merchant/default-item.png",
  "item_code": "chinese-medium-tank",
  "item_type": null,
  "keywords": [],
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": 1,
    "USD": 2
  },
  "purchase_limit": null,
  "secondary_market": [],
  "sku": "1234",
  "user_attribute_conditions": [],
  "virtual_currency_price": null
}
{
  "advertisement_type": null,
  "default_currency": "USD",
  "deleted": false,
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "id": 163099,
  "image_url": "//cdn.xsolla.net/img/misc/merchant/default-item.png",
  "item_code": "chinese-medium-tank",
  "item_type": null,
  "keywords": [],
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": 1,
    "USD": 2
  },
  "purchase_limit": null,
  "secondary_market": [],
  "sku": "1234",
  "user_attribute_conditions": [],
  "virtual_currency_price": null
}
{
  "advertisement_type": null,
  "default_currency": "USD",
  "deleted": false,
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "id": 163099,
  "image_url": "//cdn.xsolla.net/img/misc/merchant/default-item.png",
  "item_code": "chinese-medium-tank",
  "item_type": null,
  "keywords": [],
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": 1,
    "USD": 2
  },
  "purchase_limit": null,
  "secondary_market": [],
  "sku": "1234",
  "user_attribute_conditions": [],
  "virtual_currency_price": null
}
{
  "advertisement_type": null,
  "default_currency": "USD",
  "deleted": false,
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "id": 163099,
  "image_url": "//cdn.xsolla.net/img/misc/merchant/default-item.png",
  "item_code": "chinese-medium-tank",
  "item_type": null,
  "keywords": [],
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": 1,
    "USD": 2
  },
  "purchase_limit": null,
  "secondary_market": [],
  "sku": "1234",
  "user_attribute_conditions": [],
  "virtual_currency_price": null
}
{
  "advertisement_type": null,
  "default_currency": "USD",
  "deleted": false,
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "id": 163099,
  "image_url": "//cdn.xsolla.net/img/misc/merchant/default-item.png",
  "item_code": "chinese-medium-tank",
  "item_type": null,
  "keywords": [],
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": 1,
    "USD": 2
  },
  "purchase_limit": null,
  "secondary_market": [],
  "sku": "1234",
  "user_attribute_conditions": [],
  "virtual_currency_price": null
}
{
  "advertisement_type": null,
  "default_currency": "USD",
  "deleted": false,
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "id": 163099,
  "image_url": "//cdn.xsolla.net/img/misc/merchant/default-item.png",
  "item_code": "chinese-medium-tank",
  "item_type": null,
  "keywords": [],
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": 1,
    "USD": 2
  },
  "purchase_limit": null,
  "secondary_market": [],
  "sku": "1234",
  "user_attribute_conditions": [],
  "virtual_currency_price": null
}
{
  "advertisement_type": null,
  "default_currency": "USD",
  "deleted": false,
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "id": 163099,
  "image_url": "//cdn.xsolla.net/img/misc/merchant/default-item.png",
  "item_code": "chinese-medium-tank",
  "item_type": null,
  "keywords": [],
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": 1,
    "USD": 2
  },
  "purchase_limit": null,
  "secondary_market": [],
  "sku": "1234",
  "user_attribute_conditions": [],
  "virtual_currency_price": null
}
{
  "advertisement_type": null,
  "default_currency": "USD",
  "deleted": false,
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "id": 163099,
  "image_url": "//cdn.xsolla.net/img/misc/merchant/default-item.png",
  "item_code": "chinese-medium-tank",
  "item_type": null,
  "keywords": [],
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": 1,
    "USD": 2
  },
  "purchase_limit": null,
  "secondary_market": [],
  "sku": "1234",
  "user_attribute_conditions": [],
  "virtual_currency_price": null
}

아이템 업데이트

게임 아이템을 업데이트합니다.

HTTP 요청

PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}

파라미터 유형 설명
item_id
integer 아이템 ID입니다.
sku
string 아이템 고유 ID입니다. SKU에는 소문자 라틴어 영숫자, 대시, 밑줄만 사용할 수 있습니다.
item_code
string 아이템의 추가 코드입니다. 옵션.
name
array of strings 항목에 대한 지역화된 이름의 배열입니다.
description
array of strings 항목에 대한 지역화된 설명의 배열입니다.
long_description
array of strings 아이템의 현지화된 설명의 배열입니다.
prices
array 아이템 가격의 배열입니다
default_currency
string 구매의 기본 통화입니다. ISO 4217에 따른 세자리 코드.
enabled
boolean 아이템을 활성화합니다.
permanent
boolean 'true'인 경우, 아이템을 한 번만 구매할 수 있습니다.
image_url
string 이미지의 URL입니다.
item_type
string 항목의 유형: Consumable/Expiration/Permanent/Lootboxes/Physical.
expiration
integer 만료 시간(초)입니다. "Expiration" 아이템 유형에만 사용됩니다.
groups
array of integers 아이템 그룹 목록입니다.
deleted
boolean 아이템이 삭제된 여부.
user_attribute_conditions
array of objects 게임유저 특성 조건의 목록입니다.
user_attribute_conditions.right_operand
array 사용자 특성을 비교하는 값.
user_attribute_conditions.user_attribute_key
string 사용자 특성 조건 키.
user_attribute_conditions.operation
string 작업 유형입니다. 'greater', 'greaterOrEqual', 'equal', 'notEqual', 'less', 'lessOrEqual', 'between', 'in', 'notIn' 등.
user_attribute_conditions.action
string 동작 유형. 'hide', 'block', 'warning' 등.
advertisement_type
string 결제 UI에서 아이템에 표시되는 특수 배너 유형. 'recommended', 'best_deal', 'special_offer', null 등.
virtual_currency_price
integer 게임 내 통화 가격. 'null'인 경우, 실제 통화로만 아이템 구매 가능.
purchase_limit
integer 아이템을 구매할 수 있는 횟수. 'null'인 경우, 구매 횟수 제한 없음.
keywords
array 결제 UI에서 아이템을 찾을 때 사용할 수 있는 키워드.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}virtual_items/items/{item_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "advertisement_type": null,
  "default_currency": "USD",
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "enabled": true,
  "expiration": null,
  "groups": [],
  "image_url": "",
  "item_code": "ut et",
  "item_type": null,
  "keywords": {},
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "name": {
    "en": "T-34-3"
  },
  "permanent": true,
  "prices": {
    "EUR": "4",
    "USD": "2"
  },
  "sku": "12394",
  "user_attribute_conditions": [
    {},
    {},
    {}
  ]
}
curl --request PUT \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}virtual_items/items/{item_id} \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"name":{"en":"T-34-3"},"description":{"en":"Chinese Tier VIII medium tank."},"long_description":{"en":"This Chinese Tier VIII medium tank is a real beast in its class."},"enabled":true,"item_code":"ut et","advertisement_type":null,"item_type":null,"keywords":{},"groups":[],"default_currency":"USD","expiration":null,"image_url":"","permanent":true,"prices":{"USD":"2","EUR":"4"},"sku":"12394","user_attribute_conditions":[{},{},{}]}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"name":{"en":"T-34-3"},"description":{"en":"Chinese Tier VIII medium tank."},"long_description":{"en":"This Chinese Tier VIII medium tank is a real beast in its class."},"enabled":true,"item_code":"ut et","advertisement_type":null,"item_type":null,"keywords":{},"groups":[],"default_currency":"USD","expiration":null,"image_url":"","permanent":true,"prices":{"USD":"2","EUR":"4"},"sku":"12394","user_attribute_conditions":[{},{},{}]}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}virtual_items/items/{item_id}');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}virtual_items/items/{item_id}");
var request = new RestRequest(Method.PUT);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"name\":{\"en\":\"T-34-3\"},\"description\":{\"en\":\"Chinese Tier VIII medium tank.\"},\"long_description\":{\"en\":\"This Chinese Tier VIII medium tank is a real beast in its class.\"},\"enabled\":true,\"item_code\":\"ut et\",\"advertisement_type\":null,\"item_type\":null,\"keywords\":{},\"groups\":[],\"default_currency\":\"USD\",\"expiration\":null,\"image_url\":\"\",\"permanent\":true,\"prices\":{\"USD\":\"2\",\"EUR\":\"4\"},\"sku\":\"12394\",\"user_attribute_conditions\":[{},{},{}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"name\":{\"en\":\"T-34-3\"},\"description\":{\"en\":\"Chinese Tier VIII medium tank.\"},\"long_description\":{\"en\":\"This Chinese Tier VIII medium tank is a real beast in its class.\"},\"enabled\":true,\"item_code\":\"ut et\",\"advertisement_type\":null,\"item_type\":null,\"keywords\":{},\"groups\":[],\"default_currency\":\"USD\",\"expiration\":null,\"image_url\":\"\",\"permanent\":true,\"prices\":{\"USD\":\"2\",\"EUR\":\"4\"},\"sku\":\"12394\",\"user_attribute_conditions\":[{},{},{}]}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("PUT", "/merchant/v2/projects/{project_id}virtual_items/items/{item_id}", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}virtual_items/items/{item_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"name\":{\"en\":\"T-34-3\"},\"description\":{\"en\":\"Chinese Tier VIII medium tank.\"},\"long_description\":{\"en\":\"This Chinese Tier VIII medium tank is a real beast in its class.\"},\"enabled\":true,\"item_code\":\"ut et\",\"advertisement_type\":null,\"item_type\":null,\"keywords\":{},\"groups\":[],\"default_currency\":\"USD\",\"expiration\":null,\"image_url\":\"\",\"permanent\":true,\"prices\":{\"USD\":\"2\",\"EUR\":\"4\"},\"sku\":\"12394\",\"user_attribute_conditions\":[{},{},{}]}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":{\"en\":\"T-34-3\"},\"description\":{\"en\":\"Chinese Tier VIII medium tank.\"},\"long_description\":{\"en\":\"This Chinese Tier VIII medium tank is a real beast in its class.\"},\"enabled\":true,\"item_code\":\"ut et\",\"advertisement_type\":null,\"item_type\":null,\"keywords\":{},\"groups\":[],\"default_currency\":\"USD\",\"expiration\":null,\"image_url\":\"\",\"permanent\":true,\"prices\":{\"USD\":\"2\",\"EUR\":\"4\"},\"sku\":\"12394\",\"user_attribute_conditions\":[{},{},{}]}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}virtual_items/items/{item_id}")
  .put(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "name": {
    "en": "T-34-3"
  },
  "description": {
    "en": "Chinese Tier VIII medium tank."
  },
  "long_description": {
    "en": "This Chinese Tier VIII medium tank is a real beast in its class."
  },
  "enabled": true,
  "item_code": "ut et",
  "advertisement_type": null,
  "item_type": null,
  "keywords": {},
  "groups": [],
  "default_currency": "USD",
  "expiration": null,
  "image_url": "",
  "permanent": true,
  "prices": {
    "USD": "2",
    "EUR": "4"
  },
  "sku": "12394",
  "user_attribute_conditions": [
    {},
    {},
    {}
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.xsolla.com/merchant/v2/projects/{project_id}virtual_items/items/{item_id}");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

아이템 삭제

게임 아이템을 삭제합니다.

HTTP 요청

DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}

파라미터 유형 설명
item_id
integer 아이템 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request DELETE \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id} \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}');
$request->setRequestMethod('DELETE');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}");
var request = new RestRequest(Method.DELETE);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("DELETE", "/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}")
  .delete(null)
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

아이템 목록 가져오기

게임 아이템을 나열합니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items

파라미터 유형 설명
project_id
integer 프로젝트 ID.
offset
integer 목록이 생성된 요소 개수(개수는 0부터 시작함).
limit
integer 페이지 요소 개수 제한.
has_price
string 항목 판매의 유형입니다. 'virtual_currency'(항목을 게임머니로 구매할 수 있는 경우) 또는 'real_currency'(항목을 실제 통화로 구매할 수 있는 경우)일 수 있습니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/virtual_items/items", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
HttpResponse<String> response = Unirest.get("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items")
  .header("authorization", "Basic <your_authorization_basic_key>")
  .asString();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
[
  {
    "advertisement_type": "recommended",
    "default_currency": "USD",
    "enabled": false,
    "groups": [
      9196
    ],
    "id": 163076,
    "localized_name": "Rabbit",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1468",
    "virtual_currency_price": 400
  },
  {
    "advertisement_type": null,
    "default_currency": "USD",
    "enabled": true,
    "groups": [
      9196
    ],
    "id": 163077,
    "localized_name": "Chicken",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1469",
    "virtual_currency_price": 600
  }
]
[
  {
    "advertisement_type": "recommended",
    "default_currency": "USD",
    "enabled": false,
    "groups": [
      9196
    ],
    "id": 163076,
    "localized_name": "Rabbit",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1468",
    "virtual_currency_price": 400
  },
  {
    "advertisement_type": null,
    "default_currency": "USD",
    "enabled": true,
    "groups": [
      9196
    ],
    "id": 163077,
    "localized_name": "Chicken",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1469",
    "virtual_currency_price": 600
  }
]
[
  {
    "advertisement_type": "recommended",
    "default_currency": "USD",
    "enabled": false,
    "groups": [
      9196
    ],
    "id": 163076,
    "localized_name": "Rabbit",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1468",
    "virtual_currency_price": 400
  },
  {
    "advertisement_type": null,
    "default_currency": "USD",
    "enabled": true,
    "groups": [
      9196
    ],
    "id": 163077,
    "localized_name": "Chicken",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1469",
    "virtual_currency_price": 600
  }
]
[
  {
    "advertisement_type": "recommended",
    "default_currency": "USD",
    "enabled": false,
    "groups": [
      9196
    ],
    "id": 163076,
    "localized_name": "Rabbit",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1468",
    "virtual_currency_price": 400
  },
  {
    "advertisement_type": null,
    "default_currency": "USD",
    "enabled": true,
    "groups": [
      9196
    ],
    "id": 163077,
    "localized_name": "Chicken",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1469",
    "virtual_currency_price": 600
  }
]
[
  {
    "advertisement_type": "recommended",
    "default_currency": "USD",
    "enabled": false,
    "groups": [
      9196
    ],
    "id": 163076,
    "localized_name": "Rabbit",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1468",
    "virtual_currency_price": 400
  },
  {
    "advertisement_type": null,
    "default_currency": "USD",
    "enabled": true,
    "groups": [
      9196
    ],
    "id": 163077,
    "localized_name": "Chicken",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1469",
    "virtual_currency_price": 600
  }
]
[
  {
    "advertisement_type": "recommended",
    "default_currency": "USD",
    "enabled": false,
    "groups": [
      9196
    ],
    "id": 163076,
    "localized_name": "Rabbit",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1468",
    "virtual_currency_price": 400
  },
  {
    "advertisement_type": null,
    "default_currency": "USD",
    "enabled": true,
    "groups": [
      9196
    ],
    "id": 163077,
    "localized_name": "Chicken",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1469",
    "virtual_currency_price": 600
  }
]
[
  {
    "advertisement_type": "recommended",
    "default_currency": "USD",
    "enabled": false,
    "groups": [
      9196
    ],
    "id": 163076,
    "localized_name": "Rabbit",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1468",
    "virtual_currency_price": 400
  },
  {
    "advertisement_type": null,
    "default_currency": "USD",
    "enabled": true,
    "groups": [
      9196
    ],
    "id": 163077,
    "localized_name": "Chicken",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1469",
    "virtual_currency_price": 600
  }
]
[
  {
    "advertisement_type": "recommended",
    "default_currency": "USD",
    "enabled": false,
    "groups": [
      9196
    ],
    "id": 163076,
    "localized_name": "Rabbit",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1468",
    "virtual_currency_price": 400
  },
  {
    "advertisement_type": null,
    "default_currency": "USD",
    "enabled": true,
    "groups": [
      9196
    ],
    "id": 163077,
    "localized_name": "Chicken",
    "permanent": false,
    "prices": {
      "CNY": 5.99,
      "EUR": 1,
      "KRW": 999,
      "RUB": 59.99,
      "USD": 1
    },
    "sku": "1469",
    "virtual_currency_price": 600
  }
]

아이템 그룹 생성

응답

HTTP 요청

POST https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups

파라미터 유형 설명
project_id
integer 프로젝트 ID.
name
array of strings 아이템 그룹의 현지화된 이름의 배열입니다.
description
array of strings 아이템 그룹의 현지화된 설명의 배열입니다.
enabled
boolean 이 그룹을 사용할 수 있는지 여부를 나타냅니다.
parent_id
integer 상위 그룹의 ID입니다.
code
integer 그룹의 고유한 코드입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "code": "2",
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "name": {
    "en": "Animals"
  },
  "parent_id": "9182"
}
curl --request POST \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"name":{"en":"Animals"},"description":{"en":"Farm animals"},"enabled":true,"code":"2","parent_id":"9182"}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"name":{"en":"Animals"},"description":{"en":"Farm animals"},"enabled":true,"code":"2","parent_id":"9182"}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"name\":{\"en\":\"Animals\"},\"description\":{\"en\":\"Farm animals\"},\"enabled\":true,\"code\":\"2\",\"parent_id\":\"9182\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"name\":{\"en\":\"Animals\"},\"description\":{\"en\":\"Farm animals\"},\"enabled\":true,\"code\":\"2\",\"parent_id\":\"9182\"}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("POST", "/merchant/v2/projects/{project_id}/virtual_items/groups", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"name\":{\"en\":\"Animals\"},\"description\":{\"en\":\"Farm animals\"},\"enabled\":true,\"code\":\"2\",\"parent_id\":\"9182\"}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":{\"en\":\"Animals\"},\"description\":{\"en\":\"Farm animals\"},\"enabled\":true,\"code\":\"2\",\"parent_id\":\"9182\"}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups")
  .post(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "name": {
    "en": "Animals"
  },
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "code": "2",
  "parent_id": "9182"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "group_id": 9208
}
{
  "group_id": 9208
}
{
  "group_id": 9208
}
{
  "group_id": 9208
}
{
  "group_id": 9208
}
{
  "group_id": 9208
}
{
  "group_id": 9208
}
{
  "group_id": 9208
}

그룹 가져오기

게임 아이템 그룹을 가져옵니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}

파라미터 유형 설명
group_id
string 그룹 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id} \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "code": "2",
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "id": 9208,
  "name": {
    "en": "Animals"
  },
  "parent_id": 9182
}
{
  "code": "2",
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "id": 9208,
  "name": {
    "en": "Animals"
  },
  "parent_id": 9182
}
{
  "code": "2",
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "id": 9208,
  "name": {
    "en": "Animals"
  },
  "parent_id": 9182
}
{
  "code": "2",
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "id": 9208,
  "name": {
    "en": "Animals"
  },
  "parent_id": 9182
}
{
  "code": "2",
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "id": 9208,
  "name": {
    "en": "Animals"
  },
  "parent_id": 9182
}
{
  "code": "2",
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "id": 9208,
  "name": {
    "en": "Animals"
  },
  "parent_id": 9182
}
{
  "code": "2",
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "id": 9208,
  "name": {
    "en": "Animals"
  },
  "parent_id": 9182
}
{
  "code": "2",
  "description": {
    "en": "Farm animals"
  },
  "enabled": true,
  "id": 9208,
  "name": {
    "en": "Animals"
  },
  "parent_id": 9182
}

그룹 업데이트

게임 아이템 그룹을 가져옵니다.

HTTP 요청

PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}

파라미터 유형 설명
group_id
string 그룹 ID입니다.
name
array of strings 아이템 그룹의 현지화된 이름의 배열입니다.
description
array of strings 아이템 그룹의 현지화된 설명의 배열입니다.
enabled
boolean 이 그룹을 사용할 수 있는지 여부를 나타냅니다.
parent_id
integer 상위 그룹의 ID입니다.
code
integer 그룹의 고유한 코드입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "code": "2",
  "description": {
    "en": "Farm animals and plants"
  },
  "enabled": true,
  "name": {
    "en": "Animals and plants"
  },
  "parent_id": "9182"
}
curl --request PUT \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id} \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"name":{"en":"Animals and plants"},"description":{"en":"Farm animals and plants"},"enabled":true,"code":"2","parent_id":"9182"}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"name":{"en":"Animals and plants"},"description":{"en":"Farm animals and plants"},"enabled":true,"code":"2","parent_id":"9182"}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}");
var request = new RestRequest(Method.PUT);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"name\":{\"en\":\"Animals and plants\"},\"description\":{\"en\":\"Farm animals and plants\"},\"enabled\":true,\"code\":\"2\",\"parent_id\":\"9182\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"name\":{\"en\":\"Animals and plants\"},\"description\":{\"en\":\"Farm animals and plants\"},\"enabled\":true,\"code\":\"2\",\"parent_id\":\"9182\"}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("PUT", "/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"name\":{\"en\":\"Animals and plants\"},\"description\":{\"en\":\"Farm animals and plants\"},\"enabled\":true,\"code\":\"2\",\"parent_id\":\"9182\"}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":{\"en\":\"Animals and plants\"},\"description\":{\"en\":\"Farm animals and plants\"},\"enabled\":true,\"code\":\"2\",\"parent_id\":\"9182\"}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}")
  .put(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "name": {
    "en": "Animals and plants"
  },
  "description": {
    "en": "Farm animals and plants"
  },
  "enabled": true,
  "code": "2",
  "parent_id": "9182"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

그룹 삭제

게임 아이템 그룹을 삭제합니다.

HTTP 요청

DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}

파라미터 유형 설명
group_id
string 그룹 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request DELETE \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id} \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}');
$request->setRequestMethod('DELETE');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}");
var request = new RestRequest(Method.DELETE);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("DELETE", "/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}")
  .delete(null)
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

아이템 그룹 목록 가져오기

모든 게임 아이템 그룹을 나열합니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups

파라미터 유형 설명
project_id
integer 프로젝트 ID.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/virtual_items/groups", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
[
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9196,
    "localized_name": "Pets",
    "parent_id": null,
    "virtual_items_count": 8
  },
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9197,
    "localized_name": "Food",
    "parent_id": null,
    "virtual_items_count": 7
  }
]
[
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9196,
    "localized_name": "Pets",
    "parent_id": null,
    "virtual_items_count": 8
  },
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9197,
    "localized_name": "Food",
    "parent_id": null,
    "virtual_items_count": 7
  }
]
[
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9196,
    "localized_name": "Pets",
    "parent_id": null,
    "virtual_items_count": 8
  },
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9197,
    "localized_name": "Food",
    "parent_id": null,
    "virtual_items_count": 7
  }
]
[
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9196,
    "localized_name": "Pets",
    "parent_id": null,
    "virtual_items_count": 8
  },
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9197,
    "localized_name": "Food",
    "parent_id": null,
    "virtual_items_count": 7
  }
]
[
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9196,
    "localized_name": "Pets",
    "parent_id": null,
    "virtual_items_count": 8
  },
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9197,
    "localized_name": "Food",
    "parent_id": null,
    "virtual_items_count": 7
  }
]
[
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9196,
    "localized_name": "Pets",
    "parent_id": null,
    "virtual_items_count": 8
  },
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9197,
    "localized_name": "Food",
    "parent_id": null,
    "virtual_items_count": 7
  }
]
[
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9196,
    "localized_name": "Pets",
    "parent_id": null,
    "virtual_items_count": 8
  },
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9197,
    "localized_name": "Food",
    "parent_id": null,
    "virtual_items_count": 7
  }
]
[
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9196,
    "localized_name": "Pets",
    "parent_id": null,
    "virtual_items_count": 8
  },
  {
    "code": null,
    "enabled": true,
    "has_groups": false,
    "has_virtual_items": true,
    "id": 9197,
    "localized_name": "Food",
    "parent_id": null,
    "virtual_items_count": 7
  }
]

유저 특성

특성 생성

게임유저 특성을 생성합니다.

HTTP 요청

POST https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes

파라미터 유형 설명
project_id
integer 프로젝트 ID. 필수.
key
string 게임유저 특성 키입니다. 필수.
name
array of strings 게임유저 특성의 현지화된 이름의 배열입니다. 필수.
type
string 키 형식입니다. 'int', 'string', 'enum' 또는 'date'가 가능합니다. 필수.
list_of_values
array enum형 값의 배열입니다. 필수.
skip_condition_on_nonexistent_key
boolean 키가 존재하지 않는 경우 조건을 건너뛰어야 하는지 여부입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "key": "13",
  "list_of_values": [
    {},
    {},
    {},
    {}
  ],
  "name": {
    "en": "Rating",
    "ru": "Рейтинг"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": false
}
curl --request POST \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"key":"13","name":{"en":"Rating","ru":"Рейтинг"},"type":"int","list_of_values":[{},{},{},{}],"visible":false,"skip_condition_on_nonexistent_key":true}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"key":"13","name":{"en":"Rating","ru":"Рейтинг"},"type":"int","list_of_values":[{},{},{},{}],"visible":false,"skip_condition_on_nonexistent_key":true}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"key\":\"13\",\"name\":{\"en\":\"Rating\",\"ru\":\"Рейтинг\"},\"type\":\"int\",\"list_of_values\":[{},{},{},{}],\"visible\":false,\"skip_condition_on_nonexistent_key\":true}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"key\":\"13\",\"name\":{\"en\":\"Rating\",\"ru\":\"Рейтинг\"},\"type\":\"int\",\"list_of_values\":[{},{},{},{}],\"visible\":false,\"skip_condition_on_nonexistent_key\":true}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("POST", "/merchant/v2/projects/{project_id}/user_attributes", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"key\":\"13\",\"name\":{\"en\":\"Rating\",\"ru\":\"Рейтинг\"},\"type\":\"int\",\"list_of_values\":[{},{},{},{}],\"visible\":false,\"skip_condition_on_nonexistent_key\":true}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"key\":\"13\",\"name\":{\"en\":\"Rating\",\"ru\":\"Рейтинг\"},\"type\":\"int\",\"list_of_values\":[{},{},{},{}],\"visible\":false,\"skip_condition_on_nonexistent_key\":true}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes")
  .post(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "key": "13",
  "name": {
    "en": "Rating",
    "ru": "Рейтинг"
  },
  "type": "int",
  "list_of_values": [
    {},
    {},
    {},
    {}
  ],
  "visible": false,
  "skip_condition_on_nonexistent_key": true
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "id": 11427
}
{
  "id": 11427
}
{
  "id": 11427
}
{
  "id": 11427
}
{
  "id": 11427
}
{
  "id": 11427
}
{
  "id": 11427
}
{
  "id": 11427
}

특성 가져오기

게임유저 특성을 표시합니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{user_attribute_id}

파라미터 Type 설명
project_id
integer 프로젝트 ID.
user_attribute_id
integer 개임유저 특성 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/11425

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/11425 \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/11425');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/11425");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/user_attributes/11425", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/11425")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/11425")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/11425");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "id": 11425,
  "key": "12",
  "list_of_values": [],
  "localized_name": "Level",
  "name": {
    "en": "Level",
    "ru": "Уровень"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": false
}
{
  "id": 11425,
  "key": "12",
  "list_of_values": [],
  "localized_name": "Level",
  "name": {
    "en": "Level",
    "ru": "Уровень"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": false
}
{
  "id": 11425,
  "key": "12",
  "list_of_values": [],
  "localized_name": "Level",
  "name": {
    "en": "Level",
    "ru": "Уровень"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": false
}
{
  "id": 11425,
  "key": "12",
  "list_of_values": [],
  "localized_name": "Level",
  "name": {
    "en": "Level",
    "ru": "Уровень"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": false
}
{
  "id": 11425,
  "key": "12",
  "list_of_values": [],
  "localized_name": "Level",
  "name": {
    "en": "Level",
    "ru": "Уровень"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": false
}
{
  "id": 11425,
  "key": "12",
  "list_of_values": [],
  "localized_name": "Level",
  "name": {
    "en": "Level",
    "ru": "Уровень"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": false
}
{
  "id": 11425,
  "key": "12",
  "list_of_values": [],
  "localized_name": "Level",
  "name": {
    "en": "Level",
    "ru": "Уровень"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": false
}
{
  "id": 11425,
  "key": "12",
  "list_of_values": [],
  "localized_name": "Level",
  "name": {
    "en": "Level",
    "ru": "Уровень"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": false
}

특성 업데이트

게임유저 특성을 갱신합니다.

HTTP 요청

PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{user_attribute_id}

파라미터 유형 설명
project_id
integer 프로젝트 ID.
user_attribute_id
integer 개임유저 특성 ID입니다.
key
string 게임유저 특성 키입니다. 필수.
name
array of strings 게임유저 특성의 현지화된 이름의 배열입니다. 필수.
type
string 키 형식입니다. 'int', 'string', 'enum' 또는 'date'가 가능합니다. 필수.
list_of_values
array enum형 값의 배열입니다. 필수.
skip_condition_on_nonexistent_key
boolean 키가 존재하지 않는 경우 조건을 건너뛰어야 하는지 여부입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "key": "13",
  "list_of_values": [
    {},
    {},
    {},
    {}
  ],
  "name": {
    "en": "User rating",
    "ru": "Рейтинг пользователя"
  },
  "skip_condition_on_nonexistent_key": true,
  "type": "int",
  "visible": true
}
curl --request PUT \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id} \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"key":"13","name":{"en":"User rating","ru":"Рейтинг пользователя"},"type":"int","list_of_values":[{},{},{},{}],"visible":true,"skip_condition_on_nonexistent_key":true}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"key":"13","name":{"en":"User rating","ru":"Рейтинг пользователя"},"type":"int","list_of_values":[{},{},{},{}],"visible":true,"skip_condition_on_nonexistent_key":true}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}");
var request = new RestRequest(Method.PUT);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"key\":\"13\",\"name\":{\"en\":\"User rating\",\"ru\":\"Рейтинг пользователя\"},\"type\":\"int\",\"list_of_values\":[{},{},{},{}],\"visible\":true,\"skip_condition_on_nonexistent_key\":true}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"key\":\"13\",\"name\":{\"en\":\"User rating\",\"ru\":\"Рейтинг пользователя\"},\"type\":\"int\",\"list_of_values\":[{},{},{},{}],\"visible\":true,\"skip_condition_on_nonexistent_key\":true}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("PUT", "/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"key\":\"13\",\"name\":{\"en\":\"User rating\",\"ru\":\"Рейтинг пользователя\"},\"type\":\"int\",\"list_of_values\":[{},{},{},{}],\"visible\":true,\"skip_condition_on_nonexistent_key\":true}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"key\":\"13\",\"name\":{\"en\":\"User rating\",\"ru\":\"Рейтинг пользователя\"},\"type\":\"int\",\"list_of_values\":[{},{},{},{}],\"visible\":true,\"skip_condition_on_nonexistent_key\":true}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}")
  .put(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "key": "13",
  "name": {
    "en": "User rating",
    "ru": "Рейтинг пользователя"
  },
  "type": "int",
  "list_of_values": [
    {},
    {},
    {},
    {}
  ],
  "visible": true,
  "skip_condition_on_nonexistent_key": true
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

특성 삭제

게임유저 특성을 삭제합니다.

HTTP 요청

DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{user_attribute_id}

파라미터 Type 설명
project_id
integer 프로젝트 ID.
user_attribute_id
integer 개임유저 특성 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request DELETE \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id} \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}');
$request->setRequestMethod('DELETE');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}");
var request = new RestRequest(Method.DELETE);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("DELETE", "/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}")
  .delete(null)
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{attribute_id}");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

특성 목록 가져오기

모든 게임유저 특성 목록을 가져옵니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes

파라미터 Type 설명
project_id
integer 프로젝트 ID.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/user_attributes", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
[
  {
    "id": 11425,
    "key": "12",
    "list_of_values": [],
    "localized_name": "Level",
    "name": {
      "en": "Level",
      "ru": "Уровень"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "int",
    "visible": false
  },
  {
    "id": 11426,
    "key": "11",
    "list_of_values": [],
    "localized_name": "Class",
    "name": {
      "en": "Class",
      "ru": "Класс"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "string",
    "visible": false
  }
]
[
  {
    "id": 11425,
    "key": "12",
    "list_of_values": [],
    "localized_name": "Level",
    "name": {
      "en": "Level",
      "ru": "Уровень"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "int",
    "visible": false
  },
  {
    "id": 11426,
    "key": "11",
    "list_of_values": [],
    "localized_name": "Class",
    "name": {
      "en": "Class",
      "ru": "Класс"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "string",
    "visible": false
  }
]
[
  {
    "id": 11425,
    "key": "12",
    "list_of_values": [],
    "localized_name": "Level",
    "name": {
      "en": "Level",
      "ru": "Уровень"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "int",
    "visible": false
  },
  {
    "id": 11426,
    "key": "11",
    "list_of_values": [],
    "localized_name": "Class",
    "name": {
      "en": "Class",
      "ru": "Класс"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "string",
    "visible": false
  }
]
[
  {
    "id": 11425,
    "key": "12",
    "list_of_values": [],
    "localized_name": "Level",
    "name": {
      "en": "Level",
      "ru": "Уровень"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "int",
    "visible": false
  },
  {
    "id": 11426,
    "key": "11",
    "list_of_values": [],
    "localized_name": "Class",
    "name": {
      "en": "Class",
      "ru": "Класс"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "string",
    "visible": false
  }
]
[
  {
    "id": 11425,
    "key": "12",
    "list_of_values": [],
    "localized_name": "Level",
    "name": {
      "en": "Level",
      "ru": "Уровень"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "int",
    "visible": false
  },
  {
    "id": 11426,
    "key": "11",
    "list_of_values": [],
    "localized_name": "Class",
    "name": {
      "en": "Class",
      "ru": "Класс"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "string",
    "visible": false
  }
]
[
  {
    "id": 11425,
    "key": "12",
    "list_of_values": [],
    "localized_name": "Level",
    "name": {
      "en": "Level",
      "ru": "Уровень"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "int",
    "visible": false
  },
  {
    "id": 11426,
    "key": "11",
    "list_of_values": [],
    "localized_name": "Class",
    "name": {
      "en": "Class",
      "ru": "Класс"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "string",
    "visible": false
  }
]
[
  {
    "id": 11425,
    "key": "12",
    "list_of_values": [],
    "localized_name": "Level",
    "name": {
      "en": "Level",
      "ru": "Уровень"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "int",
    "visible": false
  },
  {
    "id": 11426,
    "key": "11",
    "list_of_values": [],
    "localized_name": "Class",
    "name": {
      "en": "Class",
      "ru": "Класс"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "string",
    "visible": false
  }
]
[
  {
    "id": 11425,
    "key": "12",
    "list_of_values": [],
    "localized_name": "Level",
    "name": {
      "en": "Level",
      "ru": "Уровень"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "int",
    "visible": false
  },
  {
    "id": 11426,
    "key": "11",
    "list_of_values": [],
    "localized_name": "Class",
    "name": {
      "en": "Class",
      "ru": "Класс"
    },
    "skip_condition_on_nonexistent_key": true,
    "type": "string",
    "visible": false
  }
]

정기 결제

요금제 생성

정기결제 요금제를 생성합니다.

HTTP 요청

POST https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans

파라미터 유형 설명
project_id
integer 프로젝트 ID.
external_id
string 외부 요금제 식별자입니다. 옵션.
name
array of strings 요금제 이름입니다. <지역화>:<요금제 이름> 쌍으로 구성된 값입니다.
description
array of strings 요금제 설명입니다. <지역화>:<요금제 설명> 쌍으로 구성된 값입니다. 옵션.
group_id
string 이러한 요금제가 연결된 그룹의 ID입니다.
charge
object 충전 데이터 관련 개체입니다.
charge.period
object 충전 기간 데이터와 관련된 개체입니다.
charge.period.value
integer 충전 사이 기간입니다.
charge.period.type
string 기간 형식(일/월)입니다.
charge.amount
float 지불 금액입니다.
charge.currency
string 구매 통화입니다. 통화의 3자리 정의가 ISO 4217에 따라 사용됩니다.
expiration
object 정기 결제 만료 데이터 관련 개체입니다.
expiration.value
integer 만료 전 남은 기간입니다.
expiration.type
string 기간 형식(일/월)입니다.
trial
object 무료체험 기간 데이터 관련 개체입니다. 옵션.
trial.value
integer 무료체험 기간 길이입니다.
trial.type
string 무료체험 기간 형식(일)입니다.
grace_period
object 유예 기간에 대한 데이터가 포함된 개체입니다. 옵션.
grace_period.value
integer 유예 기간에 대한 시간입니다.
grace_period.type
string 무료체험 기간 형식(일)입니다.
tags
array 플랜 태그. 옵션.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "charge": {
    "amount": "10",
    "currency": "USD",
    "period": {
      "type": "month",
      "value": "1"
    }
  },
  "description": {
    "en": "2x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": null
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": "2"
  },
  "name": {
    "en": "Experience boost"
  },
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "trial": {
    "type": "day",
    "value": "7"
  }
}
curl --request POST \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"charge":{"amount":"10","currency":"USD","period":{"value":"1","type":"month"}},"name":{"en":"Experience boost"},"description":{"en":"2x more experience!"},"trial":{"value":"7","type":"day"},"grace_period":{"value":"2","type":"day"},"external_id":"exp","expiration":{"value":null,"type":"day"},"status":{"value":"active","counters":{"active":0,"canceled":0,"frozen":0,"non_renewing":0}}}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"charge":{"amount":"10","currency":"USD","period":{"value":"1","type":"month"}},"name":{"en":"Experience boost"},"description":{"en":"2x more experience!"},"trial":{"value":"7","type":"day"},"grace_period":{"value":"2","type":"day"},"external_id":"exp","expiration":{"value":null,"type":"day"},"status":{"value":"active","counters":{"active":0,"canceled":0,"frozen":0,"non_renewing":0}}}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"charge\":{\"amount\":\"10\",\"currency\":\"USD\",\"period\":{\"value\":\"1\",\"type\":\"month\"}},\"name\":{\"en\":\"Experience boost\"},\"description\":{\"en\":\"2x more experience!\"},\"trial\":{\"value\":\"7\",\"type\":\"day\"},\"grace_period\":{\"value\":\"2\",\"type\":\"day\"},\"external_id\":\"exp\",\"expiration\":{\"value\":null,\"type\":\"day\"},\"status\":{\"value\":\"active\",\"counters\":{\"active\":0,\"canceled\":0,\"frozen\":0,\"non_renewing\":0}}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"charge\":{\"amount\":\"10\",\"currency\":\"USD\",\"period\":{\"value\":\"1\",\"type\":\"month\"}},\"name\":{\"en\":\"Experience boost\"},\"description\":{\"en\":\"2x more experience!\"},\"trial\":{\"value\":\"7\",\"type\":\"day\"},\"grace_period\":{\"value\":\"2\",\"type\":\"day\"},\"external_id\":\"exp\",\"expiration\":{\"value\":null,\"type\":\"day\"},\"status\":{\"value\":\"active\",\"counters\":{\"active\":0,\"canceled\":0,\"frozen\":0,\"non_renewing\":0}}}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("POST", "/merchant/v2/projects/{project_id}/subscriptions/plans", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"charge\":{\"amount\":\"10\",\"currency\":\"USD\",\"period\":{\"value\":\"1\",\"type\":\"month\"}},\"name\":{\"en\":\"Experience boost\"},\"description\":{\"en\":\"2x more experience!\"},\"trial\":{\"value\":\"7\",\"type\":\"day\"},\"grace_period\":{\"value\":\"2\",\"type\":\"day\"},\"external_id\":\"exp\",\"expiration\":{\"value\":null,\"type\":\"day\"},\"status\":{\"value\":\"active\",\"counters\":{\"active\":0,\"canceled\":0,\"frozen\":0,\"non_renewing\":0}}}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"charge\":{\"amount\":\"10\",\"currency\":\"USD\",\"period\":{\"value\":\"1\",\"type\":\"month\"}},\"name\":{\"en\":\"Experience boost\"},\"description\":{\"en\":\"2x more experience!\"},\"trial\":{\"value\":\"7\",\"type\":\"day\"},\"grace_period\":{\"value\":\"2\",\"type\":\"day\"},\"external_id\":\"exp\",\"expiration\":{\"value\":null,\"type\":\"day\"},\"status\":{\"value\":\"active\",\"counters\":{\"active\":0,\"canceled\":0,\"frozen\":0,\"non_renewing\":0}}}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans")
  .post(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "charge": {
    "amount": "10",
    "currency": "USD",
    "period": {
      "value": "1",
      "type": "month"
    }
  },
  "name": {
    "en": "Experience boost"
  },
  "description": {
    "en": "2x more experience!"
  },
  "trial": {
    "value": "7",
    "type": "day"
  },
  "grace_period": {
    "value": "2",
    "type": "day"
  },
  "external_id": "exp",
  "expiration": {
    "value": null,
    "type": "day"
  },
  "status": {
    "value": "active",
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    }
  }
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "external_id": "exp",
  "plan_id": 241082
}
{
  "external_id": "exp",
  "plan_id": 241082
}
{
  "external_id": "exp",
  "plan_id": 241082
}
{
  "external_id": "exp",
  "plan_id": 241082
}
{
  "external_id": "exp",
  "plan_id": 241082
}
{
  "external_id": "exp",
  "plan_id": 241082
}
{
  "external_id": "exp",
  "plan_id": 241082
}
{
  "external_id": "exp",
  "plan_id": 241082
}

요금제 매개변수 업데이트

정기결제 요금제 매개변수를 업데이트합니다.

HTTP 요청

PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}

파라미터 유형 설명
project_id
integer 프로젝트 ID.
plan_id
integer 요금제 ID입니다.
external_id
string 외부 요금제 식별자입니다. 옵션.
name
array of strings 요금제 이름입니다. <지역화>:<요금제 이름> 쌍으로 구성된 값입니다.
description
array of strings 요금제 설명입니다. <지역화>:<요금제 설명> 쌍으로 구성된 값입니다. 옵션.
group_id
string 이러한 요금제가 연결된 그룹의 ID입니다.
charge
object 충전 데이터 관련 개체입니다.
charge.period
object 충전 기간 데이터와 관련된 개체입니다.
charge.period.value
integer 충전 사이 기간입니다.
charge.period.type
string 기간 형식(일/월)입니다.
charge.amount
float 지불 금액입니다.
charge.currency
string 구매 통화입니다. 통화의 3자리 정의가 ISO 4217에 따라 사용됩니다.
expiration
object 정기 결제 만료 데이터 관련 개체입니다.
expiration.value
integer 만료 전 남은 기간입니다.
expiration.type
string 기간 형식(일/월)입니다.
trial
object 무료체험 기간 데이터 관련 개체입니다. 옵션.
trial.value
integer 무료체험 기간 길이입니다.
trial.type
string 무료체험 기간 형식(일)입니다.
grace_period
object 유예 기간에 대한 데이터가 포함된 개체입니다. 옵션.
grace_period.value
integer 유예 기간에 대한 시간입니다.
grace_period.type
string 무료체험 기간 형식(일)입니다.
tags
array 플랜 태그. 옵션.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • java
  • js
  • python
  • ruby
요청
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "type": "month",
      "value": "1"
    }
  },
  "description": {
    "en": "3x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": null
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": "2"
  },
  "name": {
    "en": "Experience boost"
  },
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "tags": null,
  "trial": {
    "type": "day",
    "value": "7"
  }
}
curl --request PUT \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id} \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"charge":{"amount":20,"currency":"USD","period":{"value":"1","type":"month"}},"name":{"en":"Experience boost"},"description":{"en":"3x more experience!"},"trial":{"value":"7","type":"day"},"grace_period":{"value":"2","type":"day"},"external_id":"exp","expiration":{"value":null,"type":"day"},"status":{"value":"active","counters":{"active":0,"canceled":0,"frozen":0,"non_renewing":0}},"tags":null}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"charge":{"amount":20,"currency":"USD","period":{"value":"1","type":"month"}},"name":{"en":"Experience boost"},"description":{"en":"3x more experience!"},"trial":{"value":"7","type":"day"},"grace_period":{"value":"2","type":"day"},"external_id":"exp","expiration":{"value":null,"type":"day"},"status":{"value":"active","counters":{"active":0,"canceled":0,"frozen":0,"non_renewing":0}},"tags":null}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}");
var request = new RestRequest(Method.PUT);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"charge\":{\"amount\":20,\"currency\":\"USD\",\"period\":{\"value\":\"1\",\"type\":\"month\"}},\"name\":{\"en\":\"Experience boost\"},\"description\":{\"en\":\"3x more experience!\"},\"trial\":{\"value\":\"7\",\"type\":\"day\"},\"grace_period\":{\"value\":\"2\",\"type\":\"day\"},\"external_id\":\"exp\",\"expiration\":{\"value\":null,\"type\":\"day\"},\"status\":{\"value\":\"active\",\"counters\":{\"active\":0,\"canceled\":0,\"frozen\":0,\"non_renewing\":0}},\"tags\":null}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"charge\":{\"amount\":20,\"currency\":\"USD\",\"period\":{\"value\":\"1\",\"type\":\"month\"}},\"name\":{\"en\":\"Experience boost\"},\"description\":{\"en\":\"3x more experience!\"},\"trial\":{\"value\":\"7\",\"type\":\"day\"},\"grace_period\":{\"value\":\"2\",\"type\":\"day\"},\"external_id\":\"exp\",\"expiration\":{\"value\":null,\"type\":\"day\"},\"status\":{\"value\":\"active\",\"counters\":{\"active\":0,\"canceled\":0,\"frozen\":0,\"non_renewing\":0}},\"tags\":null}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}")
  .put(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "value": "1",
      "type": "month"
    }
  },
  "name": {
    "en": "Experience boost"
  },
  "description": {
    "en": "3x more experience!"
  },
  "trial": {
    "value": "7",
    "type": "day"
  },
  "grace_period": {
    "value": "2",
    "type": "day"
  },
  "external_id": "exp",
  "expiration": {
    "value": null,
    "type": "day"
  },
  "status": {
    "value": "active",
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    }
  },
  "tags": null
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"charge\":{\"amount\":20,\"currency\":\"USD\",\"period\":{\"value\":\"1\",\"type\":\"month\"}},\"name\":{\"en\":\"Experience boost\"},\"description\":{\"en\":\"3x more experience!\"},\"trial\":{\"value\":\"7\",\"type\":\"day\"},\"grace_period\":{\"value\":\"2\",\"type\":\"day\"},\"external_id\":\"exp\",\"expiration\":{\"value\":null,\"type\":\"day\"},\"status\":{\"value\":\"active\",\"counters\":{\"active\":0,\"canceled\":0,\"frozen\":0,\"non_renewing\":0}},\"tags\":null}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("PUT", "/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"charge\":{\"amount\":20,\"currency\":\"USD\",\"period\":{\"value\":\"1\",\"type\":\"month\"}},\"name\":{\"en\":\"Experience boost\"},\"description\":{\"en\":\"3x more experience!\"},\"trial\":{\"value\":\"7\",\"type\":\"day\"},\"grace_period\":{\"value\":\"2\",\"type\":\"day\"},\"external_id\":\"exp\",\"expiration\":{\"value\":null,\"type\":\"day\"},\"status\":{\"value\":\"active\",\"counters\":{\"active\":0,\"canceled\":0,\"frozen\":0,\"non_renewing\":0}},\"tags\":null}"

response = http.request(request)
puts response.read_body
응답
{
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "type": "month",
      "value": 1
    }
  },
  "description": {
    "en": "3x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": 0
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": 2
  },
  "group_id": null,
  "id": 241082,
  "localized_name": "Experience boost",
  "name": {
    "en": "Experience boost"
  },
  "project_id": 40797,
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "tags": [],
  "trial": {
    "type": "day",
    "value": 7
  },
  "type": "all"
}
{
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "type": "month",
      "value": 1
    }
  },
  "description": {
    "en": "3x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": 0
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": 2
  },
  "group_id": null,
  "id": 241082,
  "localized_name": "Experience boost",
  "name": {
    "en": "Experience boost"
  },
  "project_id": 40797,
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "tags": [],
  "trial": {
    "type": "day",
    "value": 7
  },
  "type": "all"
}
{
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "type": "month",
      "value": 1
    }
  },
  "description": {
    "en": "3x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": 0
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": 2
  },
  "group_id": null,
  "id": 241082,
  "localized_name": "Experience boost",
  "name": {
    "en": "Experience boost"
  },
  "project_id": 40797,
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "tags": [],
  "trial": {
    "type": "day",
    "value": 7
  },
  "type": "all"
}
{
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "type": "month",
      "value": 1
    }
  },
  "description": {
    "en": "3x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": 0
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": 2
  },
  "group_id": null,
  "id": 241082,
  "localized_name": "Experience boost",
  "name": {
    "en": "Experience boost"
  },
  "project_id": 40797,
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "tags": [],
  "trial": {
    "type": "day",
    "value": 7
  },
  "type": "all"
}
{
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "type": "month",
      "value": 1
    }
  },
  "description": {
    "en": "3x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": 0
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": 2
  },
  "group_id": null,
  "id": 241082,
  "localized_name": "Experience boost",
  "name": {
    "en": "Experience boost"
  },
  "project_id": 40797,
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "tags": [],
  "trial": {
    "type": "day",
    "value": 7
  },
  "type": "all"
}
{
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "type": "month",
      "value": 1
    }
  },
  "description": {
    "en": "3x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": 0
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": 2
  },
  "group_id": null,
  "id": 241082,
  "localized_name": "Experience boost",
  "name": {
    "en": "Experience boost"
  },
  "project_id": 40797,
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "tags": [],
  "trial": {
    "type": "day",
    "value": 7
  },
  "type": "all"
}
{
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "type": "month",
      "value": 1
    }
  },
  "description": {
    "en": "3x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": 0
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": 2
  },
  "group_id": null,
  "id": 241082,
  "localized_name": "Experience boost",
  "name": {
    "en": "Experience boost"
  },
  "project_id": 40797,
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "tags": [],
  "trial": {
    "type": "day",
    "value": 7
  },
  "type": "all"
}
{
  "charge": {
    "amount": 20,
    "currency": "USD",
    "period": {
      "type": "month",
      "value": 1
    }
  },
  "description": {
    "en": "3x more experience!"
  },
  "expiration": {
    "type": "day",
    "value": 0
  },
  "external_id": "exp",
  "grace_period": {
    "type": "day",
    "value": 2
  },
  "group_id": null,
  "id": 241082,
  "localized_name": "Experience boost",
  "name": {
    "en": "Experience boost"
  },
  "project_id": 40797,
  "status": {
    "counters": {
      "active": 0,
      "canceled": 0,
      "frozen": 0,
      "non_renewing": 0
    },
    "value": "active"
  },
  "tags": [],
  "trial": {
    "type": "day",
    "value": 7
  },
  "type": "all"
}

요금제 활성화

정기결제 요금제를 활성화합니다.

HTTP 요청

PATCH https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}

파라미터 유형 설명
project_id
integer 프로젝트 ID.
plan_id
integer 요금제 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
PATCH https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "status": {
    "value": "active"
  }
}
curl --request PATCH \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id} \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"status":{"value":"active"}}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"status":{"value":"active"}}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}');
$request->setRequestMethod('PATCH');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}");
var request = new RestRequest(Method.PATCH);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"status\":{\"value\":\"active\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"status\":{\"value\":\"active\"}}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("PATCH", "/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"status\":{\"value\":\"active\"}}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"status\":{\"value\":\"active\"}}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}")
  .patch(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "status": {
    "value": "active"
  }
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

요금제 비활성화

정기결제 요금제를 비활성화합니다.

HTTP 요청

DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}

파라미터 유형 설명
project_id
integer 프로젝트 ID.
plan_id
integer 요금제 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request DELETE \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id} \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}');
$request->setRequestMethod('DELETE');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}");
var request = new RestRequest(Method.DELETE);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("DELETE", "/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}")
  .delete(null)
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

요금제 삭제

정기결제 요금제를 삭제합니다.

HTTP 요청

DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete

파라미터 유형 설명
project_id
integer 프로젝트 ID.
plan_id
integer 요금제 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request DELETE \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete');
$request->setRequestMethod('DELETE');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete");
var request = new RestRequest(Method.DELETE);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("DELETE", "/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete")
  .delete(null)
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

모든 요금제 나열

모든 정기결제 요금제를 나열합니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans

파라미터 유형 설명
project_id
integer 프로젝트 ID.
external_id
string 외부 요금제 식별자입니다.
limit
integer 페이지 요소 개수 제한.
offset
integer 목록이 생성된 요소 개수(개수는 0부터 시작함).
group_id
string 이러한 요금제가 연결된 그룹의 ID입니다.
product_id
integer 이러한 요금제가 연결된 상품의 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans?limit=10

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans?limit=10' \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString(array(
  'limit' => '10'
)));

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans?limit=10");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/subscriptions/plans?limit=10", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans?limit=10")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans?limit=10")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans?limit=10");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
[
  {
    "charge": {
      "amount": 19.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "10x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "3b355320",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241037,
    "localized_name": "Platinum VIP",
    "name": {
      "en": "Platinum VIP",
      "fr": "Le VIP-statut platinum"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  {
    "charge": {
      "amount": 9.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "3x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "0fe1b6fc",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241038,
    "localized_name": "Gold Status",
    "name": {
      "en": "Gold Status",
      "fr": "Le statut d’or"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  }
]
[
  {
    "charge": {
      "amount": 19.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "10x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "3b355320",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241037,
    "localized_name": "Platinum VIP",
    "name": {
      "en": "Platinum VIP",
      "fr": "Le VIP-statut platinum"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  {
    "charge": {
      "amount": 9.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "3x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "0fe1b6fc",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241038,
    "localized_name": "Gold Status",
    "name": {
      "en": "Gold Status",
      "fr": "Le statut d’or"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  }
]
[
  {
    "charge": {
      "amount": 19.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "10x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "3b355320",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241037,
    "localized_name": "Platinum VIP",
    "name": {
      "en": "Platinum VIP",
      "fr": "Le VIP-statut platinum"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  {
    "charge": {
      "amount": 9.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "3x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "0fe1b6fc",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241038,
    "localized_name": "Gold Status",
    "name": {
      "en": "Gold Status",
      "fr": "Le statut d’or"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  }
]
[
  {
    "charge": {
      "amount": 19.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "10x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "3b355320",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241037,
    "localized_name": "Platinum VIP",
    "name": {
      "en": "Platinum VIP",
      "fr": "Le VIP-statut platinum"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  {
    "charge": {
      "amount": 9.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "3x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "0fe1b6fc",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241038,
    "localized_name": "Gold Status",
    "name": {
      "en": "Gold Status",
      "fr": "Le statut d’or"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  }
]
[
  {
    "charge": {
      "amount": 19.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "10x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "3b355320",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241037,
    "localized_name": "Platinum VIP",
    "name": {
      "en": "Platinum VIP",
      "fr": "Le VIP-statut platinum"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  {
    "charge": {
      "amount": 9.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "3x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "0fe1b6fc",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241038,
    "localized_name": "Gold Status",
    "name": {
      "en": "Gold Status",
      "fr": "Le statut d’or"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  }
]
[
  {
    "charge": {
      "amount": 19.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "10x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "3b355320",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241037,
    "localized_name": "Platinum VIP",
    "name": {
      "en": "Platinum VIP",
      "fr": "Le VIP-statut platinum"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  {
    "charge": {
      "amount": 9.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "3x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "0fe1b6fc",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241038,
    "localized_name": "Gold Status",
    "name": {
      "en": "Gold Status",
      "fr": "Le statut d’or"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  }
]
[
  {
    "charge": {
      "amount": 19.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "10x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "3b355320",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241037,
    "localized_name": "Platinum VIP",
    "name": {
      "en": "Platinum VIP",
      "fr": "Le VIP-statut platinum"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  {
    "charge": {
      "amount": 9.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "3x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "0fe1b6fc",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241038,
    "localized_name": "Gold Status",
    "name": {
      "en": "Gold Status",
      "fr": "Le statut d’or"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  }
]
[
  {
    "charge": {
      "amount": 19.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "10x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "3b355320",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241037,
    "localized_name": "Platinum VIP",
    "name": {
      "en": "Platinum VIP",
      "fr": "Le VIP-statut platinum"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  {
    "charge": {
      "amount": 9.99,
      "currency": "USD",
      "period": {
        "type": "month",
        "value": 1
      }
    },
    "description": {
      "en": "3x more experience!"
    },
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "0fe1b6fc",
    "grace_period": {
      "type": "day",
      "value": 0
    },
    "group_id": null,
    "id": 241038,
    "localized_name": "Gold Status",
    "name": {
      "en": "Gold Status",
      "fr": "Le statut d’or"
    },
    "project_id": 40797,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  }
]

상품 생성

상품 생성.

HTTP 요청

POST https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products

파라미터 유형 설명
project_id
integer 프로젝트 ID.
name
string 제품 이름입니다.
group_id
string 이러한 요금제가 연결된 그룹의 ID입니다.
description
string 항목에 대한 지역화된 설명의 배열입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "description": [],
  "group_id": "charge",
  "name": "Channel2"
}
curl --request POST \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"description":[],"group_id":"charge","name":"Channel2"}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"description":[],"group_id":"charge","name":"Channel2"}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"description\":[],\"group_id\":\"charge\",\"name\":\"Channel2\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"description\":[],\"group_id\":\"charge\",\"name\":\"Channel2\"}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("POST", "/merchant/v2/projects/{project_id}/subscriptions/products", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"description\":[],\"group_id\":\"charge\",\"name\":\"Channel2\"}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"description\":[],\"group_id\":\"charge\",\"name\":\"Channel2\"}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products")
  .post(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "description": [],
  "group_id": "charge",
  "name": "Channel2"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "product_id": 171603
}
{
  "product_id": 171603
}
{
  "product_id": 171603
}
{
  "product_id": 171603
}
{
  "product_id": 171603
}
{
  "product_id": 171603
}
{
  "product_id": 171603
}
{
  "product_id": 171603
}

상품 업데이트

상품 업데이트.

HTTP 요청

PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}

파라미터 유형 설명
project_id
integer 프로젝트 ID.
product_id
integer 이러한 요금제가 연결된 상품의 ID입니다.
name
string 제품 이름입니다.
group_id
string 이러한 요금제가 연결된 그룹의 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}/

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "description": [],
  "group_id": "charge1323",
  "name": "Channel2123"
}
curl --request PUT \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}/ \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"description":[],"group_id":"charge1323","name":"Channel2123"}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"description":[],"group_id":"charge1323","name":"Channel2123"}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}/');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}/");
var request = new RestRequest(Method.PUT);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"description\":[],\"group_id\":\"charge1323\",\"name\":\"Channel2123\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"description\":[],\"group_id\":\"charge1323\",\"name\":\"Channel2123\"}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("PUT", "/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"description\":[],\"group_id\":\"charge1323\",\"name\":\"Channel2123\"}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"description\":[],\"group_id\":\"charge1323\",\"name\":\"Channel2123\"}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}/")
  .put(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "description": [],
  "group_id": "charge1323",
  "name": "Channel2123"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}/");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "description": [],
  "group_id": "charge13",
  "id": 1713603,
  "name": "Channel23"
}
{
  "description": [],
  "group_id": "charge13",
  "id": 1713603,
  "name": "Channel23"
}
{
  "description": [],
  "group_id": "charge13",
  "id": 1713603,
  "name": "Channel23"
}
{
  "description": [],
  "group_id": "charge13",
  "id": 1713603,
  "name": "Channel23"
}
{
  "description": [],
  "group_id": "charge13",
  "id": 1713603,
  "name": "Channel23"
}
{
  "description": [],
  "group_id": "charge13",
  "id": 1713603,
  "name": "Channel23"
}
{
  "description": [],
  "group_id": "charge13",
  "id": 1713603,
  "name": "Channel23"
}
{
  "description": [],
  "group_id": "charge13",
  "id": 1713603,
  "name": "Channel23"
}

상품 삭제

상품을 삭제합니다.

HTTP 요청

DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}

파라미터 유형 설명
project_id
integer 프로젝트 ID.
product_id
integer 이러한 요금제가 연결된 상품의 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request DELETE \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id} \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}');
$request->setRequestMethod('DELETE');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}");
var request = new RestRequest(Method.DELETE);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("DELETE", "/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}")
  .delete(null)
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답

제품 가져오기

모든 정기결제 상품을 나열합니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products

파라미터 유형 설명
project_id
integer 프로젝트 ID.
group_id
string 이러한 요금제가 연결된 그룹의 ID입니다.
product_id
integer 이러한 요금제가 연결된 상품의 ID입니다.
limit
integer 페이지 요소 개수 제한.
offset
integer 목록이 생성된 요소 개수(개수는 0부터 시작함).
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/subscriptions/products", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
[
  {
    "description": [],
    "group_id": "charge",
    "id": 714,
    "name": "Channel"
  },
  {
    "description": [],
    "group_id": "notify",
    "id": 715,
    "name": "notify"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 716,
    "name": "charge2"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 486,
    "name": "Channel2"
  }
]
[
  {
    "description": [],
    "group_id": "charge",
    "id": 714,
    "name": "Channel"
  },
  {
    "description": [],
    "group_id": "notify",
    "id": 715,
    "name": "notify"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 716,
    "name": "charge2"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 486,
    "name": "Channel2"
  }
]
[
  {
    "description": [],
    "group_id": "charge",
    "id": 714,
    "name": "Channel"
  },
  {
    "description": [],
    "group_id": "notify",
    "id": 715,
    "name": "notify"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 716,
    "name": "charge2"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 486,
    "name": "Channel2"
  }
]
[
  {
    "description": [],
    "group_id": "charge",
    "id": 714,
    "name": "Channel"
  },
  {
    "description": [],
    "group_id": "notify",
    "id": 715,
    "name": "notify"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 716,
    "name": "charge2"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 486,
    "name": "Channel2"
  }
]
[
  {
    "description": [],
    "group_id": "charge",
    "id": 714,
    "name": "Channel"
  },
  {
    "description": [],
    "group_id": "notify",
    "id": 715,
    "name": "notify"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 716,
    "name": "charge2"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 486,
    "name": "Channel2"
  }
]
[
  {
    "description": [],
    "group_id": "charge",
    "id": 714,
    "name": "Channel"
  },
  {
    "description": [],
    "group_id": "notify",
    "id": 715,
    "name": "notify"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 716,
    "name": "charge2"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 486,
    "name": "Channel2"
  }
]
[
  {
    "description": [],
    "group_id": "charge",
    "id": 714,
    "name": "Channel"
  },
  {
    "description": [],
    "group_id": "notify",
    "id": 715,
    "name": "notify"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 716,
    "name": "charge2"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 486,
    "name": "Channel2"
  }
]
[
  {
    "description": [],
    "group_id": "charge",
    "id": 714,
    "name": "Channel"
  },
  {
    "description": [],
    "group_id": "notify",
    "id": 715,
    "name": "notify"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 716,
    "name": "charge2"
  },
  {
    "description": [],
    "group_id": "charge",
    "id": 486,
    "name": "Channel2"
  }
]

정기결제

ID별로 특정한 정기결제 세부 정보를 얻습니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/{subscription_id}

파라미터 유형 설명
project_id
integer 프로젝트 ID. 필수.
subscription_id
integer 정기결제 ID입니다. 필수.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/{subscription_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/{subscription_id} \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/{subscription_id}');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/{subscription_id}");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/subscriptions/{subscription_id}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/{subscription_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/{subscription_id}")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/{subscription_id}");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "charge_amount": 0.03,
  "comment": "The subscription was not extended in due time\r",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": "2019-02-06T12:43:04+0300",
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 249579,
  "plan": {
    "external_id": "lowcost",
    "id": 601
  },
  "product": null,
  "status": "canceled",
  "user": {
    "id": "user1",
    "name": "John Smith"
  }
}
{
  "charge_amount": 0.03,
  "comment": "The subscription was not extended in due time\r",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": "2019-02-06T12:43:04+0300",
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 249579,
  "plan": {
    "external_id": "lowcost",
    "id": 601
  },
  "product": null,
  "status": "canceled",
  "user": {
    "id": "user1",
    "name": "John Smith"
  }
}
{
  "charge_amount": 0.03,
  "comment": "The subscription was not extended in due time\r",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": "2019-02-06T12:43:04+0300",
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 249579,
  "plan": {
    "external_id": "lowcost",
    "id": 601
  },
  "product": null,
  "status": "canceled",
  "user": {
    "id": "user1",
    "name": "John Smith"
  }
}
{
  "charge_amount": 0.03,
  "comment": "The subscription was not extended in due time\r",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": "2019-02-06T12:43:04+0300",
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 249579,
  "plan": {
    "external_id": "lowcost",
    "id": 601
  },
  "product": null,
  "status": "canceled",
  "user": {
    "id": "user1",
    "name": "John Smith"
  }
}
{
  "charge_amount": 0.03,
  "comment": "The subscription was not extended in due time\r",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": "2019-02-06T12:43:04+0300",
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 249579,
  "plan": {
    "external_id": "lowcost",
    "id": 601
  },
  "product": null,
  "status": "canceled",
  "user": {
    "id": "user1",
    "name": "John Smith"
  }
}
{
  "charge_amount": 0.03,
  "comment": "The subscription was not extended in due time\r",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": "2019-02-06T12:43:04+0300",
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 249579,
  "plan": {
    "external_id": "lowcost",
    "id": 601
  },
  "product": null,
  "status": "canceled",
  "user": {
    "id": "user1",
    "name": "John Smith"
  }
}
{
  "charge_amount": 0.03,
  "comment": "The subscription was not extended in due time\r",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": "2019-02-06T12:43:04+0300",
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 249579,
  "plan": {
    "external_id": "lowcost",
    "id": 601
  },
  "product": null,
  "status": "canceled",
  "user": {
    "id": "user1",
    "name": "John Smith"
  }
}
{
  "charge_amount": 0.03,
  "comment": "The subscription was not extended in due time\r",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": "2019-02-06T12:43:04+0300",
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 249579,
  "plan": {
    "external_id": "lowcost",
    "id": 601
  },
  "product": null,
  "status": "canceled",
  "user": {
    "id": "user1",
    "name": "John Smith"
  }
}

정기결제 업데이트

자동 정기결제를 업데이트합니다. 정기결제 상태('active', 'canceled' 또는 'non_renewing')를 갱신하고 현재 정기결제 요금제에 대한 다음 결제의 시행 날짜를 연기할 수 있습니다.

HTTP 요청

PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}

파라미터 유형 설명
project_id
integer 프로젝트 ID.
subscription_id
integer 정기결제 ID입니다.
user_id
string 사용자 ID.
status
string 상태: active/canceled/non_renewing.
cancel_subscription_payment
boolean true로 설정된 경우, 이 구독에서 이루어진 지난 결제액이 환불됩니다. 이 옵션은 상태가 canceled로 변경된 경우에만 작동합니다.
timeshift
object 청구 연기.
timeshift.type
string 청구 기간 단위. '일' 또는 '월' 사용.
timeshift.value
string 청구를 연기하는 기간 단위 수입니다. 값은 timeshift.type 매개변수의 값에 따라 달라지며
  • timeshift.type가 '일'인 경우 1에서 366 사이에서
  • timeshift.type가 '월'인 경우 1에서 12 사이에서 값을 지정할 수 있습니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}

Headers:
  Authorization: Basic <your_authorization_basic_key>
Content-Type: application/json

Body:
  {
  "comment": "Canceled by the user with the latest payment refund",
  "status": "active"
}
curl --request PUT \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id} \
  --header 'authorization: Basic <your_authorization_basic_key>' \
  --header 'content-type: application/json' \
  --data '{"comment":"Canceled by the user with the latest payment refund","status":"active"}'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"comment":"Canceled by the user with the latest payment refund","status":"active"}');

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>',
  'content-type' => 'application/json'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}");
var request = new RestRequest(Method.PUT);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"comment\":\"Canceled by the user with the latest payment refund\",\"status\":\"active\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

payload = "{\"comment\":\"Canceled by the user with the latest payment refund\",\"status\":\"active\"}"

headers = {
    'content-type': "application/json",
    'authorization': "Basic <your_authorization_basic_key>"
    }

conn.request("PUT", "/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Basic <your_authorization_basic_key>'
request.body = "{\"comment\":\"Canceled by the user with the latest payment refund\",\"status\":\"active\"}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"comment\":\"Canceled by the user with the latest payment refund\",\"status\":\"active\"}");
Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}")
  .put(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = JSON.stringify({
  "comment": "Canceled by the user with the latest payment refund",
  "status": "active"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
{
  "charge_amount": 0.03,
  "comment": "Canceled by the user with the latest payment refund",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": null,
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 24953579,
  "plan": {
    "charge": {
      "amount": 0.03,
      "currency": "USD",
      "period": {
        "type": "day",
        "value": 1
      }
    },
    "description": null,
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "lowcost",
    "grace_period": {
      "type": "day",
      "value": 2
    },
    "group_id": "newPlans",
    "id": 66001,
    "localized_name": null,
    "name": null,
    "project_id": 18404,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  "product": null,
  "status": "active",
  "user": {
    "id": "jb1",
    "name": "J.Black"
  }
}
{
  "charge_amount": 0.03,
  "comment": "Canceled by the user with the latest payment refund",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": null,
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 24953579,
  "plan": {
    "charge": {
      "amount": 0.03,
      "currency": "USD",
      "period": {
        "type": "day",
        "value": 1
      }
    },
    "description": null,
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "lowcost",
    "grace_period": {
      "type": "day",
      "value": 2
    },
    "group_id": "newPlans",
    "id": 66001,
    "localized_name": null,
    "name": null,
    "project_id": 18404,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  "product": null,
  "status": "active",
  "user": {
    "id": "jb1",
    "name": "J.Black"
  }
}
{
  "charge_amount": 0.03,
  "comment": "Canceled by the user with the latest payment refund",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": null,
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 24953579,
  "plan": {
    "charge": {
      "amount": 0.03,
      "currency": "USD",
      "period": {
        "type": "day",
        "value": 1
      }
    },
    "description": null,
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "lowcost",
    "grace_period": {
      "type": "day",
      "value": 2
    },
    "group_id": "newPlans",
    "id": 66001,
    "localized_name": null,
    "name": null,
    "project_id": 18404,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  "product": null,
  "status": "active",
  "user": {
    "id": "jb1",
    "name": "J.Black"
  }
}
{
  "charge_amount": 0.03,
  "comment": "Canceled by the user with the latest payment refund",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": null,
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 24953579,
  "plan": {
    "charge": {
      "amount": 0.03,
      "currency": "USD",
      "period": {
        "type": "day",
        "value": 1
      }
    },
    "description": null,
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "lowcost",
    "grace_period": {
      "type": "day",
      "value": 2
    },
    "group_id": "newPlans",
    "id": 66001,
    "localized_name": null,
    "name": null,
    "project_id": 18404,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  "product": null,
  "status": "active",
  "user": {
    "id": "jb1",
    "name": "J.Black"
  }
}
{
  "charge_amount": 0.03,
  "comment": "Canceled by the user with the latest payment refund",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": null,
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 24953579,
  "plan": {
    "charge": {
      "amount": 0.03,
      "currency": "USD",
      "period": {
        "type": "day",
        "value": 1
      }
    },
    "description": null,
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "lowcost",
    "grace_period": {
      "type": "day",
      "value": 2
    },
    "group_id": "newPlans",
    "id": 66001,
    "localized_name": null,
    "name": null,
    "project_id": 18404,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  "product": null,
  "status": "active",
  "user": {
    "id": "jb1",
    "name": "J.Black"
  }
}
{
  "charge_amount": 0.03,
  "comment": "Canceled by the user with the latest payment refund",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": null,
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 24953579,
  "plan": {
    "charge": {
      "amount": 0.03,
      "currency": "USD",
      "period": {
        "type": "day",
        "value": 1
      }
    },
    "description": null,
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "lowcost",
    "grace_period": {
      "type": "day",
      "value": 2
    },
    "group_id": "newPlans",
    "id": 66001,
    "localized_name": null,
    "name": null,
    "project_id": 18404,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  "product": null,
  "status": "active",
  "user": {
    "id": "jb1",
    "name": "J.Black"
  }
}
{
  "charge_amount": 0.03,
  "comment": "Canceled by the user with the latest payment refund",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": null,
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 24953579,
  "plan": {
    "charge": {
      "amount": 0.03,
      "currency": "USD",
      "period": {
        "type": "day",
        "value": 1
      }
    },
    "description": null,
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "lowcost",
    "grace_period": {
      "type": "day",
      "value": 2
    },
    "group_id": "newPlans",
    "id": 66001,
    "localized_name": null,
    "name": null,
    "project_id": 18404,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  "product": null,
  "status": "active",
  "user": {
    "id": "jb1",
    "name": "J.Black"
  }
}
{
  "charge_amount": 0.03,
  "comment": "Canceled by the user with the latest payment refund",
  "currency": "USD",
  "date_create": "2018-09-21T16:54:59+0300",
  "date_end": null,
  "date_last_charge": "2018-09-21T16:55:05+0300",
  "date_next_charge": "2018-09-21T16:55:05+0300",
  "id": 24953579,
  "plan": {
    "charge": {
      "amount": 0.03,
      "currency": "USD",
      "period": {
        "type": "day",
        "value": 1
      }
    },
    "description": null,
    "expiration": {
      "type": "day",
      "value": 0
    },
    "external_id": "lowcost",
    "grace_period": {
      "type": "day",
      "value": 2
    },
    "group_id": "newPlans",
    "id": 66001,
    "localized_name": null,
    "name": null,
    "project_id": 18404,
    "status": {
      "counters": {
        "active": 0,
        "canceled": 0,
        "frozen": 0,
        "non_renewing": 0
      },
      "value": "active"
    },
    "tags": null,
    "trial": {
      "type": "day",
      "value": 0
    },
    "type": "all"
  },
  "product": null,
  "status": "active",
  "user": {
    "id": "jb1",
    "name": "J.Black"
  }
}

모든 정기결제 나열

모든 자동 정기결제를 나열합니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/plans/{plan_id}/subscriptions

파라미터 유형 설명
project_id
integer 프로젝트 ID. 필수.
user_id
string 사용자 ID. 필수.
status
string 상태: active/canceled/non_renewing.
limit
integer 페이지 요소 개수 제한.
offset
integer 목록이 생성된 요소 개수(개수는 0부터 시작함).
datetime_from
datetime 날짜 범위의 시작입니다.
datetime_to
datetime 날짜 범위의 끝입니다.
plan_id
integer 요금제 ID입니다.
product_id
integer 이러한 요금제가 연결된 상품의 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/plans/{plan_id}/subscriptions

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url https://api.xsolla.com/merchant/v2/projects/{project_id}/plans/{plan_id}/subscriptions \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/plans/{plan_id}/subscriptions');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/plans/{plan_id}/subscriptions");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/plans/{plan_id}/subscriptions", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/plans/{plan_id}/subscriptions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/plans/{plan_id}/subscriptions")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.xsolla.com/merchant/v2/projects/{project_id}/plans/{plan_id}/subscriptions");
xhr.setRequestHeader("authorization", "Basic <your_authorization_basic_key>");

xhr.send(data);
응답
[
  {
    "charge_amount": 19.99,
    "comment": "Cancelled by the project\r",
    "currency": "USD",
    "date_create": "2015-04-11T22:30:38+0300",
    "date_end": "2015-10-09T12:52:54+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-11T22:30:38+0300",
    "id": 14889,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  },
  {
    "charge_amount": 19.99,
    "comment": null,
    "currency": "USD",
    "date_create": "2015-04-08T18:41:42+0300",
    "date_end": "2015-04-09T16:30:14+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-08T18:41:42+0300",
    "id": 14513,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  }
]
[
  {
    "charge_amount": 19.99,
    "comment": "Cancelled by the project\r",
    "currency": "USD",
    "date_create": "2015-04-11T22:30:38+0300",
    "date_end": "2015-10-09T12:52:54+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-11T22:30:38+0300",
    "id": 14889,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  },
  {
    "charge_amount": 19.99,
    "comment": null,
    "currency": "USD",
    "date_create": "2015-04-08T18:41:42+0300",
    "date_end": "2015-04-09T16:30:14+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-08T18:41:42+0300",
    "id": 14513,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  }
]
[
  {
    "charge_amount": 19.99,
    "comment": "Cancelled by the project\r",
    "currency": "USD",
    "date_create": "2015-04-11T22:30:38+0300",
    "date_end": "2015-10-09T12:52:54+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-11T22:30:38+0300",
    "id": 14889,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  },
  {
    "charge_amount": 19.99,
    "comment": null,
    "currency": "USD",
    "date_create": "2015-04-08T18:41:42+0300",
    "date_end": "2015-04-09T16:30:14+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-08T18:41:42+0300",
    "id": 14513,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  }
]
[
  {
    "charge_amount": 19.99,
    "comment": "Cancelled by the project\r",
    "currency": "USD",
    "date_create": "2015-04-11T22:30:38+0300",
    "date_end": "2015-10-09T12:52:54+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-11T22:30:38+0300",
    "id": 14889,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  },
  {
    "charge_amount": 19.99,
    "comment": null,
    "currency": "USD",
    "date_create": "2015-04-08T18:41:42+0300",
    "date_end": "2015-04-09T16:30:14+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-08T18:41:42+0300",
    "id": 14513,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  }
]
[
  {
    "charge_amount": 19.99,
    "comment": "Cancelled by the project\r",
    "currency": "USD",
    "date_create": "2015-04-11T22:30:38+0300",
    "date_end": "2015-10-09T12:52:54+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-11T22:30:38+0300",
    "id": 14889,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  },
  {
    "charge_amount": 19.99,
    "comment": null,
    "currency": "USD",
    "date_create": "2015-04-08T18:41:42+0300",
    "date_end": "2015-04-09T16:30:14+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-08T18:41:42+0300",
    "id": 14513,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  }
]
[
  {
    "charge_amount": 19.99,
    "comment": "Cancelled by the project\r",
    "currency": "USD",
    "date_create": "2015-04-11T22:30:38+0300",
    "date_end": "2015-10-09T12:52:54+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-11T22:30:38+0300",
    "id": 14889,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  },
  {
    "charge_amount": 19.99,
    "comment": null,
    "currency": "USD",
    "date_create": "2015-04-08T18:41:42+0300",
    "date_end": "2015-04-09T16:30:14+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-08T18:41:42+0300",
    "id": 14513,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  }
]
[
  {
    "charge_amount": 19.99,
    "comment": "Cancelled by the project\r",
    "currency": "USD",
    "date_create": "2015-04-11T22:30:38+0300",
    "date_end": "2015-10-09T12:52:54+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-11T22:30:38+0300",
    "id": 14889,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  },
  {
    "charge_amount": 19.99,
    "comment": null,
    "currency": "USD",
    "date_create": "2015-04-08T18:41:42+0300",
    "date_end": "2015-04-09T16:30:14+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-08T18:41:42+0300",
    "id": 14513,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  }
]
[
  {
    "charge_amount": 19.99,
    "comment": "Cancelled by the project\r",
    "currency": "USD",
    "date_create": "2015-04-11T22:30:38+0300",
    "date_end": "2015-10-09T12:52:54+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-11T22:30:38+0300",
    "id": 14889,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  },
  {
    "charge_amount": 19.99,
    "comment": null,
    "currency": "USD",
    "date_create": "2015-04-08T18:41:42+0300",
    "date_end": "2015-04-09T16:30:14+0300",
    "date_last_charge": null,
    "date_next_charge": "2015-05-08T18:41:42+0300",
    "id": 14513,
    "product": null,
    "status": "canceled",
    "user": {
      "id": "user_1",
      "name": "John Smith"
    }
  }
]

모든 결제 나열

모든 정기결제를 나열합니다.

HTTP 요청

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/payments

파라미터 유형 설명
project_id
integer 프로젝트 ID.
user_id
string 사용자 ID.
status
string 상태: processing/canceled/done.
limit
integer 페이지 요소 개수 제한.
offset
integer 목록이 생성된 요소 개수(개수는 0부터 시작함).
datetime_from
datetime 날짜 범위의 시작입니다.
datetime_to
datetime 날짜 범위의 끝입니다.
subscription_id
integer 정기결제 ID입니다.
Copy
Full screen
http
  • http
  • curl
  • php
  • C#
  • python
  • ruby
  • java
  • js
요청
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/payments?limit=100

Headers:
  Authorization: Basic <your_authorization_basic_key>
curl --request GET \
  --url 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/payments?limit=100' \
  --header 'authorization: Basic <your_authorization_basic_key>'
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/payments');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString(array(
  'limit' => '100'
)));

$request->setHeaders(array(
  'authorization' => 'Basic <your_authorization_basic_key>'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
var client = new RestClient("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/payments?limit=100");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Basic <your_authorization_basic_key>");
IRestResponse response = client.Execute(request);
import http.client

conn = http.client.HTTPSConnection("api.xsolla.com")

headers = { 'authorization': "Basic <your_authorization_basic_key>" }

conn.request("GET", "/merchant/v2/projects/{project_id}/subscriptions/payments?limit=100", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/payments?limit=100")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Basic <your_authorization_basic_key>'

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/payments?limit=100")
  .get()
  .addHeader("authorization", "Basic <your_authorization_basic_key>")
  .build();

Response response = client.newCall(request).execute();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this<