Einführung
Die Xsolla-API basiert auf REST. Die API hat vorhersehbare, ressourcenorientierte URLs und verwendet HTTP-Statuscodes, um auf API-Fehler hinzuweisen.
Die API nutzt integrierte HTTP-Funktionen wie HTTP-Authentifizierung und HTTP-Methoden, die von gängigen HTTP-Clients interpretiert werden können. Die Schnittstelle unterstützt Cross-Origin Resource Sharing und gestattet Ihnen dadurch den sicheren Zugriff auf die API über eine clientseitige Webanwendung.
Die API antwortet stets im JSON-Dateiformat, auch im Falle von Fehlern.
Endpunktpfade
Die Endpunkte der Xsolla-API befinden sich unterhttps://api.xsolla.com
. Beispielsweise lautet die vollständige Pfadangabe für den Endpunkt des Typs "Projekte auflisten": https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/projects
Die meisten Endpunktpfade enthalten die merchant_id als Paramater. Dadurch ist ersichtlich, dass die Anwendung in Ihrem Auftrag handelt.
Endpunkte der Xsolla-Anmeldeschnittstelle befinden sich unter https://login.xsolla.com
.
API-Endpunkt
https://api.xsolla.com
https://api.xsolla.com
https://api.xsolla.com
Anfrage und Antwort
Anfragen an die Xsolla API-Endpunkte müssen die folgenden HTTP-Headerfelder enthalten: Authorization, Accept
POST- und PUT-Anfragen müssen einen zusätzlichen Header enthalten: Content-Type: application/json
Alle Endpunkt-Antworten enthalten standardmäßig JSON-Daten im Nachrichtenrumpf und beinhalten außerdem einen Content-Type: application/json
Header.
Header
Authorization: Basic AUTHORIZATION_BASE64_ENCODED_STRING
Accept: application/json
Content-Type: application/json
Authorization: Basic AUTHORIZATION_BASE64_ENCODED_STRING
Accept: application/json
Content-Type: application/json
Authorization: Basic AUTHORIZATION_BASE64_ENCODED_STRING
Accept: application/json
Content-Type: application/json
API-Änderungen
Xsolla kann die API-Funktionalität folgendermaßen ändern:
Neue API-Ressourcen hinzufügen;
Optionale Anfrageparameter hinzufügen;
Bestehenden API-Antworten neue Eigenschaften hinzufügen;
Bestehenden Parametern, die über zählbare Werte verfügen, neue Werte hinzufügen;
Neue Arten von Webhooks und neue JSON-Parameter hinzufügen;
Optionale HTTP-Anfrage-Header hinzufügen;
Anfragen, bei denen gültigen Parametern ungültige Werte zugeordnet wurden, ablehnen.
Unzulässig formatierte Anfragen, welche zuvor aufgrund von tolerantem Parsing akzeptiert wurden, ablehnen, falls sich die Logik des Parsers geändert hat. Undokumentierte Funktionen jederzeit hinzufügen, ändern oder entfernen.
Ihr Client sollte, unabhängig von derartigen Änderungen funktionsfähig bleiben. Beispielsweise sollten neue JSON-Parameter, welche von Ihrem Client nicht erkannt werden, den normalen Betrieb des Clients nicht behindern.
Versionierung
Alle Xsolla-API-Methoden unterstützen Versionierung. Wir werden immer dann eine neue Version veröffentlichen, wenn es Änderungen gibt, die mit der aktuellen Version nicht kompatibel sind. Die Version ist in der URL durch die Angabe von "v1"/"v2"/usw., welche auf das Präfix "/merchant" folgt, identifizierbar.
Nutzen Sie bitte die neuste Version, falls Sie das erste Mal mit der API arbeiten. Wenn Sie die Versionsangabe weglassen, verwenden wir standardmäßig die erste Version. Denken Sie bitte daran, dass wir API-Integrität nur innerhalb der gleichen Version garantieren können.
Authentifizierung
Xsolla nutzt HTTP Basic Authentication. Geben Sie Ihre Händler-ID als Basic-Auth-Nutzername und den API-Schlüssel (siehe Xsolla Kundenportal > Einstellungen) als Passwort an.
Alle API-Anfragen müssen über HTTPS versendet werden. Anfragen via HTTP werden nicht funktionieren.
Stellen Sie sicher, dass die Authentifizierungsdaten bei jeder Anfrage enthalten sind.
Bitte beachten Sie außerdem, dass Sie TLS 1.2 oder höher verwenden müssen, um die API nutzen zu können.
Beispiel
<?php
use Xsolla\SDK\API\XsollaClient;
$xsollaClient = XsollaClient::factory(array(
'merchant_id' => MERCHANT_ID,
'api_key' => API_KEY
));
GET /merchant/v2/merchants/{merchant_id}/events/messages HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/events/messages' \
-X GET \
-u merchant_id:merchant_api_key
Typen von Endpunkten
Der Endpunkttyp gibt an, welche Art von Daten der Endpunkt verarbeitet und welche Aktionen ausgeführt werden. Die häufigsten Aktionen sind:
Aktion | HTTP-Methode | Beschreibung |
---|---|---|
Erstellen | POST | Erstellt und speichert eine Entität des angegebenen Typs. |
Auflisten | GET | Liefert eine Liste von Entitäten, die der Anfrage entsprechen. Um Details zu einer Entität anzufordern, muss zuerst deren ID mit Hilfe des Endpunkttyps "Auflisten" bestimmt werden. Danach muss diese ID am entsprechenden Endpunkt (Typ: "Abrufen") bereitgestellt werden. |
Abrufen | GET | Liefert detaillierte Angaben zur Entität mit der angegebenen ID. |
Ersetzen | PUT | Modifiziert alle Felder der Entität mit der angegebenen ID. |
Aktualisieren | PATCH | Modifiziert bestimmte Felder der Entität mit der angegebenen ID. |
Löschen | DELETE | Löscht die Entität mit der angegebenen ID. |
Datumsformat
Alle Datumsangaben sind spezifiziert als Strings gemäß ISO 8601.
Sie können die Datumstrings entweder als UTC (z. B.: 2013-01-15T00:00:00Z) angeben oder die Abweichung von der UTC anzeigen lassen (z. B.: 2013-01-15T00:00:00-08:00 bei acht Stunden hinter der UTC). Im letzteren Fall ist darauf zu achten, dass gegebenenfalls die Sommerzeit berücksichtigt werden muss.
Paginierung
Endpunkte des Typs "Auflisten" können die gelieferten Ergebnisse paginieren. Anstelle alle Ergebnisse in einer einzigen Antwort zu versenden, können diese Endpunkte einige der Ergebnisse gemeinsam mit einem Antwort-Header zurückgeben, welcher zu den nächsten Ergebnissen verlinkt. Zu diesem Zweck verwenden wir Offset- und Limit-Parameter.
Senden Sie eine weitere Anfrage (einschließlich aller üblichen Header) an die nächste URL, um die nächsten Ergebnisse abzurufen. Wiederholen Sie diesen Schritt, bis Sie eine Antwort ohne anschließende URL erhalten.
Fehlerbehandlung
Xsolla verwendet konventionelle HTTP-Statuscodes, um zu verdeutlichen, ob die API-Anfrage erfolgreich war. Im Allgemeinen steht 2xx für eine erfolgreiche Anfrage, 4xx weist auf einen Fehler bei den bereitgestellten Daten hin (z. B.: Fehlen eines erforderlichen Parameters, fehlgeschlagene Autorisierung usw.) und 5xx deutet auf ein Problem mit Xsollas Servern hin.
Jedoch entsprechen nicht alle Fehler exakt den HTTP-Statuscodes. Beispielsweise wird die API den Fehlercode '422' zurückgeben, falls eine Anfrage gültig war, aber fehlgeschlagen ist.
Alle API-Fehlerrückmeldungen liefern ein JSON-Objekt mit folgenden Feldern:
Bezeichnung | Typ | Beschreibung |
---|---|---|
http_status_code | int | HTTP-Code. |
message | string | Eine für Menschen verständliche Meldung, welche den Fehler beschreibt. Diese Nachricht wird immer in englischer Sprache ausgegeben. Verlassen Sie sich bei einem bestimmten Fehler nicht auf die Aussagekraft der Meldung, da sich diese Nachricht in Zukunft ändern könnte. |
extended_message | string | Detailliertere Fehlerbeschreibung. |
request_id | string | Eindeutige Request-ID, die wir eventuell für die Fehlersuche verwenden können. |
Liste der unterstützten HTTP-Statuscodes:
- 200, 201, 204 — Kein Fehler.
- 400 Bad Request — Weist oftmals darauf hin, dass ein erforderlicher Parameter fehlt. Weitere Informationen finden Sie im Nachrichtenrumpf.
- 401 Unauthorized — Kein gültiger API-Schlüssel bereitgestellt.
- 402 Request Failed — Anfrage trotz gültiger Parameter fehlgeschlagen.
- 403 Forbidden — Keine Berechtigung. Weitere Informationen finden Sie im Nachrichtenrumpf.
- 404 Not Found — Die angeforderte Ressource konnte nicht gefunden werden.
- 409, 422 — Ungültige Anfrageparameter.
- 412 Precondition Failed — Das Projekt wurde noch nicht aktiviert (wird bei der "GetToken-Methode" verwendet).
- 415 Unsupported Media Type — Im HTTP-Header fehlt die Angabe "Content-Type: application/json".
- 500, 502, 503, 504 Server Errors — Etwas ist schief gelaufen.
Beispiel einer Fehlerrückmeldung:
- {
- "http_status_code": 500.
- "message": "Internal Server Error",
- "extended_message": null,
- "request_id": "6445b85"
- }
Token
Aus Sicherheitsgründen behandelt die Xsolla-Bezahlschnittstelle Parameter innerhalb eines Tokens, anstatt sie direkt über GET-Anfragemethode zu empfangen. Sie müssen vor dem Aufbau der Zahlungsseite einen neuen Token beziehen. Ein Token ist 24 Stunden lang gültig.
Sie können einen Token mit beliebigen Nutzerparametern erstellen. Senden Sie diese Parameter beim Beziehen des Tokens. Wir senden diese Parameter nach erfolgreicher Bezahlung an Sie zurück. Ein Token kann ausschließlich Parameter enthalten, die entweder in diesem Dokument beschrieben sind oder vom Partner vorher definiert wurden.
Parameter | Typ | Beschreibung |
---|---|---|
user | object | Benutzerdaten (Objekt) |
user.id | object | Benutzer-ID (Objekt). Erforderlich. |
user.id.value | string | Benutzer-ID. |
user.id.hidden | boolean | Legt fest, ob die Benutzer-ID auf dem Zahlungsportal angezeigt wird. Standardwert ist 'true'. |
user.id.allow_modify | boolean | Legt fest, ob der Benutzer das Feld im Zahlungsportal bearbeiten kann. Standardwert ist 'false'. |
user.name | object | Benutzername (Objekt). |
user.name.value | string | Benutzername. |
user.name.hidden | boolean | Legt fest, ob die Benutzer-ID auf dem Zahlungsportal angezeigt wird. Standardwert ist 'true'. |
user.name.allow_modify | boolean | Legt fest, ob der Benutzer das Feld im Zahlungsportal bearbeiten kann. Standardwert ist 'false'. |
user.email | object | E-Mail des Benutzers (Objekt). |
user.email.value | string | E-Mail des Benutzers. |
user.email.hidden | boolean | Legt fest, ob die Benutzer-ID auf dem Zahlungsportal angezeigt wird. Standardwert ist 'true'. |
user.email.allow_modify | boolean | Legt fest, ob der Benutzer das Feld im Zahlungsportal bearbeiten kann. Standardwert ist 'false'. |
user.phone | object | Telefonnummer des Benutzers (Objekt). |
user.phone.value | string | Telefonnummer des Benutzers. |
user.phone.hidden | boolean | Legt fest, ob die Benutzer-ID auf dem Zahlungsportal angezeigt wird. Standardwert ist 'true'. |
user.phone.allow_modify | boolean | Legt fest, ob der Benutzer das Feld im Zahlungsportal bearbeiten kann. Standardwert ist 'false'. |
user.country | object | Land des Benutzers (Objekt). |
user.country.value | string | Ländercode, bestehend aus 2 Großbuchstaben gemäß ISO 3166-1 alpha-2. |
user.country.allow_modify | boolean | Legt fest, ob der Benutzer das Feld im Zahlungsportal bearbeiten kann. Standardwert ist 'false'. |
user.attributes | object | Benutzerattribute zum Filtern der Liste der Gegenstände; repräsentiert durch eine gültige Reihe von JSON-Objekten bestehend aus Schlüssel-Wert-Paaren. |
user.steam_id | object | Steam-ID des Benutzers (Objekt). |
user.steam_id.value | string | Steam-ID. |
user.tracking_id | object | Tracking-ID des Benutzers (Objekt). |
user.tracking_id.value | string | Eindeutige Tracking-ID (wird bei Marketingkampagnen verwendet). |
user.public_id.value | string | Parameter, durch den der Benutzer eindeutig identifizierbar ist und der dem Benutzer bekannt ist (E-Mail, Benutzername, usw.). Gestattet dem Benutzer, Käufe außerhalb des Game-Stores zu tätigen (z. B. via Verkaufsterminals). |
user.utm | object | Datenverkehrsattribute (Objekt). |
user.utm.utm_source | string | Ursprung des Datenverkehrs. |
user.utm.utm_medium | string | Datenverkehrskanal (kontextbezogene Anzeigen, mediale Anzeigen, E-Mail-Listen, usw.). |
user.utm.utm_campaign | string | Kampagnenbezeichnung, ins Englische transliteriert oder übersetzt. |
user.utm.utm_term | string | Kampagnen-Keyword. Falls festgelegt, basieren die Statistiken auf den Keywords, die für die Zielgruppenwerbung verwendet werden, anstatt auf spezifischen Suchanfragen. In Google Analytics ist der angegebene utm_term Teil des allgemeinen Berichts zu Suchbegriffen. |
user.utm.utm_content | string | Kampagneninhalt. |
settings | object | Benutzerdefinierte Projekteinstellungen (Objekt). |
settings.external_id | string | Externe ID der Transaktion. |
settings.project_id | int | Xsolla-ID des Spiels. Kann im Kundenportal eingesehen werden. Erforderlich. |
settings.language | string | Sprache der Benutzeroberfläche. Sprachencode, bestehend aus 2 Kleinbuchstaben gemäß ISO 639-1. |
settings.return_url | string | Seite, zu welcher der Benutzer nach der Zahlung weitergeleitet wird. Die folgenden Parameter werden dem Link automatisch hinzugefügt: user_id, foreinginvoice, invoice_id, status. |
settings.currency | string | Bevorzugte Zahlungswährung. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
settings.mode | string | Legen Sie als Wert "sandbox" fest, um den Zahlungsvorgang auszutesten. Für einen solchen Fall nutzen Sie https://sandbox-secure.xsolla.com, um das Zahlungsportal auszutesten. |
settings.payment_method | int | ID der Zahlungsart. |
settings.payment_widget | string | Zahlungs-Widget. Kann 'paybycash' oder 'giftcard' sein. Wenn der Parameter festgelegt ist, wird der Benutzer entsprechend zum Widget "Pay by Cash" oder zum Widget "Gift Cards" weitergeleitet. |
settings.ui | object | Schnittstellen-Einstellungen (Objekt). |
settings.ui.theme | string | Theme des Zahlungsportals. Als Wert lässt sich entweder 'default' (voreingestellt) oder 'dark' festlegen. |
settings.ui.size | string | Größe des Zahlungsportals. Folgende Größen sind möglich:
|
settings.ui.version | string | Gerätetyp. Als Wert lässt sich entweder 'desktop' (voreingestellt) oder 'mobile' festlegen. |
settings.ui.desktop | object | Schnittstellen-Einstellungen für die Desktop-Version (Objekt). |
settings.ui.desktop.header | object | Einstellungen für den Header (Objekt). |
settings.ui.desktop.header.is_visible | boolean | Legt fest, ob der Header im Zahlungsportal angezeigt wird. |
settings.ui.desktop.header.visible_logo | boolean | Falls der Wert true festgelegt ist, erscheint Ihr Logo im Header (bitte senden Sie dazu das Logo als Bilddatei an Ihren Account Manager). |
settings.ui.desktop.header.visible_name | boolean | Legt fest, ob der Projektname im Header angezeigt wird. |
settings.ui.desktop.header.type | string | Erscheinungsbild des Headers. Als Wert lässt sich entweder 'compact' (Projektname und Benutzer-ID sind ausgeblendet) oder 'normal' (voreingestellt) festlegen. |
settings.ui.desktop.subscription_list | object | Einstellungen zur Liste der Abo-Modelle (Objekt). |
settings.ui.desktop.subscription_list.layout | string | Listenvorlage. Als Wert lässt sich entweder 'list' (voreingestellt) oder 'grid' festlegen. |
settings.ui.desktop.subscription_list.description | string | Jeglicher Text, der im Zahlungsportal oberhalb der Liste der verfügbaren Abo-Modelle angezeigt werden soll. |
settings.ui.desktop.subscription_list.display_local_price | boolean | Falls als Wert true festgelegt ist und falls die Landeswährung des Benutzers sich von der für das Abo-Modell festgelegten Währung unterscheidet, werden dem Benutzer beide Preise angezeigt: Einer in der Landes- und der andere in der Basiswährung. |
settings.ui.desktop.virtual_item_list | object | Einstellungen zur Liste der virtuellen Gegenstände (Objekt). |
settings.ui.desktop.virtual_item_list.layout | string | Listenvorlage. Als Wert lässt sich entweder 'list' (voreingestellt) oder 'grid' festlegen. |
settings.ui.desktop.virtual_item_list.button_with_price | boolean | Falls als Wert true festgelegt ist, wird der Preis auf der Schaltfläche angezeigt. Falls false festgelegt ist, wird der Preis links neben der Schaltfläche angezeigt. Standardwert ist False. |
settings.ui.desktop.virtual_items_list.view | string | Virtuelle Gruppe an Elementen in vertikalem/horizontalem Menü anzeigen. Es kann 'horizontal_navigation' oder 'vertical' (Standard) sein. |
settings.ui.desktop.virtual_currency_list | object | Einstellungen zur Liste der virtuellen Währungen (Objekt). |
settings.ui.desktop.virtual_currency_list.description | string | Jeglicher Text, zur Anzeige oberhalb der Liste der virtuellen Währungen. |
settings.ui.desktop.virtual_currency_list.button_with_price | boolean | Falls als Wert true festgelegt ist, wird der Preis auf der Schaltfläche angezeigt. Falls false festgelegt ist, wird der Preis links neben der Schaltfläche angezeigt. Standardwert ist False. |
settings.ui.header.visible_virtual_currency_balance | boolean | Legt fest, ob die Benutzer-ID auf dem Zahlungsportal angezeigt wird. Standardwert ist ‘true’. |
settings.ui.mobile.mode | string | Ein Benutzer kann nur mit seinen gespeicherten Zahlungsarten bezahlen. Als Wert lässt sich lediglich 'saved_accounts' festlegen. |
settings.ui.mobile.header.close_button | boolean | Legt fest, ob eine X-Schaltfläche zum Schließen des Zahlungsportals angezeigt wird, welche den Benutzer nach Betätigung zur im Parameter settings.return_url festgelegten URL weiterleitet. Standardwert ist False. |
settings.ui.mobile.footer.is_visible | boolean | Legt fest, ob der Footer in der mobilen Version des Zahlungsportals ausgeblendet ist. |
settings.ui.license_url | string | Link zur EULA. |
settings.ui.components | object | Menü-Einstellungen (Objekt). |
settings.ui.components.virtual_items | object | Untermenü "Virtuelle Gegenstände". |
settings.ui.components.virtual_items.order | int | Position des Untermenüs im Hauptmenü. |
settings.ui.components.virtual_items.hidden | boolean | Legt fest, ob das Untermenü angezeigt wird. |
settings.ui.components.virtual_items.selected_group | string | Gruppe, die nach dem Öffnen der Registerkarte "Virtuelle Gegenstände" angezeigt wird. |
settings.ui.components.virtual_items.selected_item | string | Gegenstand, der nach dem Öffnen der Registerkarte "Virtuelle Gegenstände" angezeigt wird (SKU des Gegenstands). |
settings.ui.components.virtual_currency | object | Untermenü "Virtuelle Währung". |
settings.ui.components.virtual_currency.custom_amount | boolean | Legt fest, ob der Benutzer eine willkürliche Menge der virtuellen Währung im Zahlungsportal eingeben kann. |
settings.ui.components.virtual_currency.order | int | Position des Untermenüs im Hauptmenü. |
settings.ui.components.virtual_currency.hidden | boolean | Legt fest, ob das Untermenü angezeigt wird. |
settings.ui.components.subscriptions | object | Untermenü "Abo-Modelle" (Objekt). |
settings.ui.components.subscriptions.order | int | Position des Untermenüs im Hauptmenü. |
settings.ui.components.subscriptions.hidden | boolean | Legt fest, ob das Untermenü angezeigt wird. |
settings.ui.mode | string | Zahlungsschnittstelle im Benutzerkonto. Als Wert lässt sich lediglich 'user_account' festlegen: Der Header enthält ausschließlich die Navigationsleiste des Benutzerkontos und der Benutzer kann kein Produkt auswählen oder eine Zahlung tätigen. Dieser Modus ist nur in der Desktop-Version verfügbar. |
settings.ui.user_account | Objekt | Details zum Benutzerkonto (Objekt). |
settings.ui.user_account.info | object | Seite "Mein Konto". |
settings.ui.user_account.info.order | int | Position des Untermenüs im Hauptmenü. |
settings.ui.user_account.info.enable | boolean | Legt fest, ob das Untermenü angezeigt wird. Standardwert ist 'false'. |
settings.ui.user_account.history | object | Untermenü "Historie". |
settings.ui.user_account.history.order | int | Position des Untermenüs im Hauptmenü. |
settings.ui.user_account.history.enable | boolean | Legt fest, ob das Untermenü angezeigt wird. Standardwert ist 'false'. |
settings.ui.user_account.payment_accounts | object | Untermenü "Meine Zahlungskonten". |
settings.ui.user_account.payment_accounts.order | int | Position des Untermenüs im Hauptmenü. |
settings.ui.user_account.payment_accounts.enable | boolean | Legt fest, ob das Untermenü angezeigt wird. Standardwert ist 'false'. |
settings.ui.user_account.subscriptions | object | Untermenü "Abonnements verwalten". |
settings.ui.user_account.subscriptions.order | int | Position des Untermenüs im Hauptmenü. |
settings.ui.user_account.subscriptions.enable | boolean | Legt fest, ob das Untermenü angezeigt wird. Standardwert ist 'false'. |
settings.shipping_enabled | boolean | Ob das Formular für die Zustelladresse angezeigt werden soll. Standarmäßig auf 'False'. |
purchase | object | Objekt, welches Angaben zum Kauf enthält. |
purchase.virtual_currency | object | Objekt, welches Angaben zur virtuellen Währung enthält. |
purchase.virtual_currency.quantity | float | Kaufbetrag in der virtuellen Währung. |
purchase.virtual_currency.currency | string | Währung, in der das Virtuelle-Währungs-Angebotspaket erworben werden kann und die bei allen Kalkulationen verwendet werden soll. |
purchase.virtual_items | object | Objekt mit Daten über virtuelle Gegenstände, die erworben werden können. |
purchase.virtual_items.currency | string | Währung der bezogenen Gegenstände, die bei allen Kalkulationen verwendet werden soll. |
purchase.virtual_items.items | array | Daten zum Gegenstand (Array). |
purchase.virtual_items.items.sku | string | ID des Gegenstands. |
purchase.virtual_items.items.amount | int | Gegenstandsmenge. |
purchase.virtual_items.available_groups | array | IDs der Gegenstandsgruppen (Array). Im Zahlungsportal werden lediglich Gegenstände aus der festgelegten Gruppe angezeigt. |
purchase.subscription | object | Daten zum Abonnement (Objekt). |
purchase.subscription.plan_id | string | ID des Abo-Modells. |
purchase.subscription.product_id | string | Produkt-ID. |
purchase.subscription.currency | string | Währung des Abo-Modells, die bei allen Kalkulationen verwendet werden soll. |
purchase.subscription.available_plans | string | Abonnement-Modelle (Auswahl) in der Benutzeroberfläche für Zahlungen anzeigen. |
purchase.subscription.trial_days | int | Testzeitraum in Tagen. Wird nur beim Anlegen eines Abonnements und nur für Pläne ohne definierten Testzeitraum verwendet. |
purchase.pin_codes | object | PIN-Codes (Objekt). |
purchase.pin_codes.currency | string | Währung eines PIN-Codes innerhalb der Bestellung, die bei allen Kalkulationen verwendet werden soll. |
purchase.pin_codes.codes | array | PIN-Codes (Array). |
purchase.pin_codes.codes.digital_content | string | Im Kundenportal festgelegte Spiele-SKU. |
purchase.pin_codes.codes.drm | string | Die für die Auslieferung des Spiels verwendete DRM-Plattform. Als Wert lässt sich entweder 'steam', 'playstation', 'xbox', 'uplay', 'origin' oder 'drmfree' festlegen. Stellen Sie sicher, dass Sie die benötigten DRM-Plattformen in Ihrem Kundenportal konfiguriert haben. Falls nicht im Token übermittelt, wird dieser Parameter durch den Benutzer im Zahlungsportal ausgewählt. |
purchase.checkout | object | Objekt, welches Angaben zur Bezahlung enthält. |
purchase.checkout.currency | string | Kaufwährung. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
purchase.checkout.amount | float | Kaufbetrag. |
purchase.description | object | Kaufbeschreibung (Objekt). |
purchase.description.value | string | Kaufbeschreibung, die auf der Benutzeroberfläche und in der Bestätigungsemail angezeigt wird. |
purchase.gift | object | Objekt mit Daten über das Geschenk. |
purchase.gift.giver_id | string | Spender-ID. |
purchase.gift.message | string | Nachricht vom Spender. |
purchase.gift.hide_giver_from_receiver | string | Legt fest, ob die Identität des Spenders vor dem Beschenkten geheim gehalten werden soll (standardmäßig: 'true') |
purchase.gift.friends | array | Array mit Daten über Freunde. |
purchase.gift.friends.id | string | ID. |
purchase.gift.friends.name | string | Spitzname. |
purchase.gift.friends.email | string | E-Mail des Geschenkempfängers. |
custom_parameters | object | Ihre benutzerdefinierten Parameter, repräsentiert durch eine gültige Reihe von JSON-Objekten bestehend aus Schlüssel-Wert-Paaren. |
Falls irgendein Parameter in einem unzulässigen Format oder als falscher Typ versendet wird, wird kein Token ausgegeben. Als Antwort erhalten Sie den HTTP-Statuscode "422" mit einer Fehlerbeschreibung im JSON-Body. Der Parameter extended_message gibt Aufschluss darüber, welche Parameter falsch waren. { "extended_message": { "global_errors": [], "property_errors": { "settings.project_id": [ "string value found, but an integer is required" ] } } }
Anfrage
<?php
use Xsolla\SDK\API\XsollaClient;
use Xsolla\SDK\API\PaymentUI\TokenRequest;
$tokenRequest = new TokenRequest($projectId, $userId);
$tokenRequest->setUserEmail('email@example.com')
->setExternalPaymentId('12345')
->setSandboxMode(true)
->setUserName('USER_NAME')
->setCustomParameters(array('key1' => 'value1', 'key2' => 'value2'));
$xsollaClient = XsollaClient::factory(array(
'merchant_id' => MERCHANT_ID,
'api_key' => API_KEY
));
$token = $xsollaClient->createPaymentUITokenFromRequest($tokenRequest);
POST /merchant/v2/merchants/{merchant_id}/token HTTP/1.1
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"user": {
"id": {
"value": "1234567",
"hidden": true
},
"email": {
"value": "email@example.com",
"allow_modify": true,
"hidden": false
},
"country": {
"value": "US"
}
},
"settings": {
"project_id": 14004,
"language":"en",
"currency":"USD",
"ui": {
"size":"medium"
}
},
"purchase": {
"virtual_currency": {
"quantity": 100
},
"virtual_items": {
"items": [{
"sku":"SKU01",
"amount":1
}]
},
"description": {
"value": "Test Purchase"
}
},
"custom_parameters": {
"parameter1": "value1"
}
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/token' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"user": {
"id": {
"value": "1234567",
"hidden": true
},
"email": {
"value": "email@example.com",
"allow_modify": true,
"hidden": false
},
"country": {
"value": "US"
}
},
"settings": {
"project_id": 14004,
"language":"en",
"currency":"USD",
"ui": {
"size":"medium"
}
},
"purchase": {
"virtual_currency": {
"quantity": 100
},
"virtual_items": {
"items": [{
"sku":"SKU01",
"amount":1
}]
},
"description": {
"value": "Test Purchase"
}
},
"custom_parameters": {
"parameter1": "value1"
}
}'
Antwort
<?php
// example response
$token = 'uV0iCEvWkUGVqWerTgbrndWePOMiLAfO';
HTTP/1.1 200 OK
Content-Type: application/json
{
"token": "uV0iCEvWkUGVqWerTgbrndWePOMiLAfO"
}
{
"token": "uV0iCEvWkUGVqWerTgbrndWePOMiLAfO"
}
Zusätzliche Parameter auflisten
Sie können zusätzliche Parameter im Token übergeben, um Filter zur Betrugsbekämpfung zu konfigurieren. Die empfohlenen Parameter sind in der nachfolgenden Tabelle aufgeführt. Sie können die Liste beliebig erweitern.
Name | Typ | Beschreibung |
---|---|---|
registration_date | string | Datum der Kontoerstellung gemäß ISO 8601. |
total_hours | int | Gesamtzahl der Spielstunden. |
total_characters | int | Anzahl der Charaktere im Spiel. |
social_networks_added | boolean | Filtert danach, ob der Spieler Profile von sozialen Netzwerken verknüpft hat. |
profile_image_added | boolean | Filtert danach, ob der Spieler ein Profilbild hochgeladen hat. |
last_active_date | string | Letztmalig online; Datum gemäß ISO 8601. |
total_friends | int | Anzahl der Freunde. |
additional_verification | boolean | Filtert danach, ob der Spieler Konto-Verifikationsverfahren verwendet. |
win_rate | int | Gewinnquote. |
last_change_password_date | string | Datum der letzten Kennwortänderung; Datumsangabe gemäß ISO 8601. |
chat_activity | boolean | Filtert danach, ob der Spieler die Chatfunktion verwendet. |
forum_activity | boolean | Filtert danach, ob der Spieler ein Profilbild hochgeladen hat. |
total_bans | int | Filtert danach, wie oft der Spieler im Chat/Forum gesperrt wurde. |
profile_completed | boolean | Filtert danach, ob der Spieler auf seinem Profil zusätzliche Informationen hinzugefügt hat. |
notifications_enabled | boolean | Filtert danach, ob der Spieler den Erhalt von Benachrichtigungen aktiviert hat. |
user_level | int | Level, Ansehen oder Rang des Spielers. |
karma_points | int | Karma des Spielers. |
total_sum | float | Gesamtbetrag der Zahlungen. |
non_premium_currency | float | Betrag der gewöhnlichen ("non-premium") Währung. |
total_game_events | int | Anzahl der Ingame-Events, an denen der Spieler teilgenommen hat. |
total_gifts | int | Anzahl der Geschenke im Spiel, die der Spieler verschickt/erhalten hat. |
tutorial_completed | boolean | Filtert danach, ob der Spieler das Tutorial des Spiels absolviert hat. |
completed_tasks | int | Anzahl der erledigten Aufgaben bzw. erreichten Ziele. |
items_used | boolean | Filtert danach, ob der Spieler im Spiel gekaufte Gegenstände verwendet. |
pvp_activity | boolean | Filtert danach, ob der Spieler an PvP-Schlachten teilnimmt. |
total_clans | int | Anzahl der Clans, bei denen der Spieler Mitglied ist. |
unlocked_achievements | int | Anzahl an freigeschalteten Errungenschaften. |
total_inventory_value | float | Gesamtwert des Inventars (in Ingame-Währung). |
character_customized | boolean | Filtert danach, ob der Spieler seinen Charakter individuell angepasst hat. |
session_time | string | Durchschnittliche Sitzungsdauer, Angabe gemäß ISO 8601. |
Pay-Station-Benutzeroberfläche
Pay-Station ist ein ganzheitliches Zahlungsportal, das Ihren Benutzern die Möglichkeit bietet, Spiele und Gegenstände auf Ihrer Website zu kaufen. Zur einfachen Implementierung des Zahlungsportals auf Ihrer Website empfiehlt es sich, das folgende Script aus unserem CDN herunterzuladen: link. Verwenden Sie diese URL, um das Script auf Ihrer Website zu integrieren. Für weitere Informationen besuchen Sie bitte unser GitHub repository.
Script-Initialisierungsparameter:
Parameter | Typ | Beschreibung |
---|---|---|
access_token | string | Pay-Station-Token; wird über die API empfangen. Erforderlich. |
sandbox | boolean | Stellen Sie den Wert des Parameters auf "true", um den Zahlungsvorgang auszutesten: Anstelle von sandbox-secure.xsolla.com wird secure.xsolla.com verwendet. |
lightbox | object | Lightbox-Parameter (Objekt; nur für die Desktop-Version). |
lightbox.width | string | Rahmenbreite der Lightbox. Falls als Wert null festgelegt ist, wird die Breite der Pay Station verwendet. Standardwert ist null. |
lightbox.height | string | Rahmenhöhe der Lightbox. Falls als Wert null festgelegt ist, wird die Höhe der Pay Station verwendet. Standardwert ist "100%". |
lightbox.zIndex | int | Definiert die Stapelanordnung. Standarwert ist 1000. |
lightbox.overlayOpacity | int | Deckkraft der Einblendung (0 bis 1). Standardwert ist ".6". |
lightbox.overlayBackground | string | Hintergrundfarbe der Einblendung. Standardwert ist "#000000". |
lightbox.modal | boolean | Falls 'true' eingestellt ist, kann der Lightbox-Rahmen nicht geschlossen werden. Standardwert ist 'false'. |
lightbox.closeByClick | boolean | Falls 'true' eingestellt ist, wird die Lightbox durch Klicken auf die Einblendung geschlossen. Standardwert ist 'true'. |
lightbox.closeByKeyboard | boolean | Falls 'true' eingestellt ist, wird die Lightbox durch Drücken der Escape-Taste geschlossen. Standardwert ist 'true'. |
lightbox.contentBackground | string | Hintergrundfarbe des Rahmens. Standardwert ist "#ffffff". |
lightbox.contentMargin | string | Breite des Rahmens. Standardwert ist "10px". |
lightbox.spinner | string | Art der animierten Ladeanzeige. Als Wert lässt sich entweder 'xsolla' oder 'round' festlegen. Standardwert ist 'xsolla'. |
lightbox.spinnerColor | string | Farbe des Ladekreises. Kein Wert voreingestellt. |
childWindow | object | Optionen für das untergeordnete Fenster, welches die Benutzeroberfläche der Pay Station enthält. Wird in der mobilen Version unterstützt. |
childWindow.target | string | Stelle, an welcher das Pay-Station-Fenster geöffnet werden soll. Als Wert lässt sich entweder "_blank", "_self", "_parent" festlegen. Standardmäßig ist "_blank" eingestellt. |
Das Script ermöglicht Ihnen, die Ereignisse im Zahlungsportal zu verfolgen. Je nach Art des Ereignisses können Sie verschiedene Aktionen auf der Website ausführen.
Liste der Ereignisse:
Parameter | Beschreibung |
---|---|
init | Widget initialisiert. |
open | Widget geöffnet. |
load | Zahlungsportal (Pay Station) geladen. |
close | Zahlungsportal (Pay Station) geschlossen. |
status | Benutzer befindet sich auf der Statusseite. |
status-invoice | Benutzer befindet sich auf der Statusseite; Zahlung im Gange. |
status-delivering | Benutzer befindet sich auf der Statusseite; Zahlung abgeschlossen; Zahlungsbestätigung wurde versendet. |
status-done | Benutzer befindet sich auf der Statusseite, Zahlung wurde dem Benutzerkonto gutgeschrieben. |
status-troubled | Benutzer befindet sich auf der Statusseite; Zahlung fehlgeschlagen. |
Wenn Sie den Ladevorgang für das Zahlungsportal selbst initialisieren möchten, verwenden Sie folgenden Link: https://secure.xsolla.com/paystation2/?access_token=ACCESS_TOKEN
, wobei ACCESS_TOKEN
den Token darstellt, der im vorherigen Schritt erhalten wurde.
Beispiel: Asynchrones Laden von Scripten mit einer Rückruffunktion
<html>
<head lang="en">
<meta charset="UTF-8">
</head>
<body>
<button data-xpaystation-widget-open>Buy Credits</button>
<?php \Xsolla\SDK\API\PaymentUI\PaymentUIScriptRenderer::send($paymentUIToken, $isSandbox = true); ?>
</body>
</html>
<script>
var options = {
access_token: 'abcdef1234567890abcdef1234567890'
};
var s = document.createElement('script');
s.type = "text/javascript";
s.async = true;
s.src = "https://static.xsolla.com/embed/paystation/1.0.7/widget.min.js";
s.addEventListener('load', function (e) {
XPayStationWidget.init(options);
}, false);
var head = document.getElementsByTagName('head')[0];
head.appendChild(s);
</script>
<button data-xpaystation-widget-open>Buy Credits</button>
Liste der Test-Kreditkarten
Im Sandbox-Modus können Sie diese Karten verwenden, um erfolgreiche Zahlungen zu simulieren:
Kartennummer | gültig bis | CVV2 | 3D-Secure | Kartentyp |
---|---|---|---|---|
4111111111111111 | 12/20 | 123 | No | VISA |
5555555555554444 | 11/19 | 321 | No | MasterCard |
4000000000000010 | 12/20 | 123 | Yes | VISA |
5200000000000114 | 11/19 | 321 | Yes | MasterCard |
6759649826438453 | 12/25 | 321 | Yes | Maestro |
Zusätzlich können Sie folgende Daten verwenden, um abgelehnte Transaktionen zu simulieren:
Kartennummer | gültig bis | CVV2 | 3D-Secure | Kartentyp | Beschreibung |
---|---|---|---|---|---|
4000000000000002 | 12/20 | 123 | No | VISA | Unzureichende Mittel |
5200000000000007 | 11/19 | 321 | No | MasterCard | Unzureichende Mittel |
4000000000000036 | 12/20 | 123 | Yes | VISA | Abgelehnt |
5200000000000031 | 11/19 | 321 | Yes | MasterCard | Abgelehnt |
Pay2Play-Widget
Das Pay2Play-Widget erleichtert Ihnen die Implementierung eines Zahlungsportals auf Ihrer Website. Das Widget ist einfach einzubetten, stellt dem Benutzer Informationen über das Spiel bereit und zeigt verfügbare DRMs, Plattformen sowie Zahlungsarten an.
Sie können das Script von unserem CDN hier herunterladen. Verwenden Sie diese URL, um das Script auf Ihrer Website zu integrieren.
Für weitere Informationen besuchen Sie bitte unser GitHub-Repository.
Es stehen zwei Optionen für die Integration von Pay2Play zur Auswahl:
- Einfache Integration
- Erweiterte Integration
Schauen Sie im Leitfaden zur Integration nach, um mehr über die Unterschiede zwischen den beiden Optionen zu erfahren. Die Widget-Initialisierungsparameter hängen von der gewählten Option ab.
Einfache Integration
Script-Initialisierungsparameter:
Parameter | Typ | Beschreibung |
---|---|---|
access_data | string | Benutzer- und Zahlungsdaten (Objekt). Erforderlich. |
theme | object | Widget-Theme. |
theme.foreground | string | Widget-Vordergrundfarbe. |
theme.background | string | Widget-Hintergrundfarbe. |
target_element | boolean | jQuery-Selektor für das Seitenelement, welches das Widget enthält (z. B: "#widget-example"). Erforderlich. |
Die Parameter und die Struktur für das access_data Objekt ähneln jenen Parametern, die für das Token verwendet werden.
Erweiterte Integration
Script-Initialisierungsparameter:
Parameter | Typ | Beschreibung |
---|---|---|
access_token | string | Token für das Widget; wird überAPI empfangen. Erforderlich. |
sandbox | boolean | Stellen Sie den Wert des Parameters auf "true", um den Zahlungsvorgang auszutesten: Anstelle von sandbox-secure.xsolla.com wird secure.xsolla.com verwendet. |
theme | object | Widget-Theme. |
theme.foreground | string | Widget-Vordergrundfarbe. |
theme.background | string | Widget-Hintergrundfarbe. |
target_element | boolean | jQuery-Selektor für das Seitenelement, welches das Widget enthält (z. B: "#widget-example"). Erforderlich. |
Die folgenden Parameter definieren das Theme des Zahlungsportals. Dieselben Parameter werden für das Xsolla-Pay-Station-Widget verwendet.
Parameter | Typ | Beschreibung |
---|---|---|
lightbox | object | Lightbox-Parameter (Objekt; nur für die Desktop-Version). |
lightbox.width | string | Rahmenbreite der Lightbox. Falls als Wert null festgelegt ist, wird die Breite der Pay Station verwendet. Standardwert ist null. |
lightbox.height | string | Rahmenhöhe der Lightbox. Falls als Wert null festgelegt ist, wird die Höhe der Pay Station verwendet. Standardwert ist "100%". |
lightbox.zIndex | int | Definiert die Stapelanordnung. Standarwert ist 1000. |
lightbox.overlayOpacity | int | Deckkraft der Einblendung (0 bis 1). Standardwert ist ".6". |
lightbox.overlayBackground | string | Hintergrundfarbe der Einblendung. Standardwert ist "#000000". |
lightbox.modal | boolean | Falls 'true' eingestellt ist, kann der Lightbox-Rahmen nicht geschlossen werden. Standardwert ist 'false'. |
lightbox.closeByClick | boolean | Falls 'true' eingestellt ist, wird die Lightbox durch Klicken auf die Einblendung geschlossen. Standardwert ist 'true'. |
lightbox.closeByKeyboard | boolean | Falls 'true' eingestellt ist, wird die Lightbox durch Drücken der Escape-Taste geschlossen. Standardwert ist 'true'. |
lightbox.contentBackground | string | Hintergrundfarbe des Rahmens. Standardwert ist "#ffffff". |
lightbox.contentMargin | string | Breite des Rahmens. Standardwert ist "10px". |
lightbox.spinner | string | Art der animierten Ladeanzeige. Als Wert lässt sich entweder 'xsolla' oder 'round' festlegen. Standardwert ist 'xsolla'. |
lightbox.spinnerColor | string | Farbe des Ladekreises. Kein Wert voreingestellt. |
childWindow | object | Optionen für das untergeordnete Fenster, welches die Benutzeroberfläche der Pay Station enthält. Wird in der mobilen Version unterstützt. |
childWindow.target | string | Stelle, an welcher das Pay-Station-Fenster geöffnet werden soll. Als Wert lässt sich entweder "_blank", "_self", "_parent" festlegen. Standardmäßig ist "_blank" eingestellt. |
Stellen Sie sicher, dass Sie XPay2PlayWidget.create() erst aufrufen, wenn das DOM vollständig geladen ist. Sie können das gewünschte Ereignis nachverfolgen oder das Script nach dem Element, welches das Widget enthält, hinzufügen.
Beispiel: Asynchrones Laden von Scripten mit einer Rückruffunktion für einfache Integration
<script>
var accessData = {"settings":{"project_id":14004},"purchase":{"pin_codes":{"codes":[{"digital_content":"game_sku"}]}}};
var options = {
access_data: accessData,
theme : {
foreground: 'green',
background: 'light'
},
target_element: '#widget-example-element'
};
var s = document.createElement('script');
s.type = "text/javascript";
s.async = true;
s.src = "//static.xsolla.com/embed/pay2play/2.1.0/widget.min.js";
s.addEventListener('load', function (e) {
var widgetInstance = XPay2PlayWidget.create(options);
}, false);
var head = document.getElementsByTagName('head')[0];
head.appendChild(s);
</script>
<script>
var accessData = {"settings":{"project_id":14004},"purchase":{"pin_codes":{"codes":[{"digital_content":"game_sku"}]}}};
var options = {
access_data: accessData,
theme : {
foreground: 'green',
background: 'light'
},
target_element: '#widget-example-element'
};
var s = document.createElement('script');
s.type = "text/javascript";
s.async = true;
s.src = "//static.xsolla.com/embed/pay2play/2.1.0/widget.min.js";
s.addEventListener('load', function (e) {
var widgetInstance = XPay2PlayWidget.create(options);
}, false);
var head = document.getElementsByTagName('head')[0];
head.appendChild(s);
</script>
Beispiel: Asynchrones Laden von Scripten mit einer Rückruffunktion für erweiterte Integration
<script>
var options = {
access_token: 'abcdef1234567890abcdef1234567890',
theme : {
foreground: 'green',
background: 'light'
},
target_element: '#widget-example-element'
};
var s = document.createElement('script');
s.type = "text/javascript";
s.async = true;
s.src = "//static.xsolla.com/embed/pay2play/2.1.0/widget.min.js";
s.addEventListener('load', function (e) {
var widgetInstance = XPay2PlayWidget.create(options);
}, false);
var head = document.getElementsByTagName('head')[0];
head.appendChild(s);
</script>
<script>
var options = {
access_token: 'abcdef1234567890abcdef1234567890',
theme : {
foreground: 'green',
background: 'light'
},
target_element: '#widget-example-element'
};
var s = document.createElement('script');
s.type = "text/javascript";
s.async = true;
s.src = "//static.xsolla.com/embed/pay2play/2.1.0/widget.min.js";
s.addEventListener('load', function (e) {
var widgetInstance = XPay2PlayWidget.create(options);
}, false);
var head = document.getElementsByTagName('head')[0];
head.appendChild(s);
</script>
Fehlerliste
Code | Description |
---|---|
0004-0001 | Token abgelaufen oder falsch |
0004-0008 | Falsche URL (Zugriff auf den Sandbox-Modus unter secure.xsolla.com oder auf den Live-Modus unter sandbox-secure.xsolla.com) |
0002-0004 | Vereinbarung wurde nicht unterzeichnet |
0004-0010 | Serverlose Integration ist verboten |
0010-0001 | Digitaler Inhalt wurde nicht gefunden |
0010-0003 | Für den digitalen Inhalt ist kein DRM konfiguriert |
1000-0003 | Für das Projekt sind keine Zahlungsmodule eingeschaltet |
Im Storefront vorhandene virtuelle Währungspakete auflisten
Listet alle im Storefront vorhandenen virtuellen Währungspakete auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/virtual_currency
Anfrageparameter:
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Projekt-ID. Erforderlich. |
user_id | string | Benutzer-ID. Erforderlich. |
currency | string | Währung, in der das virtuelle Währungspaket erworben werden kann. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. Erforderlich. |
language | string | Sprache der Benutzeroberfläche. Sprachencode, bestehend aus 2 Kleinbuchstaben gemäß ISO 639-1. |
Antwortparameter:
Parameter | Typ | Beschreibung |
---|---|---|
packages | array | Virtuelle Währungspakete (array of objects). |
packages.id | int | In der Xsolla-Datenbank erfasste ID des virtuellen Währungspakets. |
packages.quantity | float | Menge der virtuellen Währung. |
packages.quantity_without_discount | float | Menge ohne Rabatt (im Falle einer Werbeaktion). |
packages.bonus_quantity | float | Menge der virtuellen Währung, die als Bonus vergeben wird (im Falle einer Werbeaktion). |
packages.amount | float | Preis des virtuellen Währungspakets (angegeben in der Währung, die in der Anfrage definiert wurde). |
packages.amount_without_discount | float | Originalpreis (d. h. Preis ohne Rabatt) des virtuellen Währungspakets (im Falle einer Werbeaktion). |
packages.currency | string | Währung, in der das virtuelle Währungspaket erworben werden kann. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
packages.image | string | URL des Bildes, welches für das Angebotspaket verwendet werden soll. |
packages.description | string | Beschreibung des Angebotspakets (in der Sprache, die in der Anfrage definiert wurde). |
packages.bonus_items | array | Virtuelle Gegenstände, die als Bonus vergeben werden (im Falle einer Werbeaktion). |
packages.bonus_items.name | string | Name des Gegenstands. |
packages.bonus_items.quantity | int | Menge. |
packages.advertisement_label | object | Kennzeichnung des Angebotspakets (Objekt). |
packages.advertisement_label.type | string | Art der Kennzeichnung. Als Wert lässt sich entweder "recommended", "best_deal", "special_offer" oder null festlegen. |
packages.advertisement_label.name | string | Lokalisierter Name der Kennzeichnung; abhängig von packages.advertisement_label.type. |
packages.offer_label | string | Kennzeichnung der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->GetStorefrontVirtualCurrency(array(
'project_id' => PROJECT_ID,
'language' => LANGUAGE_ISO,
'currency' => CURRENCY_ISO,
'user_id' => USER_ID
));
GET /merchant/v2/merchants/{project_id}/storefront/virtual_currency HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/virtual_currency' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'packages' =>
array (
array (
'id' => 16913,
'quantity' => 500,
'quantity_without_discount' => 500,
'bonus_quantity' => 10,
'amount' => 4,
'amount_without_discount' => 4.99,
'currency' => 'USD',
'image' => '//cdn2.xsolla.com/img/misc/images/5df58528dee219c2ab48e003f8f1a8f1.jpg',
'description' => '500 Gold',
'bonus_items' =>
array (
array (
'name' => 'Rabbit',
'quantity' => 1,
),
),
'advertisement_label' =>
array (
'type' => 'recommended',
'name' => 'Most Popular',
),
'offer_label' => '',
),
),
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"packages": [
{
"id": 16913,
"quantity": 500.
"quantity_without_discount": 500.
"bonus_quantity": 10,
"amount": 4,
"amount_without_discount": 4.99,
"currency": "USD",
"image": "\/\/cdn2.xsolla.com\/img\/misc\/images\/5df58528dee219c2ab48e003f8f1a8f1.jpg",
"description": "500 Gold",
"bonus_items": [
{
"name": "Rabbit",
"quantity": 1
}
],
"advertisement_label": {
"type": "recommended",
"name": "Most Popular"
},
"offer_label": ""
}
]
}
{
"packages": [
{
"id": 16913,
"quantity": 500.
"quantity_without_discount": 500.
"bonus_quantity": 10,
"amount": 4,
"amount_without_discount": 4.99,
"currency": "USD",
"image": "\/\/cdn2.xsolla.com\/img\/misc\/images\/5df58528dee219c2ab48e003f8f1a8f1.jpg",
"description": "500 Gold",
"bonus_items": [
{
"name": "Rabbit",
"quantity": 1
}
],
"advertisement_label": {
"type": "recommended",
"name": "Most Popular"
},
"offer_label": ""
}
]
}
Im Storefront vorhandene Gruppen auflisten
Listet alle Gruppen von virtuellen Gegenständen auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/virtual_items/groups
Anfrageparameter:
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Projekt-ID. Erforderlich. |
user_id | string | Benutzer-ID. Erforderlich. |
currency | string | Währung, in der das virtuelle Währungspaket erworben werden kann. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. Erforderlich. |
language | string | Sprache der Benutzeroberfläche. Sprachencode, bestehend aus 2 Kleinbuchstaben gemäß ISO 639-1. |
Antwortparameter:
Parameter | Typ | Beschreibung |
---|---|---|
groups | array | Gruppen von virtuellen Gegenständen. |
groups.id | int | Gruppen-ID in der Xsolla-Datenbank. |
groups.external_id | string | Externe Gruppen-ID. |
groups.name | string | Lokalisierte Gruppenbezeichnung. |
groups.description | string | Lokalisierte Gruppenbeschreibung. |
groups.level | int | Gruppenlevel. |
groups.children | array | Untergeordnete Gruppen; jede Gruppe besitzt dieselbe Struktur wie die übergeordnete Gruppe. |
Anfrage
<?php
$response = $xsollaClient->GetStorefrontVirtualGroups(array(
'project_id' => PROJECT_ID,
'language' => LANGUAGE_ISO,
'currency' => CURRENCY_ISO,
'user_id' => USER_ID
));
GET /merchant/v2/merchants/{project_id}/storefront/virtual_items/groups HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/virtual_items/groups' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'groups' =>
array (
array (
'id' => 1,
'external_id' => '21',
'name' => 'Group name 21',
'description' => 'Group description 21',
'children' =>
array (),
'level' => 0,
),
array (
'id' => 2,
'external_id' => '22',
'name' => 'Group name 22',
'description' => 'Group description 22',
'children' =>
array (
array (
'id' => 3,
'external_id' => NULL,
'name' => 'Child group 1',
'description' => 'Child group 1',
'children' =>
array (),
'level' => 1,
),
array (
'id' => 8,
'external_id' => NULL,
'name' => 'Child group 2',
'description' => 'Child group 2',
'children' =>
array (),
'level' => 1,
),
),
'level' => 0,
),
),
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"groups": [
{
"id": 1,
"external_id": "21",
"name": "Group name 21",
"description": "Group description 21",
"children": [],
"level": 0
},
{
"id": 2,
"external_id": "22",
"name": "Group name 22",
"description": "Group description 22",
"children": [
{
"id": 3,
"external_id": null,
"name": "Child group 1",
"description": "Child group 1",
"children": [],
"level": 1
},
{
"id": 8,
"external_id": null,
"name": "Child group 2",
"description": "Child group 2",
"children": [],
"level": 1
}
],
"level": 0
}
]
}
{
"groups": [
{
"id": 1,
"external_id": "21",
"name": "Group name 21",
"description": "Group description 21",
"children": [],
"level": 0
},
{
"id": 2,
"external_id": "22",
"name": "Group name 22",
"description": "Group description 22",
"children": [
{
"id": 3,
"external_id": null,
"name": "Child group 1",
"description": "Child group 1",
"children": [],
"level": 1
},
{
"id": 8,
"external_id": null,
"name": "Child group 2",
"description": "Child group 2",
"children": [],
"level": 1
}
],
"level": 0
}
]
}
Im Storefront vorhandene virtuelle Gegenstände auflisten
Listet alle im Storefront vorhandenen virtuellen Gegenstände auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/virtual_items/items
Anfrageparameter:
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Projekt-ID. Erforderlich. |
user_id | string | Benutzer-ID. Erforderlich. |
group_id | int | Gruppen-ID des virtuellen Gegenstands. Erforderlich. |
currency | string | Währung, in der das virtuelle Währungspaket erworben werden kann. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. Erforderlich. |
language | string | Sprache der Benutzeroberfläche. Sprachencode, bestehend aus 2 Kleinbuchstaben gemäß ISO 639-1. |
Antwortparameter:
Parameter | Typ | Beschreibung |
---|---|---|
items | array | Virtuelle Gegenstände (array of objects). |
items.id | int | In der Xsolla-Datenbank erfasste ID des virtuellen Gegenstands. |
items.sku | string | SKU des virtuellen Gegenstands. |
items.name | string | Lokalisierter Name. |
items.image_url | string | URL des Bildes, welches für den virtuellen Gegenstand verwendet werden soll. |
items.description | string | Lokalisierte Beschreibung. |
items.long_description | string | Lokalisierte ausführliche Beschreibung. |
items.currency | string | Währung, die für den Kauf des virtuellen Artikels verwendet werden soll. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
items.amount | float | Preis des virtuellen Gegenstands (in der Währung, die in der Anfrage definiert wurde). |
items.amount_without_discount | float | Preis des virtuellen Gegenstands ohne Rabatt (im Falle einer Werbeaktion). |
items.vc_amount | float | Preis des virtuellen Gegenstands in der virtuellen Währung. |
items.vc_amount_without_discount | float | Originalpreis (d. h. ohne Rabatt) des virtuellen Gegenstands in der virtuellen Währung (im Falle einer Werbeaktion). |
items.bonus_virtual_currency | object | Virtuelle Währung, die als Bonus vergeben wird (im Falle einer Werbeaktion). |
items.bonus_virtual_currency.vc_amount | float | Menge der virtuellen Währung. |
items.bonus_virtual_items | array | Virtuelle Gegenstände, die als Bonus vergeben werden (im Falle einer Werbeaktion). |
items.bonus_virtual_items.name | string | Lokalisierter Name. |
items.bonus_virtual_items.quantity | int | Menge. |
items.advertisement_label | object | Kennzeichnung des virtuellen Gegenstands (Objekt). |
items.advertisement_label.type | string | Art der Kennzeichnung. Als Wert lässt sich entweder "recommended", "best_deal", "special_offer" oder null festlegen. |
items.advertisement_label.name | string | Lokalisierter Name der Kennzeichnung; abhängig von items.advertisement_label.type. |
items.offer_label | string | Kennzeichnung der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->GetStorefrontVirtualItems(array(
'project_id' => PROJECT_ID,
'language' => LANGUAGE_ISO,
'currency' => CURRENCY_ISO,
'user_id' => USER_ID,
'group_id' => GROUP_ID
));
GET /merchant/v2/merchants/{project_id}/storefront/virtual_items/items HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/virtual_items/items' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'items' =>
array (
array (
'id' => 1678,
'sku' => '1468',
'name' => 'Rabbit',
'image_url' => 'https://cdn3.xsolla.com/img/misc/merchant-digital-goods/4376c004fa33dc74483906561d617cb3.png',
'description' => 'Rabbits are small mammals in the family Leporidae',
'long_description' => NULL,
'currency' => 'USD',
'amount' => 0,
'amount_without_discount' => 0,
'vc_amount' => 2,
'vc_amount_without_discount' => 2,
'bonus_virtual_currency' => NULL,
'bonus_virtual_items' =>
array (),
'advertisement_label' => NULL,
'offer_label' => '',
),
),
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"items": [
{
"id": 1678,
"sku": "1468",
"name": "Rabbit",
"image_url": "https:\/\/cdn3.xsolla.com\/img\/misc\/merchant-digital-goods\/4376c004fa33dc74483906561d617cb3.png",
"description": "Rabbits are small mammals in the family Leporidae",
"long_description": null,
"currency": "USD",
"amount": 0,
"amount_without_discount": 0,
"vc_amount": 2,
"vc_amount_without_discount": 2,
"bonus_virtual_currency": null,
"bonus_virtual_items": [],
"advertisement_label": null,
"offer_label": ""
}
]
}
{
"items": [
{
"id": 1678,
"sku": "1468",
"name": "Rabbit",
"image_url": "https:\/\/cdn3.xsolla.com\/img\/misc\/merchant-digital-goods\/4376c004fa33dc74483906561d617cb3.png",
"description": "Rabbits are small mammals in the family Leporidae",
"long_description": null,
"currency": "USD",
"amount": 0,
"amount_without_discount": 0,
"vc_amount": 2,
"vc_amount_without_discount": 2,
"bonus_virtual_currency": null,
"bonus_virtual_items": [],
"advertisement_label": null,
"offer_label": ""
}
]
}
Im Storefront vorhandene Abo-Modelle auflisten
Ruft die Liste mit allen Abo-Modellen auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/subscriptions
Anfrageparameter:
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Projekt-ID. Erforderlich. |
user_id | string | Benutzer-ID. Erforderlich. |
currency | string | Währung, in der das virtuelle Währungspaket erworben werden kann. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. Erforderlich. |
language | string | Sprache der Benutzeroberfläche. Sprachencode, bestehend aus 2 Kleinbuchstaben gemäß ISO 639-1. |
Antwortparameter:
Parameter | Typ | Beschreibung |
---|---|---|
packages | array | Abo-Modelle (array of objects). |
packages.id | int | ID des Abo-Modells in der Xsolla-Datenbank. |
packages.is_active | boolean | Legt fest, ob das Abo-Modell aktiv geschaltet ist. |
packages.charge_amount | float | Preis des Abo-Modells. |
packages.charge_amount_without_discount | float | Originalpreis des Abo-Modells (im Falle einer Werbeaktion). |
packages.charge_currency | string | Währung des Abo-Modells. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
packages.period | int | Abrechnungszeitraum (Anzahl der Zeiteinheiten). |
packages.period_unit | string | Zeiteinheit für den Abrechnungszeitraum (day/month). |
packages.name | string | Lokalisierter Name. |
packages.description | string | Lokalisierte Beschreibung. |
packages.bonus_virtual_currency | object | Virtuelle Währung, die als Bonus vergeben wird (im Falle einer Werbeaktion). |
packages.bonus_virtual_currency.vc_amount | float | Menge der virtuellen Währung. |
packages.bonus_virtual_items | array | Virtuelle Gegenstände, die als Bonus vergeben werden (im Falle einer Werbeaktion). |
packages.bonus_virtual_items.name | string | Lokalisierter Name. |
packages.bonus_virtual_items.quantity | int | Menge. |
packages.offer_label | string | Kennzeichnung der Werbeaktion. |
packages.is_trial | boolean | Legt fest, ob ein Probezeitraum für das Abo-Modell verwendet werden soll. |
packages.period_trial | int | Probezeitraum in Tagen. |
active_user_package | object | Aktive Abonnements des Benutzers (Objekt). |
active_user_package.date_next_charge | string | Nächstes Rechnungsdatum für ein aktives Abonnement. Datums- und Zeitangabe gemäß ISO 8601. |
active_user_package.id | string | ID des aktiven Abo-Modells. |
Anfrage
<?php
$response = $xsollaClient->GetStorefrontSubscriptions(array(
'project_id' => PROJECT_ID,
'language' => LANGUAGE_ISO,
'currency' => CURRENCY_ISO,
'user_id' => USER_ID
));
GET /merchant/v2/merchants/{project_id}/storefront/subscriptions HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/subscriptions' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'packages' =>
array (
array (
'id' => '2.99_1_months',
'is_active' => true,
'charge_amount' => 2.99,
'charge_amount_without_discount' => 2.99,
'charge_currency' => 'USD',
'period' => 1,
'period_unit' => 'month',
'name' => 'Silver Status',
'description' => NULL,
'bonus_virtual_currency' => NULL,
'bonus_virtual_items' =>
array (),
'offer_label' => '',
'is_trial' => false,
'period_trial' => 0,
),
array (
'id' => '4.99_1_months',
'is_active' => true,
'charge_amount' => 4.99,
'charge_amount_without_discount' => 4.99,
'charge_currency' => 'USD',
'period' => 1,
'period_unit' => 'month',
'name' => 'Gold Status',
'description' => NULL,
'bonus_virtual_currency' => NULL,
'bonus_virtual_items' =>
array (),
'offer_label' => '',
'is_trial' => false,
'period_trial' => 0,
),
),
'active_user_package' =>
array (
'date_next_charge' => '2016-06-28T06:35:02+00:00',
'id' => '2.99_1_months'
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"packages": [
{
"id": "2.99_1_months",
"is_active": true,
"charge_amount": 2.99,
"charge_amount_without_discount": 2.99,
"charge_currency": "USD",
"period": 1,
"period_unit": "month",
"name": "Silver Status",
"description": null,
"bonus_virtual_currency": null,
"bonus_virtual_items": [],
"offer_label": "",
"is_trial": false,
"period_trial": 0
},
{
"id": "4.99_1_months",
"is_active": true,
"charge_amount": 4.99,
"charge_amount_without_discount": 4.99,
"charge_currency": "USD",
"period": 1,
"period_unit": "month",
"name": "Gold Status",
"description": null,
"bonus_virtual_currency": null,
"bonus_virtual_items": [],
"offer_label": "",
"is_trial": false,
"period_trial": 0
}
],
"active_user_package": {
"date_next_charge": "2016-06-28T06:35:02+00:00",
"id": "2.99_1_months"
}
}
{
"packages": [
{
"id": "2.99_1_months",
"is_active": true,
"charge_amount": 2.99,
"charge_amount_without_discount": 2.99,
"charge_currency": "USD",
"period": 1,
"period_unit": "month",
"name": "Silver Status",
"description": null,
"bonus_virtual_currency": null,
"bonus_virtual_items": [],
"offer_label": "",
"is_trial": false,
"period_trial": 0
},
{
"id": "4.99_1_months",
"is_active": true,
"charge_amount": 4.99,
"charge_amount_without_discount": 4.99,
"charge_currency": "USD",
"period": 1,
"period_unit": "month",
"name": "Gold Status",
"description": null,
"bonus_virtual_currency": null,
"bonus_virtual_items": [],
"offer_label": "",
"is_trial": false,
"period_trial": 0
}
],
"active_user_package": {
"date_next_charge": "2016-06-28T06:35:02+00:00",
"id": "2.99_1_months"
}
}
Im Storefront vorhandene Werbeaktionen anfordern
Ruft die derzeit aktiv geschalteten Werbeaktionen auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/bonus
Anfrageparameter:
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Projekt-ID. Erforderlich. |
user_id | string | Benutzer-ID. Erforderlich. |
currency | string | Währung, in der das virtuelle Währungspaket erworben werden kann. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. Erforderlich. |
language | string | Sprache der Benutzeroberfläche. Sprachencode, bestehend aus 2 Kleinbuchstaben gemäß ISO 639-1. |
Antwortparameter:
Parameter | Typ | Beschreibung |
---|---|---|
seconds | int | Sekunden bis die Werbeaktion endet. |
name | string | Lokalisierte Bezeichnung der Werbeaktion. |
description | string | Lokalisierte Beschreibung zur Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->GetStorefrontBonus(array(
'project_id' => PROJECT_ID,
'language' => LANGUAGE_ISO,
'currency' => CURRENCY_ISO,
'user_id' => USER_ID
));
GET /merchant/v2/merchants/{project_id}/storefront/bonus HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/storefront/bonus' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'seconds' => 619513283,
'name' => 'Promotion name',
'description' => 'Promotion description',
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"seconds": 619513283,
"name": "Promotion name",
"description": "Promotion description"
}
{
"seconds": 619513283,
"name": "Promotion name",
"description": "Promotion description"
}
Gespeicherte Zahlungskonten auflisten
Listet die gespeicherten Zahlungskonten eines festgelegten Benutzers auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/payment_accounts
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Benutzer-ID. |
Anfrage
<?php
$response = $xsollaClient->ListPaymentAccounts(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID
));
GET /merchant/v2/merchants/{project_id}/users/{user_id}/payment_accounts HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/payment_accounts' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'type' => 'card',
'id' => 1,
'name' => '411111******1111',
'payment_system' =>
array (
'id' => 1380,
'name' => 'Credit/Debit Cards',
),
),
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"type": "card",
"id": 1,
"name": "411111******1111",
"payment_system": {
"id": 1380,
"name": "Credit/Debit Cards"
}
}
]
[
{
"type": "card",
"id": 1,
"name": "411111******1111",
"payment_system": {
"id": 1380,
"name": "Credit/Debit Cards"
}
}
]
Vom gespeicherten Zahlungskonto abbuchen
Von einem gespeicherten Zahlungskonto des Benutzers abbuchen.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/payments/{type}/{account_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. Erforderlich. |
user_id | int | Benutzer-ID. Erforderlich. |
type | string | Art des Zahlungskontos: Karte / PayPal. Erforderlich. |
account_id | int | ID des gespeicherten Kontos in der Xsolla-Datenbank. Erforderlich. |
user | object | Objekt, welches Benutzerangaben enthält. |
user.ip | string | IP-Adresse des Benutzers. Erforderlich. |
user.name | string | Benutzername. |
purchase | object | Objekt, welches Angaben zum Kauf enthält. |
purchase.virtual_currency | object | Objekt, welches Angaben zur virtuellen Währung enthält. |
purchase.virtual_currency.quantity | float | Kaufbetrag in der virtuellen Währung. |
purchase.checkout | object | Objekt, welches Angaben zur Bezahlung enthält. |
purchase.checkout.currency | string | Kaufwährung. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
purchase.checkout.amount | float | Kaufbetrag. |
settings | object | Objekt, welches die Einstellungen für den Kauf enthält. |
settings.mode | string | Legen Sie als Wert "sandbox" fest, um den Zahlungsvorgang auszutesten. Entfernen Sie den Parameter für tatsächliche Zahlungen. |
Anfrage
<?php
$response = $xsollaClient->ChargePaymentAccount(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'type' => TYPE,
'account_id' => ACCOUNT_ID,
'request' => array (
'user' =>
array (
'ip' => '127.0.0.1',
'name' => 'John Smith',
),
'purchase' =>
array (
'virtual_currency' =>
array (
'quantity' => 100,
),
'description' =>
array (
'value' => 'Test Purchase',
),
),
'settings' =>
array (
'mode' => 'sandbox',
),
)
));
POST /merchant/v2/merchants/{project_id}/users/{user_id}/payments/{type}/{account_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"user": {
"ip": "127.0.0.1",
"name": "John Smith"
},
"purchase": {
"virtual_currency": {
"quantity": 100
},
"description": {
"value": "Test Purchase"
}
},
"settings": {
"mode": "sandbox"
}
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/payments/{type}/{account_id}' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"user": {
"ip": "127.0.0.1",
"name": "John Smith"
},
"purchase": {
"virtual_currency": {
"quantity": 100
},
"description": {
"value": "Test Purchase"
}
},
"settings": {
"mode": "sandbox"
}
}'
Antwort
<?php
// example response
$response = array (
'transaction_id' => 119478390
);
HTTP/1.1 201 Created
Content-Type: application/json
{
"transaction_id": 119478390
}
{
"transaction_id": 119478390
}
Gespeichertes Zahlungskonto löschen
Löscht ein gespeichertes Zahlungskonto.
HTTP-ANFRAGE
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/payment_accounts/{type}/{account_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Benutzer-ID. |
type | string | Art des Zahlungskontos: Karte / PayPal. |
account_id | int | ID des gespeicherten Kontos in der Xsolla-Datenbank. |
Anfrage
<?php
$response = $xsollaClient->DeletePaymentAccount(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'type' => TYPE,
'account_id' => ACCOUNT_ID
));
DELETE /merchant/v2/merchants/{project_id}/users/{user_id}/payment_accounts/{type}/{account_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/payment_accounts/{type}/{account_id}' \
-X DELETE \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = null;
HTTP/1.1 204 No Content
Abo-Modell anlegen
Legt ein Abo-Modell an.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
external_id | string | Externe ID des Abo-Modells (32 Zeichen). Optional. |
name | array of strings | Bezeichnung des Abo-Modells. Besteht aus Paaren vom Typ "language":"plan name" (Sprache:Bezeichnung des Abo-Modells). |
description | array of strings | Beschreibung zum Abo-Modell. Besteht aus Paaren vom Typ "language":"plan description" (Sprache:Beschreibung zum Abo-Modell). |
group_id | string | Gruppen-ID. |
charge | object | Details zur Abrechnung (Objekt). |
charge.period | object | Abrechnungszeitraum (Objekt). |
charge.period.value | int | Anzahl der Zeiteinheiten. |
charge.period.type | string | Zeiteinheit: day / month. |
charge.amount | float | Abrechnungsbetrag. |
charge.currency | string | Kaufwährung. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
expiration | object | Details zum Auslaufen des Abonnements (Objekt). |
expiration.value | int | Zeitliche Gültigkeit. |
expiration.type | string | Zeiteinheit: day / month. |
trial | object | Angaben zum Probezeitraum (Objekt). Optional. |
trial.value | int | Probezeitraum. |
trial.type | string | Zeiteinheit: day. |
grace_period | object | Angaben zur Übergangsfrist. Optional. |
grace_period.value | int | Übergangsfrist. |
grace_period.type | string | Zeiteinheit: day. |
Anfrage
<?php
$response = $xsollaClient->CreateSubscriptionPlan(array(
'project_id' => PROJECT_ID,
'request' => array (
'external_id' => 'sample_plan',
'name' =>
array (
'en' => 'Sample Plan',
),
'description' =>
array (
'en' => 'Basic options plan',
),
'group_id' => 'USA Products',
'charge' =>
array (
'period' =>
array (
'value' => 1,
'type' => 'month',
),
'amount' => 10,
'currency' => 'USD',
),
'expiration' =>
array (
'value' => '',
'type' => '',
),
)
));
POST /merchant/v2/merchants/{project_id}/subscriptions/plans HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"external_id": "sample_plan",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"group_id": "USA Products",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": "",
"type": ""
}
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"external_id": "sample_plan",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"group_id": "USA Products",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD",
},
"expiration": {
"value": "",
"type": ""
}
}'
Antwort
<?php
// example response
$response = array (
'plan_id' => 54
);
HTTP/1.1 201 Created
Content-Type: application/json
{
"plan_id": 54
}
{
"plan_id": 54
}
Abo-Modell aktualisieren
Aktualisiert ein Abo-Modell.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
plan_id | int | ID des Abo-Modells. |
external_id | string | Externe ID des Abo-Modells (32 Zeichen). Optional. |
name | array of strings | Bezeichnung des Abo-Modells. Besteht aus Paaren vom Typ "language":"plan name" (Sprache:Bezeichnung des Abo-Modells). |
description | array of strings | Beschreibung zum Abo-Modell. Besteht aus Paaren vom Typ "language":"plan description" (Sprache:Beschreibung zum Abo-Modell). |
group_id | string | Gruppen-ID. |
charge | object | Details zur Abrechnung (Objekt). |
charge.period | object | Abrechnungszeitraum (Objekt). |
charge.period.value | int | Anzahl der Zeiteinheiten. |
charge.period.type | string | Zeiteinheit: day / month. |
charge.amount | float | Abrechnungsbetrag. |
charge.currency | string | Kaufwährung. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
expiration | object | Details zum Auslaufen des Abonnements (Objekt). |
expiration.value | int | Zeitliche Gültigkeit. |
expiration.type | string | Zeiteinheit: day / month. |
trial | object | Angaben zum Probezeitraum (Objekt). Optional. |
trial.value | int | Probezeitraum. |
trial.type | string | Zeiteinheit: day. |
grace_period | object | Angaben zur Übergangsfrist. Optional. |
grace_period.value | int | Übergangsfrist. |
grace_period.type | string | Zeiteinheit: day. |
Anfrage
<?php
$response = $xsollaClient->UpdateSubscriptionPlan(array(
'project_id' => PROJECT_ID,
'plan_id' => PLAN_ID,
'request' => array (
'external_id' => 'sample_plan',
'name' =>
array (
'en' => 'Sample Plan',
),
'description' =>
array (
'en' => 'Basic options plan',
),
'charge' =>
array (
'period' =>
array (
'value' => 1,
'type' => 'month',
),
'amount' => 10,
'currency' => 'USD',
),
'expiration' =>
array (
'value' => '',
'type' => '',
),
)
));
PUT /merchant/v2/merchants/{project_id}/subscriptions/plans/{plan_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"external_id": "sample_plan",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": "",
"type": ""
}
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"external_id": "sample_plan",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": "",
"type": ""
}
}'
Antwort
<?php
// example response
$response = array (
'id' => '54',
'external_id' => 'sample_plan',
'name' =>
array (
'en' => 'Sample Plan'
),
'description' =>
array (
'en' => 'Basic options plan'
),
'charge' =>
array (
'period' =>
array (
'value' => 1,
'type' => 'month'
),
'amount' => 10,
'currency' => 'USD'
),
'expiration' =>
array (
'value' => '',
'type' => ''
),
'trial' =>
array (
'value' => 14,
'type' => 'day'
),
'status' =>
array (
'value' => 'disabled',
'counters' =>
array (
'active' => 0,
'canceled' => 0,
'expired' => 0
)
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "54",
"external_id": "sample_plan",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": "",
"type": ""
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"canceled": 0,
"expired": 0
}
}
}
{
"id": "54",
"external_id": "sample_plan",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": "",
"type": ""
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"canceled": 0,
"expired": 0
}
},
"type":
}
Abo-Modell löschen
Löscht ein Abo-Modell.
HTTP-ANFRAGE
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
plan_id | int | ID des Abo-Modells. |
Anfrage
<?php
$response = $xsollaClient->DeleteSubscriptionPlan(array(
'project_id' => PROJECT_ID,
'plan_id' => PLAN_ID
));
DELETE /merchant/v2/merchants/{project_id}/subscriptions/plans/{plan_id}/delete HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}/delete' \
-X DELETE \
-u merchant_id:merchant_api_key
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Abo-Modell deaktivieren
Deaktiviert ein Abo-Modell.
HTTP-ANFRAGE
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
plan_id | int | ID des Abo-Modells. |
Anfrage
<?php
$response = $xsollaClient->DisableSubscriptionPlan(array(
'project_id' => PROJECT_ID,
'plan_id' => PLAN_ID
));
DELETE /merchant/v2/merchants/{project_id}/subscriptions/plans/{plan_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}' \
-X DELETE \
-u merchant_id:merchant_api_key
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Abo-Modell aktivieren
Schaltet ein Abo-Modell aktiv.
HTTP-ANFRAGE
PATCH https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
plan_id | int | ID des Abo-Modells. |
Anfrage
<?php
$response = $xsollaClient->EnableSubscriptionPlan(array(
'project_id' => PROJECT_ID,
'plan_id' => PLAN_ID
));
PATCH /merchant/v2/merchants/{project_id}/subscriptions/plans/{plan_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans/{plan_id}' \
-X PATCH \
-u merchant_id:merchant_api_key
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Abo-Modelle auflisten
Listet alle Abo-Modelle auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
external_id | string | Externe ID des Abo-Modells. |
limit | int | Maximale Anzahl der abzurufenden Datensätze. |
offset | int | Offset des ersten abzurufenden Datensatzes. |
group_id | string | ID einer Gruppe, mit der die Abo-Modelle verknüpft sind. |
product_id | int | ID eines Produkts, mit dem die Abo-Modelle verknüpft sind. |
Anfrage
<?php
$response = $xsollaClient->ListSubscriptionPlans(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/subscriptions/plans?external_id=1&limit=1&offset=1 HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/plans?external_id=1&limit=1&offset=1' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => '54',
'external_id' => 'sample_plan',
'name' =>
array (
'en' => 'Sample Plan'
),
'description' =>
array (
'en' => 'Basic options plan'
),
'group_id' => 'USA Products',
'charge' =>
array (
'period' =>
array (
'value' => 1,
'type' => 'month'
),
'amount' => 10,
'currency' => 'USD'
),
'expiration' =>
array (
'value' => 90,
'type' => 'day'
),
'trial' =>
array (
'value' => 14,
'type' => 'day'
),
'status' =>
array (
'value' => 'disabled',
'counters' =>
array (
'active' => 0,
'canceled' => 0,
'expired' => 0
)
)
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": "54",
"external_id": "sample_plan",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"group_id": "USA Products",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": 90,
"type": "day"
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"canceled": 0,
"expired": 0
}
}
}
]
[
{
"id": "54",
"external_id": "sample_plan",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"group_id": "USA Products",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD",
},
"expiration": {
"value": 90,
"type": "day",
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"canceled": 0,
"expired": 0
}
}
}
]
Produkt anlegen
Legt ein abonnement-basiertes Produkt an.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
name | string | Produktbezeichnung. |
group_id | string | Gruppen-ID. |
Anfrage
<?php
$response = $xsollaClient->CreateSubscriptionProduct(array(
'project_id' => PROJECT_ID,
'request' => array(
'name' => 'Demo Product',
'group_id' => 'USA Products'
),
));
POST /merchant/v2/merchants/{project_id}/subscriptions/products HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"name": "Demo Product",
"group_id": "USA Products"
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"name": "Demo Product",
"group_id": "USA Products"
}'
Antwort
<?php
// example response
$response = array (
'product_id' => '64'
);
HTTP/1.1 201 Created
Content-Type: application/json
{
"product_id": "64"
}
{
"product_id": "64"
}
Produkt aktualisieren
Aktualisiert ein abonnement-basiertes Produkt.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
product_id | int | Produkt-ID. |
name | string | Produktbezeichnung. |
group_id | string | Gruppen-ID. |
Anfrage
<?php
$response = $xsollaClient->UpdateSubscriptionProduct(array(
'project_id' => PROJECT_ID,
'request' => array(
'name' => 'Demo Product',
'group_id' => 'USA Products'
),
));
PUT /merchant/v2/merchants/{project_id}/subscriptions/products/{product_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"name": "Demo Product",
"group_id": "USA Products"
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"name": "Demo Product",
"group_id": "USA Products"
}'
Antwort
<?php
// example response
$response = array (
'id' => '64',
'name' => 'Demo Product',
'group_id' => 'USA Products'
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "64",
"name": "Demo Product",
"group_id": "USA Products"
}
{
"id": "64",
"name": "Demo Product",
"group_id": "USA Products"
}
Produkt löschen
Löscht ein abonnement-basiertes Produkt.
HTTP-ANFRAGE
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
product_id | int | Produkt-ID. |
Anfrage
<?php
$response = $xsollaClient->DeleteSubscriptionProduct(array(
'project_id' => PROJECT_ID,
'product_id' => PRODUCT_ID
));
DELETE /merchant/v2/merchants/{project_id}/subscriptions/products/{product_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products/{product_id}' \
-X DELETE \
-u merchant_id:merchant_api_key
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Produkte auflisten
Listet alle abonnement-basierten Produkte auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
group_id | string | ID einer Gruppe, mit der die Produkte verknüpft sind. |
product_id | int | Produkt-id. |
limit | int | Maximale Anzahl der abzurufenden Datensätze. |
offset | int | Offset des ersten abzurufenden Datensatzes. |
Anfrage
<?php
$response = $xsollaClient->DeleteSubscriptionProduct(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/subscriptions/products?group_id=USA%20Products&limit=1&offset=1 HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/products?group_id=USA%20Products&limit=1&offset=1' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 3,
'group_id' => 'USA Products',
'name' => 'Demo Product'
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 3,
"group_id": "USA Products",
"name": "Demo Product"
}
]
[
{
"id": 3,
"group_id": "USA Products",
"name": "Demo Product"
}
]
Abonnement aktualisieren
Aktualisiert ein Abonnement, indem entweder dessen Status (active, canceled oder non_renewing) geändert oder das nächste Abrechnungsdatum zeitlich verschoben wird.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
subscription_id | int | Abonnement-ID. |
user_id | string | Benutzer-ID. |
status | string | Status: active / canceled / non_renewing. |
cancel_subscription_payment | boolean | Wird 'true' festgelegt, so wird die letzte, für dieses Abonnement getätigte Zahlung zurückerstattet. Funktioniert nur dann, wenn zugleich der Status auf 'canceled' gesetzt wird. |
timeshift | object | Zeitliche Zurückstellung der Abrechnung (Objekt). |
timeshift.value | string | Anzahl der Zeiteinheiten, um welche die Abrechnung zeitlich verschoben wird. Falls ein negativer Wert festgelegt wird, so wird die Abrechnung zeitlich vorverschoben. |
timeshift.type | string | Zeiteinheit: day / month. |
Anfrage
<?php
$response = $xsollaClient->UpdateSubscription(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'subscription_id' => SUBSCRIPTION_ID,
'request' => array (
'status' => 'canceled',
'timeshift' =>
array (
'value' => '30',
'type' => 'day',
)
)
));
PUT /merchant/v2/merchants/{project_id}/users/{user_id}/subscriptions/{subscription_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"status": "canceled",
"timeshift": {
"value": "30",
"type": "day"
}
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/{subscription_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"status": "canceled",
"timeshift": {
"value": "30",
"type": "day"
}
}'
Antwort
<?php
// example response
$response = array (
'id' => 45,
'plan' =>
array (
'id' => '54',
'external_id' => 'sample_plan',
'group_id' => 'USA Products',
'project_id' => 14004,
'name' =>
array (
'en' => 'Sample Plan'
),
'description' =>
array (
'en' => 'Basic options plan'
),
'localized_name' => 'Basic Plan',
'charge' =>
array (
'period' =>
array (
'value' => 1,
'type' => 'month'
),
'amount' => 10,
'currency' => 'USD'
),
'expiration' =>
array (
'value' => 90,
'type' => 'day'
),
'trial' =>
array (
'value' => 14,
'type' => 'day'
),
'status' =>
array (
'value' => 'active',
'counters' =>
array (
'active' => 0,
'canceled' => 1,
'expired' => 0
)
)
),
'user' =>
array (
'id' => '20',
),
'product' => null,
'charge_amount' => 10,
'currency' => 'USD',
'date_create' => '2014-09-30T15:34:17+06:00',
'date_end' => '2014-10-07T15:34:17+06:00',
'date_last_charge' => '2014-10-01T15:34:17+06:00',
'date_next_charge' => '2014-11-01T15:34:17+06:00',
'status' => 'canceled'
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 45,
"plan": {
"id": "54",
"external_id": "sample_plan",
"group_id": "USA Products",
"project_id": 14004,
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"localized_name": "Basic Plan",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": 90,
"type": "day"
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "active",
"counters": {
"active": 0,
"canceled": 1,
"expired": 0
}
}
},
"user": {
"id": "20"
},
"product": null,
"charge_amount": 10,
"currency": "USD",
"date_create": "2014-09-30T15:34:17+06:00",
"date_end": "2014-10-07T15:34:17+06:00",
"date_last_charge": "2014-10-01T15:34:17+06:00",
"date_next_charge": "2014-11-01T15:34:17+06:00",
"status": "canceled"
}
{
"id": 45,
"plan": {
"id": "54",
"external_id": "sample_plan",
"group_id": "USA Products",
"project_id": 14004,
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"localized_name": "Basic Plan",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": 90,
"type": "day"
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "active",
"counters": {
"active": 0,
"canceled": 1,
"expired": 0
}
}
},
"user": {
"id": "20"
},
"product": null,
"charge_amount": 10,
"currency": "USD",
"date_create": "2014-09-30T15:34:17+06:00",
"date_end": "2014-10-07T15:34:17+06:00",
"date_last_charge": "2014-10-01T15:34:17+06:00",
"date_next_charge": "2014-11-01T15:34:17+06:00",
"status": "canceled"
}
Abonnements auflisten
Listet alle sich automatisch verlängernden Abonnements auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. Erforderlich. |
user_id | string | Benutzer-ID im Spiel. Erforderlich. |
status | string | Status: active / canceled / non_renewing / new. |
limit | int | Maximale Anzahl der abzurufenden Datensätze. |
offset | int | Offset des ersten abzurufenden Datensatzes. |
datetime_from | datetime | Beginn des Zeitraums. |
datetime_to | datetime | Ende des Zeitraums. |
plan_id | string | ID des Abo-Modells. |
product_id | string | Produkt-ID. |
Anfrage
<?php
$response = $xsollaClient->ListSubscriptions(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID
));
GET /merchant/v2/merchants/{project_id}/users/{user_id}/subscriptions?status=active&limit=1&offset=1&datetime_from=2014-10-01T00%3A00%3A00Z&datetime_to=2014-10-02T00%3A00%3A00Z HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions?status=active&limit=1&offset=1&datetime_from=2014-10-01T00%3A00%3A00Z&datetime_to=2014-10-02T00%3A00%3A00Z' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 45,
'plan' =>
array (
'id' => '54',
'external_id' => 'sample_plan',
'group_id' => 'USA Products',
'project_id' => 14004,
'name' =>
array (
'en' => 'Sample Plan'
),
'description' =>
array (
'en' => 'Basic options plan'
),
'localized_name' => 'Basic Plan',
'charge' =>
array (
'period' =>
array (
'value' => 1,
'type' => 'month'
),
'amount' => 10,
'currency' => 'USD'
),
'expiration' =>
array (
'value' => 90,
'type' => 'day'
),
'trial' =>
array (
'value' => 14,
'type' => 'day'
),
'status' =>
array (
'value' => 'disabled',
'counters' =>
array (
'active' => 0,
'canceled' => 0,
'expired' => 0
)
)
),
'user' =>
array (
'id' => '20'
),
'product' => null,
'charge_amount' => 10,
'currency' => 'USD',
'date_create' => '2014-09-30T15:34:17+04:00',
'date_end' => '2014-10-07T15:34:17+04:00',
'date_last_charge' => '2014-10-01T15:34:17+04:00',
'date_next_charge' => null,
'status' => 'active'
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 45,
"plan": {
"id": "54",
"external_id": "sample_plan",
"group_id": "USA Products",
"project_id": 14004,
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"localized_name": "Basic Plan",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": 90,
"type": "day"
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"canceled": 0,
"expired": 0
}
}
},
"user": {
"id": "20"
},
"product": null,
"charge_amount": 10,
"currency": "USD",
"date_create": "2014-09-30T15:34:17+04:00",
"date_end": "2014-10-07T15:34:17+04:00",
"date_last_charge": "2014-10-01T15:34:17+04:00",
"date_next_charge": null,
"status": "active"
}
]
[
{
"id": 45,
"plan": {
"id": "54",
"external_id": "sample_plan",
"group_id": "USA Products",
"project_id": 14004,
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"localized_name": "Basic Plan",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": 90,
"type": "day"
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"canceled": 0,
"expired": 0
}
}
},
"user": {
"id": "20"
},
"product": null,
"charge_amount": 10,
"currency": "USD",
"date_create": "2014-09-30T15:34:17+04:00",
"date_end": "2014-10-07T15:34:17+04:00",
"date_last_charge": "2014-10-01T15:34:17+04:00",
"date_next_charge": null,
"status": "active"
}
]
Zahlungen auflisten
Listet alle Abonnement-Zahlungen auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/payments
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Benutzer-ID im Spiel. |
status | string | Status: processing / canceled / done. |
limit | int | Maximale Anzahl der abzurufenden Datensätze. |
offset | int | Offset des ersten abzurufenden Datensatzes. |
datetime_from | datetime | Beginn des Zeitraums. |
datetime_to | datetime | Ende des Zeitraums. |
subscription_id | int | Abonnement-ID. |
Anfrage
<?php
$response = $xsollaClient->ListSubscriptionPayments(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/subscriptions/payments?status=done&limit=1&offset=1&datetime_from=2014-10-01T00%3A00%3A00Z&datetime_to=2014-10-02T00%3A00%3A00Z HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/payments?status=done&limit=1&offset=1&datetime_from=2014-10-01T00%3A00%3A00Z&datetime_to=2014-10-02T00%3A00%3A00Z' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 35,
'id_payment' => 118441192,
'date_payment' => '2014-09-30T15:34:17+04:00',
'status' => 'done',
'subscription' =>
array (
'id' => 45,
'plan' =>
array (
'id' => '54',
'external_id' => 'sample_plan',
'group_id' => 'USA Products',
'name' =>
array (
'en' => 'Sample Plan'
),
'description' =>
array (
'en' => 'Basic options plan'
),
'localized_name' => 'Basic Plan',
'charge' =>
array (
'period' =>
array (
'value' => 1,
'type' => 'month'
),
'amount' => 10,
'currency' => 'USD'
),
'expiration' =>
array (
'value' => 90,
'type' => 'day'
),
'trial' =>
array (
'value' => 14,
'type' => 'day'
),
'status' =>
array (
'value' => 'disabled',
'counters' =>
array (
'active' => 0,
'closed' => 0,
'expired' => 0
)
)
),
'user' =>
array (
'id' => 20,
'name' => 'John Smith'
),
'product' => null,
'charge_amount' => 10,
'currency' => 'USD',
'date_create' => '2014-09-30T15:34:17+04:00',
'date_end' => '2014-10-07T15:34:17+04:00',
'date_last_charge' => '2014-10-01T15:34:17+04:00',
'date_next_charge' => '2014-11-01T15:34:17+04:00',
'status' => 'done'
)
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 35,
"id_payment": 118441192,
"date_payment": "2014-09-30T15:34:17+04:00",
"status": "done",
"subscription": {
"id": 45,
"plan": {
"id": "54",
"external_id": "sample_plan",
"group_id": "USA Products",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"localized_name": "Basic Plan",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": 90,
"type": "day"
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"closed": 0,
"expired": 0
}
}
},
"user": {
"id": 20,
"name": "John Smith"
},
"product": null,
"charge_amount": 10,
"currency": "USD",
"date_create": "2014-09-30T15:34:17+04:00",
"date_end": "2014-10-07T15:34:17+04:00",
"date_last_charge": "2014-10-01T15:34:17+04:00",
"date_next_charge": "2014-11-01T15:34:17+04:00",
"status": "done"
}
}
]
[
{
"id": 35,
"id_payment": 118441192,
"date_payment": "2014-09-30T15:34:17+04:00",
"status": "done",
"subscription": {
"id": 45,
"plan": {
"id": "54",
"external_id": "sample_plan",
"group_id": "USA Products",
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"localized_name": "Basic Plan",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": 90,
"type": "day"
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"closed": 0,
"expired": 0
}
}
},
"user": {
"id": 20,
"name": "John Smith"
},
"product": null,
"charge_amount": 10,
"currency": "USD",
"date_create": "2014-09-30T15:34:17+04:00",
"date_end": "2014-10-07T15:34:17+04:00",
"date_last_charge": "2014-10-01T15:34:17+04:00",
"date_next_charge": "2014-11-01T15:34:17+04:00",
"status": "done"
}
}
]
Zahlungen eines Benutzers auflisten
Listet alle getätigten Zahlungen eines bestimmten Benutzers auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/payments
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Benutzer-ID im Spiel. |
status | string | Status: processing / canceled / done. |
limit | int | Maximale Anzahl der abzurufenden Datensätze. |
offset | int | Offset des ersten abzurufenden Datensatzes. |
datetime_from | datetime | Beginn des Zeitraums. |
datetime_to | datetime | Ende des Zeitraums. |
subscription_id | int | Abonnement-ID. |
Anfrage
<?php
$response = $xsollaClient->ListUserSubscriptionPayments(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID
));
GET /merchant/v2/merchants/{project_id}/users/{user_id}/subscriptions/payments?status=done&limit=1&offset=1&datetime_from=2014-10-01T00%3A00%3A00Z&datetime_to=2014-10-02T00%3A00%3A00Z HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/subscriptions/payments?status=done&limit=1&offset=1&datetime_from=2014-10-01T00%3A00%3A00Z&datetime_to=2014-10-02T00%3A00%3A00Z' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 35,
'id_payment' => 118441192,
'date_payment' => '2014-09-30T15:34:17+04:00',
'status' => 'done',
'subscription' =>
array (
'id' => 45,
'plan' =>
array (
'id' => '54',
'external_id' => 'sample_plan',
'group_id' => 'USA Products',
'project_id' => 14004,
'name' =>
array (
'en' => 'Sample Plan'
),
'description' =>
array (
'en' => 'Basic options plan'
),
'localized_name' => 'Basic Plan',
'charge' =>
array (
'period' =>
array (
'value' => 1,
'type' => 'month'
),
'amount' => 10,
'currency' => 'USD'
),
'expiration' =>
array (
'value' => 90,
'type' => 'day'
),
'trial' =>
array (
'value' => 14,
'type' => 'day'
),
'status' =>
array (
'value' => 'disabled',
'counters' =>
array (
'active' => 0,
'closed' => 0,
'expired' => 0
)
)
),
'user' =>
array (
'id' => 20,
'name' => 'John Smith'
),
'product' => null,
'charge_amount' => 10,
'currency' => 'USD',
'date_create' => '2014-09-30T15:34:17+04:00',
'date_end' => '2014-10-07T15:34:17+04:00',
'date_last_charge' => '2014-10-01T15:34:17+04:00',
'date_next_charge' => '2014-11-01T15:34:17+04:00',
'status' => 'done'
)
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 35,
"id_payment": 118441192,
"date_payment": "2014-09-30T15:34:17+04:00",
"status": "done",
"subscription": {
"id": 45,
"plan": {
"id": "54",
"external_id": "sample_plan",
"group_id": "USA Products",
"project_id": 14004,
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"localized_name": "Basic Plan",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": 90,
"type": "day"
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"closed": 0,
"expired": 0
}
}
},
"user": {
"id": 20,
"name": "John Smith"
},
"product": null,
"charge_amount": 10,
"currency": "USD",
"date_create": "2014-09-30T15:34:17+04:00",
"date_end": "2014-10-07T15:34:17+04:00",
"date_last_charge": "2014-10-01T15:34:17+04:00",
"date_next_charge": "2014-11-01T15:34:17+04:00",
"status": "done"
}
}
]
[
{
"id": 35,
"id_payment": 118441192,
"date_payment": "2014-09-30T15:34:17+04:00",
"status": "done",
"subscription": {
"id": 45,
"plan": {
"id": "54",
"external_id": "sample_plan",
"group_id": "USA Products",
"project_id": 14004,
"name": {
"en": "Sample Plan"
},
"description": {
"en": "Basic options plan"
},
"localized_name": "Basic Plan",
"charge": {
"period": {
"value": 1,
"type": "month"
},
"amount": 10,
"currency": "USD"
},
"expiration": {
"value": 90,
"type": "day"
},
"trial": {
"value": 14,
"type": "day"
},
"status": {
"value": "disabled",
"counters": {
"active": 0,
"closed": 0,
"expired": 0
}
}
},
"user": {
"id": 20,
"name": "John Smith"
},
"product": null,
"charge_amount": 10,
"currency": "USD",
"date_create": "2014-09-30T15:34:17+04:00",
"date_end": "2014-10-07T15:34:17+04:00",
"date_last_charge": "2014-10-01T15:34:17+04:00",
"date_next_charge": "2014-11-01T15:34:17+04:00",
"status": "done"
}
}
]
Währungen auflisten
Listet alle unterstützten Abonnement-Währungen auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/currencies
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
Anfrage
<?php
$response = $xsollaClient->ListSubscriptionCurrencies(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/subscriptions/currencies HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/subscriptions/currencies' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array(
"AED",
"ALL",
"AMD",
"ARS",
"AUD",
"AZN",
"BGN",
"BRL",
"BYR",
"CAD",
"CHF",
"CLP",
"CNY",
"COP",
"CZK",
"DKK",
"DZD",
"EGP",
"EUR",
"GBP",
"GEL",
"HKD",
"HRK",
"HUF",
"IDR",
"ILS",
"INR",
"JPY",
"KES",
"KGS",
"KRW",
"KZT",
"MAD",
"MDL",
"MKD",
"MNT",
"MXN",
"MYR",
"NGN",
"NOK",
"NZD",
"PEN",
"PHP",
"PKR",
"PLN",
"RON",
"RSD",
"RUB",
"SAR",
"SEK",
"SGD",
"THB",
"TRY",
"UAH",
"USD",
"UYU",
"UZS",
"VND",
"ZAR"
);
HTTP/1.1 200 OK
Content-Type: application/json
[
"AED",
"ALL",
"AMD",
"ARS",
"AUD",
"AZN",
"BGN",
"BRL",
"BYR",
"CAD",
"CHF",
"CLP",
"CNY",
"COP",
"CZK",
"DKK",
"DZD",
"EGP",
"EUR",
"GBP",
"GEL",
"HKD",
"HRK",
"HUF",
"IDR",
"ILS",
"INR",
"JPY",
"KES",
"KGS",
"KRW",
"KZT",
"MAD",
"MDL",
"MKD",
"MNT",
"MXN",
"MYR",
"NGN",
"NOK",
"NZD",
"PEN",
"PHP",
"PKR",
"PLN",
"RON",
"RSD",
"RUB",
"SAR",
"SEK",
"SGD",
"THB",
"TRY",
"UAH",
"USD",
"UYU",
"UZS",
"VND",
"ZAR"
]
[
"AED",
"ALL",
"AMD",
"ARS",
"AUD",
"AZN",
"BGN",
"BRL",
"BYR",
"CAD",
"CHF",
"CLP",
"CNY",
"COP",
"CZK",
"DKK",
"DZD",
"EGP",
"EUR",
"GBP",
"GEL",
"HKD",
"HRK",
"HUF",
"IDR",
"ILS",
"INR",
"JPY",
"KES",
"KGS",
"KRW",
"KZT",
"MAD",
"MDL",
"MKD",
"MNT",
"MXN",
"MYR",
"NGN",
"NOK",
"NZD",
"PEN",
"PHP",
"PKR",
"PLN",
"RON",
"RSD",
"RUB",
"SAR",
"SEK",
"SGD",
"THB",
"TRY",
"UAH",
"USD",
"UYU",
"UZS",
"VND",
"ZAR"
]
Benutzerattribute auflisten
Listet alle Benutzerattribute auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
Anfrage
<?php
$response = $xsollaClient->ListUserAttributes(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/user_attributes HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 2,
'key' => 'level',
'localized_name' =>
array (
'en' => 'Level'
),
'name' => 'Level',
'type' => 'int',
'list_of_values' =>
array (
),
'visible' => true,
'skip_condition_on_nonexistent_key' => false
),
array (
'id' => 3,
'key' => 'class',
'localized_name' =>
array (
)
'name' => null,
'type' => 'string',
'list_of_values' =>
array (
),
'visible' => true,
'skip_condition_on_nonexistent_key' => false
),
array (
'id' => 4,
'key' => 'type',
'localized_name' =>
array (
)
'name' => null,
'type' => 'enum',
'list_of_values' =>
array (
0 => 'class1',
1 => 'class2',
2 => 'class3'
),
'visible' => true,
'skip_condition_on_nonexistent_key' => false
),
array (
'id' => 5,
'key' => 'date',
'localized_name' =>
array (
'en' => 'Date'
),
'name' => 'Date',
'type' => 'date',
'list_of_values' =>
array (
),
'visible' => true,
'skip_condition_on_nonexistent_key' => false
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 2,
"key": "level",
"localized_name": {
"en": "Level"
},
"name": "Level",
"type": "int",
"list_of_values": [],
"visible":true,
"skip_condition_on_nonexistent_key": false
},
{
"id": 3,
"key": "class",
"localized_name": [],
"name": null,
"type": "string",
"list_of_values": [],
"visible":true
},
{
"id": 4,
"key": "type",
"localized_name": [],
"name": null,
"type": "enum",
"list_of_values": [
"class1",
"class2",
"class3"
],
"visible":true,
"skip_condition_on_nonexistent_key": false
},
{
"id": 5,
"key": "date",
"localized_name": {
"en": "Date"
},
"name": "Date",
"type": "date",
"list_of_values": [],
"visible":true,
"skip_condition_on_nonexistent_key": false
}
]
[
{
"id": 2,
"key": "level",
"localized_name": {
"en": "Level"
},
"name": "Level",
"type": "int",
"list_of_values": [],
"visible":true,
"skip_condition_on_nonexistent_key": false
},
{
"id": 3,
"key": "class",
"localized_name": [],
"name": null,
"type": "string",
"list_of_values": [],
"visible":true,
"skip_condition_on_nonexistent_key": false
},
{
"id": 4,
"key": "type",
"localized_name": [],
"name": null,
"type": "enum",
"list_of_values": [
"class1",
"class2",
"class3"
],
"visible":true,
"skip_condition_on_nonexistent_key": false
},
{
"id": 5,
"key": "date",
"localized_name": {
"en": "Date"
},
"name": "Date",
"type": "date",
"list_of_values": [],
"visible":true,
"skip_condition_on_nonexistent_key": false
}
]
Benutzerattribut anfordern
Fordert Angaben zu einem bestimmten Benutzerattribut an.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{user_attribute_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_attribute_id | int | ID des Benutzerattributs. |
Anfrage
<?php
$response = $xsollaClient->GetUserAttribute(array(
'project_id' => PROJECT_ID,
'user_attribute_id' => USER_ATTRIBUTE_ID
));
GET /merchant/v2/merchants/{project_id}/user_attributes/{user_attribute_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{user_attribute_id}' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 2,
'key' => 'level',
'localized_name' =>
array (
'en' => 'level',
'de' => 'niveau'
),
'name' => 'Level',
'type' => 'int',
'list_of_values' =>
array (),
'visible' => true,
'skip_condition_on_nonexistent_key' => false
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 2,
"key": "level",
"localized_name": {
"en": "level",
"de": "niveau"
},
"name": "Level",
"type": "int",
"list_of_values": [],
"visible":true,
"skip_condition_on_nonexistent_key": false
}
{
"id": 2,
"key": "level",
"localized_name": {
"en": "level",
"de": "niveau"
},
"name": "Level",
"type": "int",
"list_of_values": [],
"visible":true,
"skip_condition_on_nonexistent_key": false
}
Benutzerattribute anlegen
Legt ein Benutzerattribut an.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. Erforderlich. |
key | string | Schlüssel des Benutzerattributs. Erforderlich. |
name | array of strings | Lokalisierte Attributbezeichnungen. Erforderlich. |
type | string | Art des Schlüssels. Als Wert lässt sich entweder 'int', 'string', 'enum' oder 'date' festlegen. Erforderlich. |
list_of_values | array | Mögliche Werte für type=enum (Array). Erforderlich. |
skip_condition_on_nonexistent_key | boolean | Legt fest, ob die Bedingung bei nicht vorhandenem Schlüssel übersprungen wird. |
Anfrage
<?php
$response = $xsollaClient->CreateUserAttribute(array(
'project_id' => PROJECT_ID,
'request' => array (
'key' => 'class',
'name' =>
array (
'en' => 'Сlass',
'de' => 'Classe',
),
'type' => 'enum',
'list_of_values' =>
array (
'Warrior',
'magic',
),
)
));
POST /merchant/v2/merchants/{project_id}/user_attributes HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"key": "class",
"name": {
"en": "Сlass",
"de": "Classe"
},
"type": "enum",
"list_of_values": ["Warrior", "magic"],
"visible":true
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"key": "class",
"name": {
"en": "Сlass",
"de": "Classe"
},
"type": "enum",
"list_of_values": ["Warrior", "magic"],
"visible":true
}'
Antwort
<?php
// example response
$response = array (
'id' => 77
);
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": 77
}
{
"id": 77
}
Benutzerattribut aktualisieren
Aktualisiert ein Benutzerattribut.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{user_attribute_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_attribute_id | int | ID des Benutzerattributs. |
key | string | Benutzerattribut-Schlüssel. >* 400 Bad Request — Weist oftmals darauf hin, dass ein erforderlicher Parameter fehlt. |
name | array of strings | Lokalisierte Bezeichnungen des Benutzerattributs (Array). |
type | string | Art des Schlüssels. Als Wert lässt sich entweder 'int', 'string', 'enum' oder 'date' festlegen. >* 400 Bad Request — Weist oftmals darauf hin, dass ein erforderlicher Parameter fehlt. |
list_of_values | array | Mögliche Werte für type=enum (Array). |
skip_condition_on_nonexistent_key | boolean | Legt fest, ob die Bedingung bei nicht vorhandenem Schlüssel übersprungen wird. |
Anfrage
<?php
$response = $xsollaClient->UpdateUserAttribute(array(
'project_id' => PROJECT_ID,
'user_attribute_id' => USER_ATTRIBUTE_ID,
'request' => array(
'key' => 'class',
'name' =>
array (
'en' => 'Сlass',
'de' => 'Classe',
),
'type' => 'enum',
'list_of_values' =>
array (
'Warrior',
'magic',
),
'skip_condition_on_nonexistent_key' => false
)
));
PUT /merchant/v2/merchants/{project_id}/user_attributes/{user_attribute_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"key": "class",
"localized_name": {
"en": "Сlass",
"de": "Classe"
},
"type": "enum",
"list_of_values": ["Warrior", "magic"],
"visible":true,
"skip_condition_on_nonexistent_key": false
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{user_attribute_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"key": "class",
"localized_name": {
"en": "Сlass",
"de": "Classe"
},
"type": "enum",
"list_of_values": ["Warrior", "magic"],
"visible":true,
"skip_condition_on_nonexistent_key": false
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Benutzerattribut löschen
Löscht ein Benutzerattribut.
HTTP-ANFRAGE
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{user_attribute_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_attribute_id | int | ID des Benutzerattributs. |
Anfrage
<?php
$response = $xsollaClient->DeleteUserAttribute(array(
'project_id' => PROJECT_ID,
'user_attribute_id' => USER_ATTRIBUTE_ID
));
DELETE /merchant/v2/merchants/{project_id}/user_attributes/{user_attribute_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/user_attributes/{user_attribute_id}' \
-X DELETE \
-u merchant_id:merchant_api_key
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Virtuellen Gegenstand anlegen
Legt einen virtuellen Gegenstand an.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
sku | string | Eindeutige ID des Gegenstands. Die Artikelposition (SKU) darf nur lateinische Kleinbuchstaben, Ziffern, Bindestriche und Unterstriche enthalten. |
item_code | string | Zusätzlicher Code des Gegenstands. Optional. |
name | array of strings | Lokalisierte Namen des Gegenstands (Array). |
description | array of strings | Lokalisierte Beschreibungen des Gegenstands (Array). |
long_description | array of strings | Lokalisierte ausführliche Beschreibungen des Gegenstands (Array). |
prices | array | Preise für den Gegenstand (Array). |
default_currency | string | Standardwährung beim Kauf. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
enabled | boolean | Legt fest, ob das Produkt erworben werden kann. |
permanent | boolean | Falls der Wert 'true' festgelegt ist, kann der Gegenstand nur einmal erworben werden. |
image_url | string | Bild-URL. |
item_type | string | Art des Gegenstands: Consumable / Expiration / Permanent |
expiration | int | Zeit bis zum Auslaufen in Sekunden. **Kommt nur bei item_type=expiration zur Anwendung. |
groups | array of integers | Gruppen, zu denen der Gegenstand gehört (Array). |
deleted | boolean | Legt fest, ob der Gegenstand entfernt wurde. |
user_attribute_conditions | array of objects | Liste der Bedingungen für das Benutzerattribut. |
user_attribute_conditions.right_operand | array | Werte, die zum Vergleich mit dem Benutzerattribut dienen. |
user_attribute_conditions.user_attribute_key | string | Schlüssel der Benutzerattribut-Bedingung. |
user_attribute_conditions.operation | string | Art der Vergleichsoperation. Als Wert lässt sich entweder 'greater', 'greaterOrEqual', 'equal', 'notEqual', 'less', 'lessOrEqual', 'between', 'in' oder 'notIn' festlegen. |
user_attribute_conditions.action | string | Art der Aktion. Als Wert lässt sich entweder 'hide', 'block' oder 'warning' festlegen. |
advertisement_type | string | Eine besondere Kennzeichnung, welche im Zahlungsportal angezeigt wird. Als Wert lässt sich entweder 'recommended', 'best_deal', 'special_offer' oder null festlegen. |
virtual_currency_price | int | Preis des Gegenstands in der virtuellen Währung. Falls als Wert 'null' festgelegt ist, kann der Gegenstand ausschließlich mit Echtgeld erworben werden. |
purchase_limit | int | Legt fest, wie oft ein Gegenstand erworben werden kann (unbegrenzt falls als Wert null festgelegt ist). |
keywords | array | Schlagwörter, mit denen sich im Zahlungsportal der Gegenstand finden lässt. |
Anfrage
<?php
$response = $xsollaClient->CreateVirtualItem(array(
'project_id' => PROJECT_ID,
'request' => array (
'sku' => 'T-43-3-unique-id',
'item_code' => 'chinese-medium-tank',
'name' =>
array (
'en' => 'T-34-3',
),
'description' =>
array (
'en' => 'Chinese Tier VIII medium tank.',
),
'long_description' =>
array (
'en' => 'This Chinese Tier VIII medium tank is a real beast in its class.',
),
'prices' =>
array (
'USD' => 40.09,
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'image_url' => 'http://livedemo.xsolla.com/airplanes/tank5.jpg',
'item_type' => 'Expiration',
'expiration' => 1296000,
'groups' =>
array (
24,
25,
),
'user_attribute_conditions' =>
array (
array (
'right_operand' =>
array (
'magic',
),
'id' => 2015,
'user_attribute_key' => 'type',
'operation' => 'equal',
'action' => 'hide',
'name' => null,
),
),
'virtual_currency_price' => null,
'purchase_limit' => null,
'keywords' =>
array (
'de' =>
array (
'Inhalt',
'Aufgaben',
'Region',
'Landschaft',
),
'en' =>
array (
'content',
'quests',
'region',
'landscape',
),
),
'advertisement_type' => 'recommended',
'deleted' => false,
)
));
POST /merchant/v2/merchants/{project_id}/virtual_items/items HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "Expiration",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "Expiration",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}'
Antwort
<?php
// example response
$response = array (
'item_id' => 77
);
HTTP/1.1 201 Created
Content-Type: application/json
{
"item_id": 77
}
{
"item_id": 77
}
Virtuellen Gegenstand anfordern
Ruft einen virtuellen Gegenstand ab.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}
Parameter | Typ | Beschreibung |
---|---|---|
item_id | int | ID des Gegenstands. |
Anfrage
<?php
$response = $xsollaClient->GetVirtualItem(array(
'project_id' => PROJECT_ID,
'item_id' => ITEM_ID
));
GET /merchant/v2/merchants/{project_id}/virtual_items/items/{item_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 77,
'sku' => 'T-43-3-unique-id',
'item_code' => 'chinese-medium-tank',
'name' =>
array (
'en' => 'T-34-3'
),
'description' =>
array (
'en' => 'Chinese Tier VIII medium tank.'
),
'long_description' =>
array (
'en' => 'This Chinese Tier VIII medium tank is a real beast in its class.'
),
'prices' =>
array (
'USD' => 40.09
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'image_url' => 'http://livedemo.xsolla.com/airplanes/tank5.jpg',
'item_type' => 'Expiration',
'expiration' => 1296000,
'groups' =>
array (
24,
25
),
'user_attribute_conditions' =>
array (
array (
'right_operand' =>
array (
'magic',
),
'id' => 2015,
'user_attribute_key' => 'type',
'operation' => 'equal',
'action' => 'hide',
'name' => null,
),
),
'virtual_currency_price' => null,
'purchase_limit' => null,
'keywords' =>
array (
'de' =>
array (
'Inhalt',
'Aufgaben',
'Region',
'Landschaft',
),
'en' =>
array (
'content',
'quests',
'region',
'landscape',
),
),
'advertisement_type' => 'recommended',
'deleted' => false,
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 77,
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "Expiration",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}
{
"id": 77,
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "Expiration",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}
Virtuellen Gegenstand aktualisieren
Aktualisiert einen virtuellen Gegenstand.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}
Parameter | Typ | Beschreibung |
---|---|---|
item_id | int | ID des Gegenstands. |
sku | string | Eindeutige ID des Gegenstands. Die Artikelposition (SKU) darf nur lateinische Kleinbuchstaben, Ziffern, Bindestriche und Unterstriche enthalten. |
item_code | string | Zusätzlicher Code des Gegenstands. Optional. |
name | array of strings | Lokalisierte Namen des Gegenstands (Array). |
description | array of strings | Lokalisierte Beschreibungen des Gegenstands (Array). |
long_description | array of strings | Lokalisierte ausführliche Beschreibungen des Gegenstands (Array). |
prices | array | Preise für den Gegenstand (Array). |
default_currency | string | Standardwährung beim Kauf. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
enabled | boolean | Legt fest, ob das Produkt erworben werden kann. |
permanent | boolean | Falls der Wert 'true' festgelegt ist, kann der Gegenstand nur einmal erworben werden. |
image_url | string | Bild-URL. |
item_type | string | Art des Gegenstands: Consumable / Expiration / Permanent |
expiration | int | Zeit bis zum Auslaufen in Sekunden. **Kommt nur bei item_type=expiration zur Anwendung. |
groups | array of integers | Gruppen, zu denen der Gegenstand gehört (Array). |
deleted | boolean | Legt fest, ob der Gegenstand entfernt wurde. |
user_attribute_conditions | array of objects | Liste der Bedingungen für das Benutzerattribut. |
user_attribute_conditions.right_operand | array | Werte, die zum Vergleich mit dem Benutzerattribut dienen. |
user_attribute_conditions.user_attribute_key | string | Schlüssel der Benutzerattribut-Bedingung. |
user_attribute_conditions.operation | string | Art der Vergleichsoperation. Als Wert lässt sich entweder 'greater', 'greaterOrEqual', 'equal', 'notEqual', 'less', 'lessOrEqual', 'between', 'in' oder 'notIn' festlegen. |
user_attribute_conditions.action | string | Art der Aktion. Als Wert lässt sich entweder 'hide', 'block' oder 'warning' festlegen. |
advertisement_type | string | Eine besondere Kennzeichnung, welche im Zahlungsportal angezeigt wird. Als Wert lässt sich entweder 'recommended', 'best_deal', 'special_offer' oder null festlegen. |
virtual_currency_price | int | Preis des Gegenstands in der virtuellen Währung. Falls als Wert 'null' festgelegt ist, kann der Gegenstand ausschließlich mit Echtgeld erworben werden. |
purchase_limit | int | Legt fest, wie oft ein Gegenstand erworben werden kann (unbegrenzt falls als Wert null festgelegt ist). |
keywords | array | Schlagwörter, mit denen sich im Zahlungsportal der Gegenstand finden lässt. |
Anfrage
<?php
$response = $xsollaClient->UpdateVirtualItem(array(
'project_id' => PROJECT_ID,
'request' => array (
'sku' => 'T-43-3-unique-id',
'item_code' => 'chinese-medium-tank',
'name' =>
array (
'en' => 'T-34-3',
),
'description' =>
array (
'en' => 'Chinese Tier VIII medium tank.',
),
'long_description' =>
array (
'en' => 'This Chinese Tier VIII medium tank is a real beast in its class.',
),
'prices' =>
array (
'USD' => 40.09,
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'image_url' => 'http://livedemo.xsolla.com/airplanes/tank5.jpg',
'item_type' => 'Expiration',
'expiration' => 1296000,
'groups' =>
array (
24,
25,
),
'user_attribute_conditions' =>
array (
array (
'right_operand' =>
array (
'magic',
),
'id' => 2015,
'user_attribute_key' => 'type',
'operation' => 'equal',
'action' => 'hide',
'name' => null,
),
),
'virtual_currency_price' => null,
'purchase_limit' => null,
'keywords' =>
array (
'de' =>
array (
'Inhalt',
'Aufgaben',
'Region',
'Landschaft',
),
'en' =>
array (
'content',
'quests',
'region',
'landscape',
),
),
'advertisement_type' => 'recommended',
'deleted' => false,
)
));
PUT /merchant/v2/merchants/{project_id}/virtual_items/items/{item_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "Expiration",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "Expiration",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Virtuellen Gegenstand entfernen
Entfernt einen virtuellen Gegenstand.
HTTP-ANFRAGE
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}
Parameter | Typ | Beschreibung |
---|---|---|
item_id | int | ID des Gegenstands. |
Anfrage
<?php
$response = $xsollaClient->DeleteVirtualItem(array(
'project_id' => PROJECT_ID,
'item_id' => ITEM_ID
));
DELETE /merchant/v2/merchants/{project_id}/virtual_items/items/{item_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items/{item_id}' \
-X DELETE \
-u merchant_id:merchant_api_key
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Virtuelle Gegenstände auflisten
Listet alle virtuellen Gegenstände auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
offset | int | Offset des ersten abzurufenden Datensatzes. |
limit | int | Maximale Anzahl der abzurufenden Datensätze. |
has_price | string | Preistyp: 'virtual_currency' oder 'real_currency', je nachdem, ob der Gegenstand mit virtueller Währung oder Echtgeld erworben werden kann. |
Anfrage
<?php
$response = $xsollaClient->ListVirtualItems(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/virtual_items/items HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/items' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 46,
'sku' => 'T-43-3-unique-id',
'localized_name' => 'T-34-3',
'prices' =>
array (
'USD' => 40.09
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'groups' =>
array (
25
),
'advertisement_type' => null,
'virtual_currency_price' => null
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 46,
"sku": "T-43-3-unique-id",
"localized_name": "T-34-3",
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"groups": [
25
],
"advertisement_type": null,
"virtual_currency_price": null
}
]
[
{
"id": 46,
"sku": "T-43-3-unique-id",
"localized_name": "T-34-3",
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"groups": [
25
],
"advertisement_type": null,
"virtual_currency_price": null
}
]
Gruppe anlegen
Legt eine Gruppe für virtuelle Gegenstände an.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
name | array of strings | Lokalisierte Gruppennamen (Array). |
description | array of strings | Lokalisierte Beschreibungen der Gruppe (Array). |
enabled | boolean | Schaltet die Gruppe aktiv. |
parent_id | int | ID der übergeordneten Gruppe. |
code | int | Individueller Code der Gruppe. |
Anfrage
<?php
$response = $xsollaClient->CreateVirtualItemsGroup(array(
'project_id' => PROJECT_ID,
'request' => array (
'name' =>
array (
'en' => 'Tanks',
),
'description' =>
array (
'en' => 'Tanks Group',
),
'enabled' => true,
'parent_id' => null,
'code' => null
)
));
POST /merchant/v2/merchants/{project_id}/virtual_items/groups HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"name": {
"en": "Tanks"
},
"description": {
"en": "Tanks Group"
},
"enabled": true,
"parent_id": null,
"code": null
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"name": {
"en": "Tanks"
},
"description": {
"en": "Tanks Group"
},
"enabled": true,
"parent_id": null,
"code": null
}'
Antwort
<?php
// example response
$response = array (
'group_id' => 7
);
HTTP/1.1 201 Created
Content-Type: application/json
{
"group_id": 7
}
{
"group_id": 7
}
Gruppe anfordern
Ruft Informationen zu einer Gruppe für virtuelle Gegenstände ab.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}
Parameter | Typ | Beschreibung |
---|---|---|
group_id | int | Gruppen-ID. |
Anfrage
<?php
$response = $xsollaClient->GetVirtualItemsGroup(array(
'project_id' => PROJECT_ID,
'group_id' => GROUP_ID
));
GET /merchant/v2/merchants/{project_id}/virtual_items/groups/{group_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 25,
'name' =>
array (
'en' => 'Tanks'
),
'description' =>
array (
'en' => 'Tanks Group'
),
'enabled' => true,
'parent_id' => null,
'code' => null
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 25,
"name": {
"en": "Tanks"
},
"description": {
"en": "Tanks Group"
},
"enabled": true,
"parent_id": null,
"code": null
}
{
"id": 25,
"name": {
"en": "Tanks"
},
"description": {
"en": "Tanks Group"
},
"enabled": true,
"parent_id": null,
"code": null
}
Gruppe aktualisieren
Aktualisiert eine Gruppe für virtuelle Gegenstände.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}
Parameter | Typ | Beschreibung |
---|---|---|
group_id | int | Gruppen-ID. |
name | array of strings | Lokalisierte Gruppennamen (Array). |
description | array of strings | Lokalisierte Beschreibungen der Gruppe (Array). |
enabled | boolean | Schaltet die Gruppe aktiv. |
parent_id | int | ID der übergeordneten Gruppe. |
code | int | Individueller Code der Gruppe. |
Anfrage
<?php
$response = $xsollaClient->UpdateVirtualItemsGroup(array(
'project_id' => PROJECT_ID,
'group_id' => GROUP_ID,
'request' => array (
'name' =>
array (
'en' => 'Tanks',
),
'description' =>
array (
'en' => 'Tanks Group',
),
'enabled' => true,
'parent_id' => null,
'code' => null
)
));
PUT /merchant/v2/merchants/{project_id}/virtual_items/groups/{group_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"name": {
"en": "Tanks"
},
"description": {
"en": "Tanks Group"
},
"enabled": true,
"parent_id": null,
"code": null
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"name": {
"en": "Tanks"
},
"description": {
"en": "Tanks Group"
},
"enabled": true,
"parent_id": null,
"code": null
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Gruppe entfernen
Entfernt eine Gruppe für virtuelle Gegenstände.
HTTP-ANFRAGE
DELETE https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}
Parameter | Typ | Beschreibung |
---|---|---|
group_id | int | Gruppen-ID. |
Anfrage
<?php
$response = $xsollaClient->DeleteVirtualItemsGroup(array(
'project_id' => PROJECT_ID,
'group_id' => GROUP_ID
));
DELETE /merchant/v2/merchants/{project_id}/virtual_items/groups/{group_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups/{group_id}' \
-X DELETE \
-u merchant_id:merchant_api_key
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Gruppen auflisten
Listet alle Gruppen für virtuelle Gegenstände auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
Anfrage
<?php
$response = $xsollaClient->ListVirtualItemsGroups(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/virtual_items/groups HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_items/groups' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 25,
'localized_name' => 'Tanks',
'enabled' => true,
'parent_id' => null,
'has_groups' => false,
'has_virtual_items' => true,
'virtual_items_count' => 6,
'code' => null
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 25,
"localized_name": "Tanks",
"enabled": true,
"parent_id": null,
"has_groups": false,
"has_virtual_items": true,
"virtual_items_count": 6,
"code": null
}
]
[
{
"id": 25,
"localized_name": "Tanks",
"enabled": true,
"parent_id": null,
"has_groups": false,
"has_virtual_items": true,
"virtual_items_count": 6,
"code": null
}
]
Beutekiste anlegen
Legt eine Beutekiste an.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
sku | string | Eindeutige ID des Gegenstands. Die SKU darf nur lateinische Kleinbuchstaben, alphanumerische Zeichen, Binde- und Unterstriche enthalten. |
item_code | string | Zusätzlicher Code des Gegenstands. Optional. |
name | array of strings | Lokalisierte Namen des Gegenstands. |
description | array of strings | Lokalisierte Beschreibungen des Gegenstands. |
long_description | array of strings | Lokalisierte ausführliche Beschreibungen des Gegenstands. |
prices | array | Preise des Gegenstands. |
default_currency | string | Standardwährung bei der Bestellung. Code, bestehend aus drei Ziffern gemäß ISO 4217. |
enabled | boolean | Schaltet den Gegenstand aktiv. |
permanent | boolean | Falls der Wert true festgelegt ist, kann der Gegenstand nur einmal erworben werden. |
image_url | string | Bild-URL zum Gegenstand. |
item_type | string | Gegenstandsart: 'lootbox' |
expiration | int | Lebensdauer in Sekunden. Nur für Gegenstände vom Typ Expiration |
groups | array of integers | Gruppen, denen der Gegenstand zugeordnet wird. |
deleted | boolean | Legt fest, ob der Gegenstand entfernt wurde. |
user_attribute_conditions | array of objects | Bedingungen für Benutzerattribute. |
user_attribute_conditions.right_operand | array | Werte, mit denen das Benutzerattribut verglichen wird. |
user_attribute_conditions.user_attribute_key | string | Schlüssel der Benutzerattribut-Bedingung. |
user_attribute_conditions.operation | string | Operationsart. Als Wert lässt sich entweder 'greater', 'greaterOrEqual', 'equal', 'notEqual', 'less', 'lessOrEqual', 'between', 'in' oder 'notIn' festlegen. |
user_attribute_conditions.action | string | Art der Aktion. Als Wert lässt sich entweder 'hide', 'block' oder 'warning' festlegen. |
advertisement_type | string | Bannertyp, der im Zahlungsportal gemeinsam mit dem Gegenstand angezeigt wird. Als Wert lässt sich entweder 'recommended', 'best_deal', 'special_offer' oder null festlegen. |
virtual_currency_price | int | Preis in der Ingame-Währung. Falls als Wert 'null' festgelegt ist, kann der Gegenstand ausschließlich mit Echtgeld erworben werden. |
purchase_limit | int | Legt fest, wie oft ein Gegenstand erworben werden kann. Falls als Wert 'null' festgelegt ist, besteht keine Beschränkung hinsichtlich der Anzahl der Käufe. |
keywords | array | Schlagwörter, mit denen sich im Zahlungsportal der Gegenstand finden lässt. |
key_virtual_item_id | int | ID des virtuellen Gegenstands, welcher die Beutekiste öffnet. |
opening_price_vc | int | Preis, in virtueller Währung, um die Beutekiste zu öffnen. |
slots | array | Slots in der Beutekiste. Ein Array, welches die Gegenstände definiert, die in jedem Slot erzeugt werden können. |
slots.id | int | Slot-ID. |
slots.value | object | Slot-Inhalte. Die Summe der drop_rate muss für jeden Slot 100 % ergeben. |
slots.value.virtual_item | array | Virtuelle Gegenstände, die im Slot erzeugt werden können. |
slots.value.virtual_item.id | int | ID des Gegenstands. |
slots.value.virtual_item.amount | float | Gegenstandsmenge. |
slots.value.virtual_item.drop_rate | decimal | Wahrscheinlichkeit, mit welcher der Gegenstand im Slot erzeugt wird (auf 2 Nachkommastellen genau). |
slots.value.virtual_currency | object | Virtuelle Währungen, die im Slot erzeugt werden können. |
slots.value.virtual_currency.amount | float | Währungsmenge. |
slots.value.virtual_currency.drop_rate | decimal | Wahrscheinlichkeit, mit welcher der Gegenstand im Slot erzeugt wird (auf 2 Nachkommastellen genau). |
slots.value.attribute | array | Attribute für Gegenstände, die im Slot erzeugt werden können. |
slots.value.attribute.type | int | Attributtyp, der verwendet wird, um auszuwählen, welcher Gegenstand in einer Beutekiste erzeugt wird. |
slots.value.attribute.value | string | Attributwert. Z. B.: "rare". |
slots.value.attribute.drop_rate | string | Wahrscheinlichkeit, mit der ein Gegenstand mit solch einem Attribut im Slot erzeugt wird (auf 2 Nachkommastellen genau). |
slots.compensation_for_duplicate_percent | int | Entschädigung, in virtueller Währung, für einen doppelt vorhandenen Gegenstand (Prozentsatz des Gegenstandspreises). |
slots.compensation_for_duplicate_value | float | Entschädigung, in virtueller Währung, für einen doppelt vorhandenen Gegenstand (absoluter Wert). |
limits | object | Beschränkungen hinsichtlich der Menge an Gegenständen in der Beutekiste. |
limits.virtual_item | object | Beschränkungen für virtuelle Gegenstände. |
limits.virtual_item.id | int | ID des Gegenstands. |
limits.virtual_item.max_items | int | Legt einen Maximalwert dafür fest, wie oft der Gegenstand in der Beutekiste erzeugt werden kann. |
limits.attribute | object | Beschränkungen für Attribute. |
limits.attribute.type | int | Attributtyp, der für die Beschränkung verwendet wird. |
limits.attribute.value | string | Attributwert, der für die Beschränkung verwendet wird. |
limits.attribute.max_items | int | Legt einen Maximalwert dafür fest, wie oft ein Gegenstand mit einem solchen Attribut in der Beutekiste erzeugt werden kann. |
Anfrage
<?php
$response = $xsollaClient->CreateVirtualItem(array(
'project_id' => PROJECT_ID,
'request' => array (
'sku' => 'T-43-3-unique-id',
'item_code' => 'chinese-medium-tank',
'name' =>
array (
'en' => 'T-34-3',
),
'description' =>
array (
'en' => 'Chinese Tier VIII medium tank.',
),
'long_description' =>
array (
'en' => 'This Chinese Tier VIII medium tank is a real beast in its class.',
),
'prices' =>
array (
'USD' => 40.09,
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'image_url' => 'http://livedemo.xsolla.com/airplanes/tank5.jpg',
'item_type' => 'lootbox',
'expiration' => 1296000,
'groups' =>
array (
24,
25,
),
'user_attribute_conditions' =>
array (
array (
'right_operand' =>
array (
'magic',
),
'id' => 2015,
'user_attribute_key' => 'type',
'operation' => 'equal',
'action' => 'hide',
'name' => null,
),
),
'virtual_currency_price' => null,
'purchase_limit' => null,
'keywords' =>
array (
'de' =>
array (
'Inhalt',
'Aufgaben',
'Region',
'Landschaft',
),
'en' =>
array (
'content',
'quests',
'region',
'landscape',
),
),
'advertisement_type' => 'recommended',
'deleted' => false,
)
));
POST /merchant/v2/merchants/{project_id}/virtual_items/items HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "lootbox",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false,
"slots":[
{
"id":123,
"value":{
"virtual_items":[
{
"id":123,
"amount":10,
"drop_rate":20
},
{
"id":321,
"amount":15,
"drop_rate":50
}
],
"attribute":[
{
"type":1,
"value":"rare",
"drop_rate":20
}
],
"virtual_currency":[
{
"amount":100,
"drop_rate":10
}
]
},
"compensation_for_duplicate_percent":10,
"compensation_for_duplicate_value":50
}
],
"limits":{
"virtual_item":{
"id":123,
"max_items":5
},
"attribute":{
"type":1,
"value":"rare",
"max_items":5
}
}
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "lootbox",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false,
"slots":[
{
"id":123,
"value":{
"virtual_items":[
{
"id":123,
"amount":10,
"drop_rate":20
},
{
"id":321,
"amount":15,
"drop_rate":50
}
],
"attribute":[
{
"type":1,
"value":"rare",
"drop_rate":20
}
],
"virtual_currency":[
{
"amount":100,
"drop_rate":10
}
]
},
"compensation_for_duplicate_percent":10,
"compensation_for_duplicate_value":50
}
],
"limits":{
"virtual_item":{
"id":123,
"max_items":5
},
"attribute":{
"type":1,
"value":"rare",
"max_items":5
}
}
}'
Antwort
<?php
// example response
$response = array (
'item_id' => 77
);
HTTP/1.1 201 Created
Content-Type: application/json
{
"item_id": 77
}
{
"item_id": 77
}
Beutekiste aktualisieren
Aktualisiert eine Beutekiste.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items/{item_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
sku | string | Eindeutige ID des Gegenstands. Die SKU darf nur lateinische Kleinbuchstaben, alphanumerische Zeichen, Binde- und Unterstriche enthalten. |
item_code | string | Zusätzlicher Code des Gegenstands. Optional. |
name | array of strings | Lokalisierte Namen des Gegenstands. |
description | array of strings | Lokalisierte Beschreibungen des Gegenstands. |
long_description | array of strings | Lokalisierte ausführliche Beschreibungen des Gegenstands. |
prices | array | Preise des Gegenstands. |
default_currency | string | Standardwährung bei der Bestellung. Code, bestehend aus drei Ziffern gemäß ISO 4217. |
enabled | boolean | Schaltet den Gegenstand aktiv. |
permanent | boolean | Falls der Wert true festgelegt ist, kann der Gegenstand nur einmal erworben werden. |
image_url | string | Bild-URL zum Gegenstand. |
item_type | string | Gegenstandsart: 'lootbox' |
expiration | int | Lebensdauer in Sekunden. Nur für Gegenstände vom Typ Expiration |
groups | array of integers | Gruppen, denen der Gegenstand zugeordnet wird. |
deleted | boolean | Legt fest, ob der Gegenstand entfernt wurde. |
user_attribute_conditions | array of objects | Bedingungen für Benutzerattribute. |
user_attribute_conditions.right_operand | array | Werte, mit denen das Benutzerattribut verglichen wird. |
user_attribute_conditions.user_attribute_key | string | Schlüssel der Benutzerattribut-Bedingung. |
user_attribute_conditions.operation | string | Operationsart. Als Wert lässt sich entweder 'greater', 'greaterOrEqual', 'equal', 'notEqual', 'less', 'lessOrEqual', 'between', 'in' oder 'notIn' festlegen. |
user_attribute_conditions.action | string | Art der Aktion. Als Wert lässt sich entweder 'hide', 'block' oder 'warning' festlegen. |
advertisement_type | string | Bannertyp, der im Zahlungsportal gemeinsam mit dem Gegenstand angezeigt wird. Als Wert lässt sich entweder 'recommended', 'best_deal', 'special_offer' oder null festlegen. |
virtual_currency_price | int | Preis in der Ingame-Währung. Falls als Wert 'null' festgelegt ist, kann der Gegenstand ausschließlich mit Echtgeld erworben werden. |
purchase_limit | int | Legt fest, wie oft ein Gegenstand erworben werden kann. Falls als Wert 'null' festgelegt ist, besteht keine Beschränkung hinsichtlich der Anzahl der Käufe. |
keywords | array | Schlagwörter, mit denen sich im Zahlungsportal der Gegenstand finden lässt. |
key_virtual_item_id | int | ID des virtuellen Gegenstands, welcher die Beutekiste öffnet. |
opening_price_vc | int | Preis, in virtueller Währung, um die Beutekiste zu öffnen. |
slots | array | Slots in der Beutekiste. Ein Array, welches die Gegenstände definiert, die in jedem Slot erzeugt werden können. |
slots.id | int | Slot-ID. |
slots.value | object | Slot-Inhalte. Die Summe der drop_rate muss für jeden Slot 100 % ergeben. |
slots.value.virtual_item | array | Virtuelle Gegenstände, die im Slot erzeugt werden können. |
slots.value.virtual_item.id | int | ID des Gegenstands. |
slots.value.virtual_item.amount | float | Gegenstandsmenge. |
slots.value.virtual_item.drop_rate | decimal | Wahrscheinlichkeit, mit welcher der Gegenstand im Slot erzeugt wird (auf 2 Nachkommastellen genau). |
slots.value.virtual_currency | object | Virtuelle Währungen, die im Slot erzeugt werden können. |
slots.value.virtual_currency.amount | float | Währungsmenge. |
slots.value.virtual_currency.drop_rate | decimal | Wahrscheinlichkeit, mit welcher der Gegenstand im Slot erzeugt wird (auf 2 Nachkommastellen genau). |
slots.value.attribute | array | Attribute für Gegenstände, die im Slot erzeugt werden können. |
slots.value.attribute.type | int | Attributtyp, der verwendet wird, um auszuwählen, welcher Gegenstand in einer Beutekiste erzeugt wird. |
slots.value.attribute.value | string | Attributwert. Z. B.: "rare". |
slots.value.attribute.drop_rate | string | Wahrscheinlichkeit, mit der ein Gegenstand mit solch einem Attribut im Slot erzeugt wird (auf 2 Nachkommastellen genau). |
slots.compensation_for_duplicate_percent | int | Entschädigung, in virtueller Währung, für einen doppelt vorhandenen Gegenstand (Prozentsatz des Gegenstandspreises). |
slots.compensation_for_duplicate_value | float | Entschädigung, in virtueller Währung, für einen doppelt vorhandenen Gegenstand (absoluter Wert). |
limits | object | Beschränkungen hinsichtlich der Menge an Gegenständen in der Beutekiste. |
limits.virtual_item | object | Beschränkungen für virtuelle Gegenstände. |
limits.virtual_item.id | int | ID des Gegenstands. |
limits.virtual_item.max_items | int | Legt einen Maximalwert dafür fest, wie oft der Gegenstand in der Beutekiste erzeugt werden kann. |
limits.attribute | object | Beschränkungen für Attribute. |
limits.attribute.type | int | Attributtyp, der für die Beschränkung verwendet wird. |
limits.attribute.value | string | Attributwert, der für die Beschränkung verwendet wird. |
limits.attribute.max_items | int | Legt einen Maximalwert dafür fest, wie oft ein Gegenstand mit einem solchen Attribut in der Beutekiste erzeugt werden kann. |
Anfrage
<?php
$response = $xsollaClient->CreateVirtualItem(array(
'project_id' => PROJECT_ID,
'request' => array (
'sku' => 'T-43-3-unique-id',
'item_code' => 'chinese-medium-tank',
'name' =>
array (
'en' => 'T-34-3',
),
'description' =>
array (
'en' => 'Chinese Tier VIII medium tank.',
),
'long_description' =>
array (
'en' => 'This Chinese Tier VIII medium tank is a real beast in its class.',
),
'prices' =>
array (
'USD' => 40.09,
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'image_url' => 'http://livedemo.xsolla.com/airplanes/tank5.jpg',
'item_type' => 'lootbox',
'expiration' => 1296000,
'groups' =>
array (
24,
25,
),
'user_attribute_conditions' =>
array (
array (
'right_operand' =>
array (
'magic',
),
'id' => 2015,
'user_attribute_key' => 'type',
'operation' => 'equal',
'action' => 'hide',
'name' => null,
),
),
'virtual_currency_price' => null,
'purchase_limit' => null,
'keywords' =>
array (
'de' =>
array (
'Inhalt',
'Aufgaben',
'Region',
'Landschaft',
),
'en' =>
array (
'content',
'quests',
'region',
'landscape',
),
),
'advertisement_type' => 'recommended',
'deleted' => false,
)
));
POST /merchant/v2/merchants/{project_id}/virtual_items/items HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "lootbox",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "lootbox",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Beutekiste anfordern
Ruft Informationen zu einer Beutekiste ab.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items/{item_id}
Parameter | Typ | Beschreibung |
---|---|---|
item_id | int | ID des Gegenstands. |
Anfrage
<?php
$response = $xsollaClient->GetVirtualItem(array(
'project_id' => PROJECT_ID,
'item_id' => ITEM_ID
));
GET /merchant/v2/merchants/{project_id}/virtual_items/items/{item_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items/{item_id}' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 77,
'sku' => 'T-43-3-unique-id',
'item_code' => 'chinese-medium-tank',
'name' =>
array (
'en' => 'T-34-3'
),
'description' =>
array (
'en' => 'Chinese Tier VIII medium tank.'
),
'long_description' =>
array (
'en' => 'This Chinese Tier VIII medium tank is a real beast in its class.'
),
'prices' =>
array (
'USD' => 40.09
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'image_url' => 'http://livedemo.xsolla.com/airplanes/tank5.jpg',
'item_type' => 'lootbox',
'expiration' => 1296000,
'groups' =>
array (
24,
25
),
'user_attribute_conditions' =>
array (
array (
'right_operand' =>
array (
'magic',
),
'id' => 2015,
'user_attribute_key' => 'type',
'operation' => 'equal',
'action' => 'hide',
'name' => null,
),
),
'virtual_currency_price' => null,
'purchase_limit' => null,
'keywords' =>
array (
'de' =>
array (
'Inhalt',
'Aufgaben',
'Region',
'Landschaft',
),
'en' =>
array (
'content',
'quests',
'region',
'landscape',
),
),
'advertisement_type' => 'recommended',
'deleted' => false,
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 77,
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "lootbox",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}
{
"id": 77,
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"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."
},
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"item_type": "lootbox",
"expiration": 1296000,
"groups": [
24,
25
],
"user_attribute_conditions": [
{
"right_operand": [
"magic"
],
"id": 2015,
"user_attribute_key": "type",
"operation": "equal",
"action": "hide",
"name":null
}
],
"virtual_currency_price": null,
"purchase_limit": null,
"keywords": {
"de":[
"Inhalt","Aufgaben","Region","Landschaft"
],
"en":[
"content","quests","region","landscape"
]
},
"advertisement_type": "recommended",
"deleted": false
}
Beutekisten auflisten
Fordert eine Liste der Beutekisten an.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
offset | int | Seitenzahl. |
limit | int | Einträge pro Seite. |
has_price | string | Währungsart, die für den Erwerb des Gegenstands verwendet wird. Als Wert lässt sich entweder 'virtual_currency' oder 'real_currency' festlegen, je nachdem, ob der Gegenstand mit virtueller Währung oder Echtgeld erworben werden kann. |
Anfrage
<?php
$response = $xsollaClient->ListVirtualItems(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/virtual_items/items HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 46,
'sku' => 'T-43-3-unique-id',
'localized_name' => 'T-34-3',
'prices' =>
array (
'USD' => 40.09
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'groups' =>
array (
25
),
'advertisement_type' => null,
'virtual_currency_price' => null
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 46,
"sku": "T-43-3-unique-id",
"localized_name": "T-34-3",
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"groups": [
25
],
"advertisement_type": null,
"virtual_currency_price": null
}
]
[
{
"id": 46,
"sku": "T-43-3-unique-id",
"localized_name": "T-34-3",
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"groups": [
25
],
"advertisement_type": null,
"virtual_currency_price": null
}
]
Beutekiste öffnen
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items/{item_id}/open
Parameter | Typ | Beschreibung |
---|---|---|
slots | array | Slots in der Beutekiste. Ein Array, welches die Gegenstände definiert, die in jedem Slot erzeugt werden können. |
slots.id | int | Slot-ID. |
slots.value | object | Slot-Inhalte. Die Summe der drop_rate muss für jeden Slot 100 % ergeben. |
slots.value.virtual_item | array | Virtuelle Gegenstände, die im Slot erzeugt werden können. |
slots.value.virtual_item.id | int | ID des Gegenstands. |
slots.value.virtual_item.amount | float | Gegenstandsmenge. |
slots.value.virtual_item.drop_rate | decimal | Wahrscheinlichkeit, mit welcher der Gegenstand im Slot erzeugt wird (auf 2 Nachkommastellen genau). |
slots.value.virtual_currency | object | Virtuelle Währungen, die im Slot erzeugt werden können. |
slots.value.virtual_currency.amount | float | Währungsmenge. |
slots.value.virtual_currency.drop_rate | decimal | Wahrscheinlichkeit, mit welcher der Gegenstand im Slot erzeugt wird (auf 2 Nachkommastellen genau). |
slots.value.attribute | array | Attribute für Gegenstände, die im Slot erzeugt werden können. |
slots.value.attribute.type | int | Attributtyp, der verwendet wird, um auszuwählen, welcher Gegenstand in einer Beutekiste erzeugt wird. |
slots.value.attribute.value | string | Attributwert. Z. B.: "rare". |
slots.value.attribute.drop_rate | string | Wahrscheinlichkeit, mit der ein Gegenstand mit solch einem Attribut im Slot erzeugt wird (auf 2 Nachkommastellen genau). |
slots.compensation_for_duplicate_percent | int | Entschädigung, in virtueller Währung, für einen doppelt vorhandenen Gegenstand (Prozentsatz des Gegenstandspreises). |
slots.compensation_for_duplicate_value | float | Entschädigung, in virtueller Währung, für einen doppelt vorhandenen Gegenstand (absoluter Wert). |
Anfrage
<?php
$response = $xsollaClient->GetVirtualItem(array(
'project_id' => PROJECT_ID,
'item_id' => ITEM_ID
));
POST /merchant/v2/merchants/{project_id}/virtual_items/items/{item_id}/open HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items/{item_id}/open' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
Antwort
<?php
HTTP/1.1 200 OK
Beutekiste entfernen
Entfernt eine Beutekiste.
HTTP-ANFRAGE
DELETE https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items/{item_id}
Parameter | Typ | Beschreibung |
---|---|---|
item_id | int | ID des Gegenstands. |
Anfrage
<?php
$response = $xsollaClient->DeleteVirtualItem(array(
'project_id' => PROJECT_ID,
'item_id' => ITEM_ID
));
DELETE /merchant/v2/merchants/{project_id}/virtual_items/items/{item_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{project_id}/virtual_items/items/{item_id}' \
-X DELETE \
-u merchant_id:merchant_api_key
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Virtuelle Währungspakete auflisten
Listet virtuelle Währungspakete auf, die für ein Projekt verfügbar sind.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
Anfrage
<?php
$response = $xsollaClient->GetProjectVirtualCurrencySettings(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/virtual_currency HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 1,
'vc_name' =>
array (
'en' => 'Golden Coins'
),
'base' =>
array (
'USD' => 0.04,
'EUR' => 0.03
),
'default_currency' => 'USD',
'min' => 0,
'max' => 0,
'is_currency_discrete' => true,
'allow_user_sum' => true,
'packets' =>
array (
'USD' =>
array (
array (
'id' => 1,
'sku' => 'vc_usd',
'amount' => 100,
'price' => 10,
'image_url' => '//images.storage.com/some_image',
'description' =>
array (
'en' => 'Standard Package'
),
'label' =>
array (
'en' => 'Standard Package'
),
'bonus' => 0,
'advertisement_type' => 'recommended'
'enabled' => true
)
),
'EUR' =>
array (
array (
'id' => 2,
'sku' => 'vc_eur',
'amount' => 80,
'price' => 5,
'image_url' => null,
'description' =>
array (
'en' => 'Standard Package'
),
'label' =>
array (
'en' => 'Standard Package'
),
'bonus' => 0,
'advertisement_type' => 'recommended'
'enabled' => true
)
)
),
'type' => 'packets',
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"vc_name": {
"en": "Golden Coins"
},
"base": {
"USD": 0.04,
"EUR": 0.03
},
"default_currency": "USD",
"min": 0,
"max": 0,
"is_currency_discrete": true,
"allow_user_sum": true,
"packets": {
"USD": [
{
"id": 1,
"sku": "vc_usd",
"amount": 100,
"price": 10,
"image_url": "//images.storage.com/some_image",
"description": {
"en": "Standard Package"
},
"label": {
"en": "Standard Package"
},
"bonus": 0,
"advertisement_type": "recommended",
"enabled": true
}
],
"EUR": [
{
"id": 2,
"sku": "vc_eur",
"amount": 80,
"price": 5,
"image_url": null,
"description": {
"en": "Standard Package"
},
"label": {
"en": "Standard Package"
},
"bonus": 0,
"advertisement_type": "recommended",
"enabled": true
}
]
},
"type": "packets"
}
{
"id": 1,
"vc_name": {
"en": "Golden Coins"
},
"base": {
"USD": 0.04,
"EUR": 0.03
},
"default_currency": "USD",
"min": 0,
"max": 0,
"is_currency_discrete": true,
"allow_user_sum": true,
"packets": {
"USD": [
{
"id": 1,
"sku": "vc_usd",
"amount": 100,
"price": 10,
"image_url": "//images.storage.com/some_image",
"description": {
"en": "Standard Package"
},
"label": {
"en": "Standard Package"
},
"bonus": 0,
"advertisement_type": "recommended",
"enabled": true
}
],
"EUR": [
{
"id": 2,
"sku": "vc_eur",
"amount": 80,
"price": 5,
"image_url": null,
"description": {
"en": "Standard Package"
},
"label": {
"en": "Standard Package"
},
"bonus": 0,
"advertisement_type": "recommended",
"enabled": true
}
]
},
"type": "packets"
}
Virtuelles Währungspaket aktualisieren
Aktualisiert das virtuelle Währungspaket eines Projekts.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
vc_name | array of strings | Produktname. Besteht aus Paaren vom Typ "language":"product name" (Sprache:Produktname). |
base | array | Wichtigste Produktwährung (Objekt). Schlüssel = Währungsname (3 Buchstaben gemäß ISO 4217); Wert = Betrag in dieser Währung. |
default_currency | string | Standardwährung. |
min | float | Mindestkaufbetrag. |
max | float | Maximaler Kaufbetrag. |
is_currency_discrete | boolean | Legt fest, ob Nachkommastellen für die virtuelle Währung aktiviert werden. |
allow_user_sum | boolean | Legt fest, ob der Benutzer einen willkürlichen Betrag für das Angebotspaket bezahlen kann. |
int | float | Die im Angebotspaket enthaltene Menge der virtuellen Währung. |
sku | string | Eindeutige ID des virtuellen Währungspakets. |
price | float | Preis des Angebotspakets. |
image_url | string | Bilddatei-URL. |
description | array of strings | Array mit lokalisierten Bezeichnungen des Angebotspakets. Besteht aus Paaren vom Typ "language":"package description" (Sprache:Angebotsbeschreibung). |
label | array of strings | Lokalisierte Paketkennzeichnungen (Array). Besteht aus Paaren vom Typ "language":"package description" (Sprache:Angebotsbeschreibung). |
bonus | float | Rabatt für das Angebotspaket (%). |
advertisement_type | string | Art der Kennzeichnung, die für das Angebotspaket verwendet wird. Als Wert lässt sich entweder 'recommended', 'best_deal', 'special_offer' oder null festlegen. |
enabled | boolean | Schaltet das virtuelle Währungspaket aktiv. |
Anfrage
<?php
$response = $xsollaClient->UpdateProjectVirtualCurrencySettings(array(
'project_id' => PROJECT_ID,
'request' => array (
'vc_name' =>
array (
'en' => 'Golden Coins'
),
'base' =>
array (
'USD' => 0.04,
'EUR' => 0.02,
),
'default_currency' => 'USD',
'min' => 0,
'max' => 0,
'is_currency_discrete' => true,
'allow_user_sum' => true,
'packets' =>
array (
'USD' =>
array (
array (
'id' => 1,
'sku' => 'vc_usd',
'amount' => 100,
'price' => 10,
'image_url' => '//images.storage.com/some_image',
'description' =>
array (
'en' => 'Standard Package'
),
'label' =>
array (
'en' => 'Standard Package'
),
'bonus' => 0,
'advertisement_type' => 'recommended'
'enabled' => true
)
),
'EUR' =>
array (
array (
'id' => 2,
'sku' => 'vc_eur',
'amount' => 80,
'price' => 5,
'image_url' => null,
'description' =>
array (
'en' => 'Standard Package'
),
'label' =>
array (
'en' => 'Standard Package'
),
'bonus' => 0,
'advertisement_type' => 'recommended'
'enabled' => true
)
)
),
'type' => 'packets',
)
));
PUT /merchant/v2/merchants/{project_id}/virtual_currency HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"vc_name": {
"en": "Golden Coins"
},
"base": {
"USD": 0.04,
"EUR": 0.03
},
"default_currency": "USD",
"min": 0,
"max": 0,
"is_currency_discrete": true,
"allow_user_sum": true,
"packets": {
"USD": [
{
"id": 1,
"sku": "vc_usd",
"amount": 100,
"price": 10,
"image_url": "//images.storage.com/some_image",
"description": {
"en": "Standard Package"
},
"label": {
"en": "Standard Package"
},
"bonus": 0,
"advertisement_type": "recommended",
"enabled": true
}
],
"EUR": [
{
"id": 2,
"sku": "vc_eur",
"amount": 80,
"price": 5,
"image_url": null,
"description": {
"en": "Standard Package"
},
"label": {
"en": "Standard Package"
},
"bonus": 0,
"advertisement_type": "recommended",
"enabled": true
}
]
}
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/virtual_currency' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"vc_name": {
"en": "Golden Coins"
},
"base": {
"USD": 0.04,
"EUR": 0.03
},
"default_currency": "USD",
"min": 0,
"max": 0,
"is_currency_discrete": true,
"allow_user_sum": true,
"packets": {
"USD": [
{
"id": 1,
"sku": "vc_usd",
"amount": 100,
"price": 10,
"image_url": "//images.storage.com/some_image",
"description": {
"en": "Standard Package"
},
"label": {
"en": "Standard Package"
},
"bonus": 0,
"advertisement_type": "recommended",
"enabled": true
}
],
"EUR": [
{
"id": 2,
"sku": "vc_eur",
"amount": 80,
"price": 5,
"image_url": null,
"description": {
"en": "Standard Package"
},
"label": {
"en": "Standard Package"
},
"bonus": 0,
"advertisement_type": "recommended",
"enabled": true
}
]
}
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Cyberwallet
In diesem Abschnitt werden Verfahren beschrieben, die auf Kontostände von Spielern angewendet werden, wie z. B. das Überprüfen des Kontostands, Wiederaufladen von Guthaben, Abbuchen von Geld und andere anwenderbezogene Funktionen.
Benutzer anlegen
Legt einen neuen Benutzer an.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/users
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. Erforderlich. |
user_id | string | Benutzer-ID. Erforderlich. |
user_name | string | Benutzername. |
user_custom | string | Benutzerdefinierte Parameter zur Benutzeridentifikation. |
string | E-Mail. |
Anfrage
<?php
$response = $xsollaClient->CreateWalletUser(array(
'project_id' => PROJECT_ID,
'request' => array(
'user_id' => USER_ID
)
));
POST /merchant/v2/merchants/{project_id}/users HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"user_id": 1
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"user_id": 1
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Benutzer anfordern
Fordert Benutzerdaten an.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Spieler-ID. |
Anfrage
<?php
$response = $xsollaClient->GetWalletUser(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID
));
GET /merchant/v2/merchants/{project_id}/users/{user_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'user_id' => 0,
'user_name' => 'John',
'user_custom' => 'Smith',
'email' => 'email@example.com',
'register_date' => '2014-10-08T21:44:32+04:00',
'balance' => 100,
'wallet_amount' => 1.5,
'wallet_currency' => 'USD',
'enabled' => true
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"user_id": 0,
"user_name": "John",
"user_custom": "Smith",
"email": "email@example.com",
"register_date": "2014-10-08T21:44:32-08:00",
"balance": 100,
"wallet_amount": 1.5,
"wallet_currency": "USD",
"enabled": true
}
{
"user_id": 0,
"user_name": "John",
"user_custom": "Smith",
"email": "email@example.com",
"register_date": "2014-10-08T21:44:32-08:00",
"balance": 100,
"wallet_amount": 1.5,
"wallet_currency": "USD",
"enabled": true
}
Benutzer aktualisieren
Aktualisiert Benutzerdaten.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. Erforderlich. |
user_id | string | Benutzer-ID im Spiel. Erforderlich. |
user_name | string | Benutzername. |
user_custom | string | Benutzerdefinierte Parameter zur Benutzeridentifikation. |
string | E-Mail. | |
enabled | boolean | Legt fest, ob der Benutzer aktiv geschaltet ist. Erforderlich. |
Anfrage
<?php
$response = $xsollaClient->UpdateWalletUser(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'request' => array(
'enabled' => true
)
));
PUT /merchant/v2/merchants/{project_id}/users/{user_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"enabled": true
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"enabled": true
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Benutzer auflisten
Listet alle Benutzer auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. Erforderlich. |
user_requisites | string | Benutzer-ID oder -name. |
string | E-Mail des Benutzers. | |
offset | int | Offset des ersten abzurufenden Datensatzes. Erforderlich. |
limit | int | Maximale Anzahl der abzurufenden Datensätze. Erforderlich. |
Anfrage
<?php
$response = $xsollaClient->ListWalletUsers(array(
'project_id' => PROJECT_ID,
'limit' => 1,
'offset' => 0
));
GET /merchant/v2/merchants/{project_id}/users?offset=1&limit=1 HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users?offset=1&limit=1' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'recordsTotal' => 1,
'data' =>
array (
array (
'user_id' => 0,
'user_name' => 'John',
'user_custom' => 'Smith',
'email' => 'email@example.com',
'register_date' => '2014-10-08T21:44:32-08:00',
'balance' => 100,
'wallet_amount' => 1.5,
'wallet_currency' => 'USD',
'enabled' => true
)
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"recordsTotal": 1,
"data": [
{
"user_id": 0,
"user_name": "John",
"user_custom": "Smith",
"email": "email@example.com",
"register_date": "2014-10-08T21:44:32-08:00",
"balance": 100,
"wallet_amount": 1.5,
"wallet_currency": "USD",
"enabled": true
}
]
}
{
"recordsTotal": 1,
"data": [
{
"user_id": 0,
"user_name": "John",
"user_custom": "Smith",
"email": "email@example.com",
"register_date": "2014-10-08T21:44:32-08:00",
"balance": 100,
"wallet_amount": 1.5,
"wallet_currency": "USD",
"enabled": true
}
]
}
Transaktionen auflisten
Listet alle Transaktionen eines Benutzers auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/transactions
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. Erforderlich. |
user_id | string | Benutzer-ID im Spiel. Erforderlich. |
datetime_from | datetime | Beginn des Zeitraums. Erforderlich. |
datetime_to | datetime | Ende des Zeitraums. Erforderlich. |
transaction_type | string | Transaktionsart; als Wert lässt sich entweder "payment", "coupon", "inGamePurchase", "internal" oder "cancellation" festlegen. |
Anfrage
<?php
$response = $xsollaClient->ListWalletUserOperations(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'datetime_from' => '2015-01-01T00:00:00Z',
'datetime_to' => '2016-01-01T00:00:00Z'
));
GET /merchant/v2/merchants/{project_id}/users/{user_id}/transactions?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/transactions?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'operation_id' => 647287,
'transaction_id' => 1234567,
'coupon_id' => null,
'coupon_code' => null,
'transaction_type' => 'invoice',
'comment' => 'Incoming payment',
'date' => '2014-10-28T12:00:00+04:00',
'amount' => 1000,
'sum' => 10,
'currency' => 'USD',
'status' => 'notified',
'user_balance' => 100,
'user_id' => '1234567'
),
array (
'operation_id' => 647288,
'transaction_id' => null,
'coupon_id' => null,
'coupon_code' => 'DemoCoupon',
'transaction_type' => 'coupon',
'comment' => 'Coupon Redeem',
'date' => '2014-10-28T14:00:00+04:00',
'amount' => 0,
'sum' => null,
'currency' => null,
'status' => 'failed',
'user_balance' => 100,
'user_id' => '1234567'
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"operation_id": 647287,
"transaction_id": 1234567,
"coupon_id": null,
"coupon_code": null,
"transaction_type": "invoice",
"comment": "Incoming payment",
"date": "2014-10-28T12:00:00+04:00",
"amount": 1000,
"sum": 10,
"currency": "USD",
"status": "notified",
"user_balance": 100,
"user_id": "1234567"
},
{
"operation_id": 647288,
"transaction_id": null,
"coupon_id": 12345,
"coupon_code": "DemoCoupon",
"transaction_type": "coupon",
"comment": "Coupon Redeem",
"date": "2014-10-28T14:00:00+04:00",
"amount": 0,
"sum": null,
"currency": null,
"status": "failed",
"user_balance": 100,
"user_id": "1234567"
}
]
[
{
"operation_id": 647287,
"transaction_id": 1234567,
"coupon_id": null,
"coupon_code": null,
"transaction_type": "invoice",
"comment": "Incoming payment",
"date": "2014-10-28T12:00:00+04:00",
"amount": 1000,
"sum": 10,
"currency": "USD",
"status": "notified",
"user_balance": 100,
"user_id": "1234567"
},
{
"operation_id": 647288,
"transaction_id": null,
"coupon_id": 12345,
"coupon_code": "DemoCoupon",
"transaction_type": "coupon",
"comment": "Coupon Redeem",
"date": "2014-10-28T14:00:00+04:00",
"amount": 0,
"sum": null,
"currency": null,
"status": "failed",
"user_balance": 100,
"user_id": "1234567"
}
]
Kontostand aktualisieren
Aktualisiert den Kontostand eines Benutzers.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/recharge
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Spieler-ID. |
int | float | Menge der virtuellen Währung. |
comment | string | Grund für die Änderung des Kontostands. |
Anfrage
<?php
$response = $xsollaClient->RechargeWalletUserBalance(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'request' => array(
'amount' => 10,
'comment' => 'Incoming payment'
)
));
POST /merchant/v2/merchants/{project_id}/users/{user_id}/recharge HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"amount": 10,
"comment": "Incoming payment"
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/recharge' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"amount": 10,
"comment": "Incoming payment"
}'
Antwort
<?php
// example response
$response = array (
'amount' => 110
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"amount": 110
}
{
"amount": 110
}
Virtuelle Gegenstände eines Benutzers auflisten
Listet virtuelle Gegenstände auf, die einem Benutzer gehören.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Spieler-ID. |
offset | int | Offset des ersten abzurufenden Datensatzes. |
limit | int | Maximale Anzahl der abzurufenden Datensätze. |
Anfrage
<?php
$response = $xsollaClient->ListWalletUserVirtualItems(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'limit' => 1,
'offset' => 0
));
GET /merchant/v2/merchants/{project_id}/users/{user_id}/virtual_items?offset=1&limit=1 HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items?offset=1&limit=1' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 1,
'sku' => 'item1',
'quantity' => 10
),
array (
'id' => 2,
'sku' => 'item2',
'quantity' => 5
),
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 1,
"sku": "item1",
"quantity": 10
},
{
"id": 2,
"sku": "item2",
"quantity": 5
}
]
[
{
"id": 1,
"sku": "item1",
"quantity": 10
},
{
"id": 2,
"sku": "item2",
"quantity": 5
}
]
Virtuelle Gegenstände aller Benutzer auflisten
Virtuelle Gegenstände aller Projektbenutzer abrufen.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/virtual_items/total
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Spieler-ID. |
offset | int | Offset des ersten abzurufenden Datensatzes. |
limit | int | Maximale Anzahl der abzurufenden Datensätze. |
Anfrage
<?php
$response = $xsollaClient->ListWalletUserVirtualItems(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'limit' => 1,
'offset' => 0
));
GET /merchant/v2/merchants/{project_id}/users/{user_id}/virtual_items?offset=1&limit=1 HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items?offset=1&limit=1' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'user_id' => 'V1',
'virtual_items' =>
array (
'id' => 1,
'sku' => 'item1',
'quantity' => '10'
),
array (
'id' => 2,
'sku' => 'item2',
'quantity' => '5'
),
),
array (
'user_id' => 'V2',
'virtual_items' =>
array (
'id' => 1,
'sku' => 'item1',
'quantity' => '9'
),
),
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"user_id": "V1",
"virtual_items": [
{
"id": 1,
"sku": "item1",
"quantity": 10
},
{
"id": 2,
"sku": "item2",
"quantity": 5
}
]
},
{
"user_id": "V2",
"virtual_items": [
{
"id": 1,
"sku": "item1",
"quantity": 9
}
]
}
]
[
{
"user_id": "V1",
"virtual_items": [
{
"id": 1,
"sku": "item1",
"quantity": 10
},
{
"id": 2,
"sku": "item2",
"quantity": 5
}
]
},
{
"user_id": "V2",
"virtual_items": [
{
"id": 1,
"sku": "item1",
"quantity": 9
}
]
}
]
Einem Benutzer virtuelle Gegenstände zuteilen
Fügt dem Konto eines Benutzers virtuelle Gegenstände hinzu.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/add
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Spieler-ID. |
virtual_items | array | Virtuelle Gegenstände (Array). |
virtual_items.virtual_item | object | Angaben zum virtuellem Gegenstand (Objekt). |
virtual_items.virtual_item.sku | string | Eindeutige ID des Gegenstands. |
virtual_items.amount | int | Gegenstandsmenge. |
Anfrage
<?php
$response = $xsollaClient->AddVirtualItemToWalletUser(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'request' => array(
'virtual_items' => array(
array(
'virtual_item' => array(
'sku' => 'ar23_shop_expiration_3'
),
'amount' => 2
)
)
)
));
POST /merchant/v2/merchants/{project_id}/users/{user_id}/virtual_items/add HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"virtual_items": [
{
"virtual_item":
{
"sku" : "ar23_shop_expiration_3"
},
"amount": 2
}
]
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/add' \
-X POST \
-u merchant_id:merchant_api_key
-d '{
"virtual_items": [
{
"virtual_item":
{
"sku" : "ar23_shop_expiration_3"
},
"amount": 2
}
]
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Gegenstände aus dem Besitz des Benutzers entfernen
Entfernt virtuelle Gegenstände aus dem Konto eines Benutzers.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/remove
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
user_id | string | Spieler-ID. |
virtual_items | array | Virtuelle Gegenstände (Array). |
virtual_items.virtual_item | object | Angaben zum virtuellem Gegenstand (Objekt). |
virtual_items.virtual_item.sku | string | Eindeutige ID des Gegenstands. |
virtual_items.amount | int | Gegenstandsmenge. |
Anfrage
<?php
$response = $xsollaClient->DeleteVirtualItemFromWalletUser(array(
'project_id' => PROJECT_ID,
'user_id' => USER_ID,
'request' => array(
'virtual_items' => array(
array(
'virtual_item' => array(
'sku' => 'ar23_shop_expiration_3'
),
'amount' => 2,
)
)
)
));
POST /merchant/v2/merchants/{project_id}/users/{user_id}/virtual_items/remove HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"virtual_items": [
{
"virtual_item":
{
"sku" : "ar23_shop_expiration_3"
},
"amount": 2
}
]
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/remove' \
-X POST \
-u merchant_id:merchant_api_key
-d '{
"virtual_items": [
{
"virtual_item":
{
"sku" : "ar23_shop_expiration_3"
},
"amount": 2
}
]
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Game-Delivery-Entität anlegen
Legt eine Game-Delivery-Entität an.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/game_delivery
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Projekt-ID. |
sku | string | Eindeutige ID der Game-Delivery-Entität. Die Artikelposition (SKU) darf nur lateinische Kleinbuchstaben, Ziffern, Bindestriche und Unterstriche enthalten. |
name | object | Array der lokalisierten Namen aus der Game-Delivery-Entität. |
description | object | Array der lokalisierten Beschreibungen aus der Game-Delivery-Entität. |
system_requirements | string | Systemanforderungen des Spiels. |
image_url | string | Bild-URL. Optional. |
long_description | string | Ausführliche Beschreibung der Game-Delivery-Entität. Optional. |
locales_list | string | Kommaseparierte Liste von Lokalisierungen. Optional. |
publisher | string | Game-Publisher. Optional. |
developer | string | Spieleentwickler. Optional. |
video_link | string | Link zu einem Video, welches das Spiel bewirbt. Optional. |
genre | string | Spielgenre. Optional. |
additional_info | string | Zusätzliche Informationen über das Spiel. Optional. |
forum_link | string | Link zu einem Diskussionsforum. Optional. |
support_link | string | Link zu einer Support-Seite. Optional. |
old_price | string | Alter Preis des Spiels. Optional. |
parent_id | int | ID eines übergeordneten Spiels. Optional. |
default_currency | string | Standardwährung beim Kauf. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
release_date | string | Voraussichtliches Veröffentlichungsdatum. Optional. |
drm | array | Array mit DRM-Daten. |
drm.id | int | ID eines verfügbaren DRM. |
drm.prices | array | Array der Spielpreise für das DRM. Optional. |
drm.platforms | array | Array mit Daten über die DRM-Plattformen. |
drm.platforms.id | int | Plattform-ID für das DRM. |
drm.enabled | boolean | Legt fest, ob DRM für dieses Spiel verwendet wird. |
obtain_code_from_db | boolean | Legt fest, ob PIN-Codes aus der Xsolla-Datenbank verwendet werden sollen. Optional. |
obtain_code_from_api | boolean | Legt fest, ob über API empfangene PIN-Codes verwendet werden sollen. Optional. |
Anfrage
<?php
$response = $xsollaClient->CreateGameDeliveryEntity(array(
'project_id' => PROJECT_ID,
'request' => array (
'sku' => 'GTA5',
'name' =>
array (
'en' => 'GTA V',
),
'description' =>
array (
'en' => 'Grand Theft Auto V is an open world, action-adventure video game developed by Rockstar North and published by Rockstar Games.',
),
'system_requirements' => 'OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)',
'image_url' => '//cdn2.xsolla.com/img/misc/merchant/default-item.png',
'long_description' => NULL,
'locales_list' => NULL,
'publisher' => NULL,
'developer' => NULL,
'video_link' => NULL,
'genre' => NULL,
'additional_info' => NULL,
'forum_link' => NULL,
'support_link' => NULL,
'old_price' => NULL,
'parent_id' => NULL,
'default_currency' => 'EUR',
'release_date' => '2016-01-01T00:00:00+00:00',
'drm' =>
array (
array (
'id' => 1,
'platforms' =>
array (
array (
'id' => 1,
),
array (
'id' => 2,
),
),
'prices' =>
array (
'USD' => 19.99,
'EUR' => 18.5,
),
'enabled' => true
),
),
'obtain_code_from_api' => false,
'obtain_code_from_db' => false,
)
));
POST /merchant/v2/merchants/{project_id}/game_delivery HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"sku":"GTA5",
"name":{
"en":"GTA V"
},
"description":{
"en":"Grand Theft Auto V is an open world, action-adventure video game developed by Rockstar North and published by Rockstar Games."
},
"system_requirements":"OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)",
"image_url":"//cdn2.xsolla.com/img/misc/merchant/default-item.png",
"long_description":null,
"locales_list":null,
"publisher":null,
"developer":null,
"video_link":null,
"genre":null,
"additional_info":null,
"forum_link":null,
"support_link":null,
"old_price":null,
"parent_id":null,
"default_currency":"EUR",
"release_date":"2016-01-01T00:00:00+00:00",
"drm":[
{
"id":1,
"platforms":[
{
"id":1
},
{
"id":2
}
],
"prices":{
"USD":19.99,
"EUR":18.5
},
"enabled":true
}
],
"obtain_code_from_api":false,
"obtain_code_from_db":false
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/game_delivery' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"sku":"GTA5",
"name":{
"en":"GTA V"
},
"description":{
"en":"Grand Theft Auto V is an open world, action-adventure video game developed by Rockstar North and published by Rockstar Games."
},
"system_requirements":"OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)",
"image_url":"//cdn2.xsolla.com/img/misc/merchant/default-item.png",
"long_description":null,
"locales_list":null,
"publisher":null,
"developer":null,
"video_link":null,
"genre":null,
"additional_info":null,
"forum_link":null,
"support_link":null,
"old_price":null,
"parent_id":null,
"default_currency":"EUR",
"release_date":"2016-01-01T00:00:00+00:00",
"drm":[
{
"id":1,
"platforms":[
{
"id":1
},
{
"id":2
}
],
"prices":{
"USD":19.99,
"EUR":18.5
},
"enabled":true
}
],
"obtain_code_from_api":false,
"obtain_code_from_db":false
}'
Antwort
<?php
// example response
$response = array (
'id' => 77
);
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": 77
}
{
"id": 77
}
Game-Delivery-Entität anfordern
Fordert eine Game-Delivery-Entität an.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/game_delivery/{game_delivery_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Projekt-ID. |
game_delivery_id | int | ID der Game-Delivery-Entität. |
Anfrage
<?php
$response = $xsollaClient->GetGameDeliveryEntity(array(
'project_id' => PROJECT_ID,
'game_delivery_id' => GAME_DELIVERY_ID
));
GET /merchant/v2/merchants/{project_id}/game_delivery/{game_delivery_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/game_delivery/{game_delivery_id}' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 9,
'sku' => 'GTA5',
'name' =>
array (
'en' => 'GTA V',
),
'description' =>
array (
'en' => 'Grand Theft Auto V is an open world, action-adventure video game developed by Rockstar North and published by Rockstar Games.',
),
'system_requirements' => 'OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)',
'image_url' => '//cdn2.xsolla.com/img/misc/merchant/default-item.png',
'long_description' => NULL,
'locales_list' => NULL,
'publisher' => NULL,
'developer' => NULL,
'video_link' => NULL,
'genre' => NULL,
'additional_info' => NULL,
'forum_link' => NULL,
'support_link' => NULL,
'old_price' => NULL,
'parent_id' => NULL,
'default_currency' => 'EUR',
'release_date' => '2016-01-01T00:00:00+00:00',
'drm' =>
array (
array (
'id' => 1,
'name' => 'Steam',
'image' => NULL,
'platforms' =>
array (
array (
'id' => 1,
'name' => 'Windows',
),
array (
'id' => 2,
'name' => 'Linux',
),
),
'prices' =>
array (
'USD' => 19.99,
'EUR' => 18.5,
),
'codes' =>
array (
'total' => 0,
'active' => 0,
'used' => 0,
),
),
),
'obtain_code_from_api' => false,
'obtain_code_from_db' => false,
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 9,
"sku": "GTA5",
"name": {
"en": "GTA V"
},
"description": {
"en": "Grand Theft Auto V is an open world, action-adventure video game developed by Rockstar North and published by Rockstar Games."
},
"system_requirements": "OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)",
"image_url": "//cdn2.xsolla.com/img/misc/merchant/default-item.png",
"long_description": null,
"locales_list": null,
"publisher": null,
"developer": null,
"video_link": null,
"genre": null,
"additional_info": null,
"forum_link": null,
"support_link": null,
"old_price": null,
"parent_id": null,
"default_currency": "EUR",
"release_date": "2016-01-01T00:00:00+00:00",
"drm": [
{
"id": 1,
"name": "Steam",
"image": null,
"platforms": [
{
"id": 1,
"name": "Windows"
},
{
"id": 2,
"name": "Linux"
}
],
"prices": {
"USD": 19.99,
"EUR": 18.5
},
"codes": {
"total": 0,
"active": 0,
"used": 0
}
},
{
"id": 2,
"name": "Playstation",
"image": null,
"platforms": [
{
"id": 3,
"name": "Playstation 3"
},
{
"id": 4,
"name": "Playstation 4"
}
],
"prices": {
"USD": 19.99,
"EUR": 18.5
},
"codes": {
"total": 0,
"active": 0,
"used": 0
}
}
],
"obtain_code_from_api": false,
"obtain_code_from_db": false
}
{
"id": 9,
"sku": "GTA5",
"name": {
"en": "GTA V"
},
"description": {
"en": "Grand Theft Auto V is an open world, action-adventure video game developed by Rockstar North and published by Rockstar Games."
},
"system_requirements": "OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)",
"image_url": "//cdn2.xsolla.com/img/misc/merchant/default-item.png",
"long_description": null,
"locales_list": null,
"publisher": null,
"developer": null,
"video_link": null,
"genre": null,
"additional_info": null,
"forum_link": null,
"support_link": null,
"old_price": null,
"parent_id": null,
"default_currency": "EUR",
"release_date": "2016-01-01T00:00:00+00:00",
"drm": [
{
"id": 1,
"name": "Steam",
"image": null,
"platforms": [
{
"id": 1,
"name": "Windows"
},
{
"id": 2,
"name": "Linux"
}
],
"prices": {
"USD": 19.99,
"EUR": 18.5
},
"codes": {
"total": 0,
"active": 0,
"used": 0
}
},
{
"id": 2,
"name": "Playstation",
"image": null,
"platforms": [
{
"id": 3,
"name": "Playstation 3"
},
{
"id": 4,
"name": "Playstation 4"
}
],
"prices": {
"USD": 19.99,
"EUR": 18.5
},
"codes": {
"total": 0,
"active": 0,
"used": 0
}
}
],
"obtain_code_from_api": false,
"obtain_code_from_db": false
}
Game-Delivery-Entität aktualisieren
Aktualisiert eine Game-Delivery-Entität.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/game_delivery/{game_delivery_id}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Projekt-ID. |
game_delivery_id | int | ID der Game-Delivery-Entität. |
sku | string | Eindeutige ID der Game-Delivery-Entität. Die Artikelposition (SKU) darf nur lateinische Kleinbuchstaben, Ziffern, Bindestriche und Unterstriche enthalten. |
name | object | Array der lokalisierten Namen aus der Game-Delivery-Entität. |
description | object | Array der lokalisierten Beschreibungen aus der Game-Delivery-Entität. |
system_requirements | string | Systemanforderungen des Spiels. |
image_url | string | Bild-URL. Optional. |
long_description | string | Ausführliche Beschreibung der Game-Delivery-Entität. Optional. |
locales_list | string | Kommaseparierte Liste von Lokalisierungen. Optional. |
publisher | string | Game-Publisher. Optional. |
developer | string | Spieleentwickler. Optional. |
video_link | string | Link zu einem Video, welches das Spiel bewirbt. Optional. |
genre | string | Spielgenre. Optional. |
additional_info | string | Zusätzliche Informationen über das Spiel. Optional. |
forum_link | string | Link zu einem Diskussionsforum. Optional. |
support_link | string | Link zu einer Support-Seite. Optional. |
old_price | string | Alter Preis des Spiels. Optional. |
parent_id | int | ID eines übergeordneten Spiels. Optional. |
default_currency | string | Standardwährung beim Kauf. Währungscode, bestehend aus drei Buchstaben gemäß ISO 4217. |
release_date | string | Voraussichtliches Veröffentlichungsdatum. Optional. |
drm | array | Array mit DRM-Daten. |
drm.id | int | ID eines verfügbaren DRM. |
drm.prices | array | Array der Spielpreise für das DRM. Optional. |
drm.platforms | array | Array mit Daten über die DRM-Plattformen. |
drm.platforms.id | int | Plattform-ID für das DRM. |
drm.enabled | boolean | Legt fest, ob DRM für dieses Spiel verwendet wird. |
obtain_code_from_db | boolean | Legt fest, ob PIN-Codes aus der Xsolla-Datenbank verwendet werden sollen. Optional. |
obtain_code_from_api | boolean | Legt fest, ob über API empfangene PIN-Codes verwendet werden sollen. Optional. |
Anfrage
<?php
$response = $xsollaClient->UpdateGameDeliveryEntity(array(
'project_id' => PROJECT_ID,
'game_delivery_id' => GAME_DELIVERY_ID
'request' => array (
'sku' => 'GTA5',
'name' =>
array (
'en' => 'GTA V',
),
'description' =>
array (
'en' => 'Grand Theft Auto V is an open world, action-adventure video game developed by Rockstar North and published by Rockstar Games.',
),
'system_requirements' => 'OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)',
'image_url' => '//cdn2.xsolla.com/img/misc/merchant/default-item.png',
'long_description' => NULL,
'locales_list' => NULL,
'publisher' => NULL,
'developer' => NULL,
'video_link' => NULL,
'genre' => NULL,
'additional_info' => NULL,
'forum_link' => NULL,
'support_link' => NULL,
'old_price' => NULL,
'parent_id' => NULL,
'default_currency' => 'EUR',
'release_date' => '2016-01-01T00:00:00+00:00',
'drm' =>
array (
array (
'id' => 1,
'platforms' =>
array (
array (
'id' => 1,
),
array (
'id' => 2,
),
),
'prices' =>
array (
'USD' => 19.99,
'EUR' => 18.5,
),
'enabled' => true
),
),
'obtain_code_from_api' => false,
'obtain_code_from_db' => false,
)
));
PUT /merchant/v2/merchants/{project_id}/game_delivery/{game_delivery_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"sku":"GTA5",
"name":{
"en":"GTA V"
},
"description":{
"en":"Grand Theft Auto V is an open world, action-adventure video game developed by Rockstar North and published by Rockstar Games."
},
"system_requirements":"OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)",
"image_url":"//cdn2.xsolla.com/img/misc/merchant/default-item.png",
"long_description":null,
"locales_list":null,
"publisher":null,
"developer":null,
"video_link":null,
"genre":null,
"additional_info":null,
"forum_link":null,
"support_link":null,
"old_price":null,
"parent_id":null,
"default_currency":"EUR",
"release_date":"2016-01-01T00:00:00+00:00",
"drm":[
{
"id":1,
"platforms":[
{
"id":1
},
{
"id":2
}
],
"prices":{
"USD":19.99,
"EUR":18.5
},
"enabled":true
}
],
"obtain_code_from_api":false,
"obtain_code_from_db":false
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/game_delivery/{game_delivery_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"sku":"GTA5",
"name":{
"en":"GTA V"
},
"description":{
"en":"Grand Theft Auto V is an open world, action-adventure video game developed by Rockstar North and published by Rockstar Games."
},
"system_requirements":"OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1, Windows Vista 64 Bit Service Pack 2* (*NVIDIA video card recommended if running Vista OS)",
"image_url":"//cdn2.xsolla.com/img/misc/merchant/default-item.png",
"long_description":null,
"locales_list":null,
"publisher":null,
"developer":null,
"video_link":null,
"genre":null,
"additional_info":null,
"forum_link":null,
"support_link":null,
"old_price":null,
"parent_id":null,
"default_currency":"EUR",
"release_date":"2016-01-01T00:00:00+00:00",
"drm":[
{
"id":1,
"platforms":[
{
"id":1
},
{
"id":2
}
],
"prices":{
"USD":19.99,
"EUR":18.5
},
"enabled":true
}
],
"obtain_code_from_api":false,
"obtain_code_from_db":false
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Game-Delivery-Entitäten auflisten
Listet alle Game-Delivery-Entitäten auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/game_delivery
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Projekt-ID. |
Anfrage
<?php
$response = $xsollaClient->ListGameDeliveryEntities(array(
'project_id' => PROJECT_ID
));
GET /merchant/v2/merchants/{project_id}/game_delivery HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/game_delivery' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
array (
'id' => 9,
'localized_name' => 'GTA V',
'parent_id' => NULL,
'default_currency' => 'EUR',
'drm' =>
array (
array (
'id' => 1,
'name' => 'Steam',
'image' => NULL,
'platforms' =>
array (
array (
'id' => 1,
'name' => 'Windows',
),
array (
'id' => 2,
'name' => 'Linux',
),
),
'prices' =>
array (
'USD' => 19.99,
'EUR' => 18.5,
),
'codes' =>
array (
'total' => 1000,
'active' => 999,
'used' => 1,
),
),
array (
'id' => 2,
'name' => 'Playstation',
'image' => NULL,
'platforms' =>
array (
array (
'id' => 3,
'name' => 'Playstation 3',
),
array (
'id' => 4,
'name' => 'Playstation 4',
),
),
'prices' =>
array (
'USD' => 19.99,
'EUR' => 18.5,
),
'codes' =>
array (
'total' => 1000,
'active' => 999,
'used' => 1,
),
),
),
),
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 9,
"localized_name": "GTA V",
"parent_id": null,
"default_currency": "EUR",
"drm": [
{
"id": 1,
"name": "Steam",
"image": null,
"platforms": [
{
"id": 1,
"name": "Windows"
},
{
"id": 2,
"name": "Linux"
}
],
"prices": {
"USD": 19.99,
"EUR": 18.5
},
"codes": {
"total": 1000,
"active": 999,
"used": 1
}
},
{
"id": 2,
"name": "Playstation",
"image": null,
"platforms": [
{
"id": 3,
"name": "Playstation 3"
},
{
"id": 4,
"name": "Playstation 4"
}
],
"prices": {
"USD": 19.99,
"EUR": 18.5
},
"codes": {
"total": 1000,
"active": 999,
"used": 1
}
}
]
}
]
[
{
"id": 9,
"localized_name": "GTA V",
"parent_id": null,
"default_currency": "EUR",
"drm": [
{
"id": 1,
"name": "Steam",
"image": null,
"platforms": [
{
"id": 1,
"name": "Windows"
},
{
"id": 2,
"name": "Linux"
}
],
"prices": {
"USD": 19.99,
"EUR": 18.5
},
"codes": {
"total": 1000,
"active": 999,
"used": 1
}
},
{
"id": 2,
"name": "Playstation",
"image": null,
"platforms": [
{
"id": 3,
"name": "Playstation 3"
},
{
"id": 4,
"name": "Playstation 4"
}
],
"prices": {
"USD": 19.99,
"EUR": 18.5
},
"codes": {
"total": 1000,
"active": 999,
"used": 1
}
}
]
}
]
DRMs auflisten
Listet verfügbare DRM-Plattformen auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/drm
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
Anfrage
<?php
$response = $xsollaClient->ListGameDeliveryDrmPlatforms();
GET /merchant/v2/merchants/{merchant_id}/drm HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/drm' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'drm' =>
array (
array (
'id' => 1,
'name' => 'Steam',
'image' => '//cdn2.xsolla.com/misc/game_delivery/drms/set2/1.1450132085.svg',
'platforms' =>
array (
array (
'id' => 1,
'name' => 'Windows',
),
array (
'id' => 2,
'name' => 'Linux',
),
array (
'id' => 6,
'name' => 'Mac',
),
),
),
array (
'id' => 2,
'name' => 'Playstation',
'image' => '//cdn2.xsolla.com/misc/game_delivery/drms/set2/2.1449183647.svg',
'platforms' =>
array (
array (
'id' => 3,
'name' => 'Playstation 3',
),
array (
'id' => 4,
'name' => 'Playstation 4',
),
),
),
array (
'id' => 3,
'name' => 'XBox',
'image' => '//cdn2.xsolla.com/misc/game_delivery/drms/set2/3.1449183647.svg',
'platforms' =>
array (
array (
'id' => 5,
'name' => 'XBox One',
),
array (
'id' => 7,
'name' => 'XBox 360',
),
),
),
array (
'id' => 4,
'name' => 'Uplay',
'image' => '//cdn2.xsolla.com/misc/game_delivery/drms/set2/4.1450201713.svg',
'platforms' =>
array (
array (
'id' => 1,
'name' => 'Windows',
),
array (
'id' => 2,
'name' => 'Linux',
),
array (
'id' => 6,
'name' => 'Mac',
),
),
),
array (
'id' => 5,
'name' => 'Origin',
'image' => '//cdn2.xsolla.com/misc/game_delivery/drms/set2/5.1450201747.svg',
'platforms' =>
array (
array (
'id' => 1,
'name' => 'Windows',
),
array (
'id' => 2,
'name' => 'Linux',
),
array (
'id' => 6,
'name' => 'Mac',
),
),
),
array (
'id' => 6,
'name' => 'DRM Free',
'image' => '//cdn2.xsolla.com/misc/game_delivery/drms/set2/6.1450201849.svg',
'platforms' =>
array (
array (
'id' => 1,
'name' => 'Windows',
),
array (
'id' => 2,
'name' => 'Linux',
),
array (
'id' => 6,
'name' => 'Mac',
),
)
)
),
'platforms' =>
array (
array (
'id' => 1,
'name' => 'Windows',
),
array (
'id' => 2,
'name' => 'Linux',
),
array (
'id' => 3,
'name' => 'Playstation 3',
),
array (
'id' => 4,
'name' => 'Playstation 4',
),
array (
'id' => 5,
'name' => 'XBox One',
),
array (
'id' => 6,
'name' => 'Mac',
),
array (
'id' => 7,
'name' => 'XBox 360',
)
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"drm":[
{
"id":1,
"name":"Steam",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/1.1450132085.svg",
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":6,
"name":"Mac"
}
]
},
{
"id":2,
"name":"Playstation",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/2.1449183647.svg",
"platforms":[
{
"id":3,
"name":"Playstation 3"
},
{
"id":4,
"name":"Playstation 4"
}
]
},
{
"id":3,
"name":"XBox",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/3.1449183647.svg",
"platforms":[
{
"id":5,
"name":"XBox One"
},
{
"id":7,
"name":"XBox 360"
}
]
},
{
"id":4,
"name":"Uplay",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/4.1450201713.svg",
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":6,
"name":"Mac"
}
]
},
{
"id":5,
"name":"Origin",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/5.1450201747.svg",
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":6,
"name":"Mac"
}
]
},
{
"id":6,
"name":"DRM Free",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/6.1450201849.svg",
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":6,
"name":"Mac"
}
]
}
],
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":3,
"name":"Playstation 3"
},
{
"id":4,
"name":"Playstation 4"
},
{
"id":5,
"name":"XBox One"
},
{
"id":6,
"name":"Mac"
},
{
"id":7,
"name":"XBox 360"
}
]
}
{
"drm":[
{
"id":1,
"name":"Steam",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/1.1450132085.svg",
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":6,
"name":"Mac"
}
]
},
{
"id":2,
"name":"Playstation",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/2.1449183647.svg",
"platforms":[
{
"id":3,
"name":"Playstation 3"
},
{
"id":4,
"name":"Playstation 4"
}
]
},
{
"id":3,
"name":"XBox",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/3.1449183647.svg",
"platforms":[
{
"id":5,
"name":"XBox One"
},
{
"id":7,
"name":"XBox 360"
}
]
},
{
"id":4,
"name":"Uplay",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/4.1450201713.svg",
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":6,
"name":"Mac"
}
]
},
{
"id":5,
"name":"Origin",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/5.1450201747.svg",
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":6,
"name":"Mac"
}
]
},
{
"id":6,
"name":"DRM Free",
"image":"//cdn2.xsolla.com/misc/game_delivery/drms/set2/6.1450201849.svg",
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":6,
"name":"Mac"
}
]
}
],
"platforms":[
{
"id":1,
"name":"Windows"
},
{
"id":2,
"name":"Linux"
},
{
"id":3,
"name":"Playstation 3"
},
{
"id":4,
"name":"Playstation 4"
},
{
"id":5,
"name":"XBox One"
},
{
"id":6,
"name":"Mac"
},
{
"id":7,
"name":"XBox 360"
}
]
}
Gutschein anfordern
Fordert nähere Informationen zum Gutschein mit Hilfe seines Codes an.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/projects/{project_id}/coupons/{code}
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
code | string | Gutscheincode. |
Anfrage
<?php
$response = $xsollaClient->GetCoupon(array(
'project_id' => PROJECT_ID,
'code' => COUPON_CODE
));
GET /merchant/v2/merchants/{project_id}/coupons/{code} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/coupons/{code}' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'coupon_id' => 1,
'project_id' => 1,
'coupon_code' => 'CouPoNCoDe',
'campaign_code' => 'CaMPaiGNCoDe',
'virtual_currency_amount' => 0,
'is_active' => 1,
'redeems_count_remain' => 1,
'redeems_count_for_user' => null,
'expiration_date' => '2014-10-16 21:44:31',
'virtual_items' =>
array (
'virtual_item' =>
array (
'id' => 77,
'sku' => 'T-43-3-unique-id',
'item_code' => null,
'advertisement_type' => null,
'name' =>
array (
'en' => 'T-34-3',
),
'description' =>
array (
'en' => 'This Chinese Tier VIII medium tank is a real beast in its class.',
),
'long_description' =>
array (
),
'prices' =>
array (
'USD' => 40.09,
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'purchase_limit' => 1,
'keywords' =>
array (
),
'image_url' => 'http://livedemo.xsolla.com/airplanes/tank5.jpg',
'groups' =>
array (25),
'item_type' => 'Expiration',
'expiration' => 1296000,
'virtual_currency_price' => null,
),
'amount' => 1
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"coupon_id": 1,
"project_id": 1,
"coupon_code": "CouPoNCoDe",
"campaign_code": "CaMPaiGNCoDe",
"virtual_currency_amount": 0,
"is_active": 1,
"redeems_count_remain": 1,
"redeems_count_for_user": null,
"expiration_date": "2014-10-16 21:44:31",
"virtual_items": {
"virtual_item": {
"id": 77,
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"advertisement_type": null,
"name": {
"en": "T-34-3"
},
"description": {
"en": "This Chinese Tier VIII medium tank is a real beast in its class."
},
"long_description": [],
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"purchase_limit": 1,
"keywords": [],
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"groups": [
25
],
"item_type": "Expiration",
"expiration": 1296000,
"virtual_currency_price": null,
"item_code": null
},
"amount": 1
}
}
{
"coupon_id": 1,
"project_id": 1,
"coupon_code": "CouPoNCoDe",
"campaign_code": "CaMPaiGNCoDe",
"virtual_currency_amount": 0,
"is_active": 1,
"redeems_count_remain": 1,
"redeems_count_for_user": null,
"expiration_date": "2014-10-16 21:44:31",
"virtual_items": {
"virtual_item": {
"id": 77,
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"advertisement_type": null,
"name": {
"en": "T-34-3"
},
"description": {
"en": "This Chinese Tier VIII medium tank is a real beast in its class."
},
"long_description": [],
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"purchase_limit": 1,
"keywords": [],
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"groups": [
25
],
"item_type": "Expiration",
"expiration": 1296000,
"virtual_currency_price": null,
"item_code": null
},
"amount": 1
}
}
Einen Gutschein einlösen
Einen Gutschein mittels seines Codes einlösen.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/projects/{project_id}/coupons/{code}/redeem
Parameter | Typ | Beschreibung |
---|---|---|
project_id | int | Spiele-ID. |
code | string | Gutscheincode. |
user_id | string | Spieler-ID. |
Anfrage
<?php
$response = $xsollaClient->RedeemCoupon(array(
'project_id' => PROJECT_ID,
'code' => COUPON_CODE,
'request' => array(
'user_id' => 1
)
));
POST /merchant/v2/merchants/{project_id}/coupons/{code}/redeem HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"user_id": 1
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/coupons/{code}/redeem' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"user_id": 1
}'
Antwort
<?php
// example response
$response = array (
'coupon_id' => 1,
'project_id' => 1,
'coupon_code' => 'CouPoNCoDe',
'campaign_code' => 'CaMPaiGNCoDe',
'virtual_currency_amount' => 0,
'is_active' => 1,
'redeems_count_remain' => 1,
'redeems_count_for_user' => null,
'expiration_date' => '2014-10-16 21:44:31',
'virtual_items' =>
array (
'virtual_item' =>
array (
'id' => 77,
'sku' => 'T-43-3-unique-id',
'item_code' => null,
'advertisement_type' => null,
'name' =>
array (
'en' => 'T-34-3',
),
'description' =>
array (
'en' => 'This Chinese Tier VIII medium tank is a real beast in its class.',
),
'long_description' =>
array (
),
'prices' =>
array (
'USD' => 40.09,
),
'default_currency' => 'USD',
'enabled' => true,
'permanent' => false,
'purchase_limit' => 1,
'keywords' =>
array (
),
'image_url' => 'http://livedemo.xsolla.com/airplanes/tank5.jpg',
'groups' =>
array (25),
'item_type' => 'Expiration',
'expiration' => 1296000,
'virtual_currency_price' => null,
),
'amount' => 1
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"coupon_id": 1,
"project_id": 1,
"coupon_code": "CouPoNCoDe",
"campaign_code": "CaMPaiGNCoDe",
"virtual_currency_amount": 0,
"is_active": 1,
"redeems_count_remain": 1,
"redeems_count_for_user": null,
"expiration_date": "2014-10-16 21:44:31",
"virtual_items": {
"virtual_item": {
"id": 77,
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"advertisement_type": null,
"name": {
"en": "T-34-3"
},
"description": {
"en": "This Chinese Tier VIII medium tank is a real beast in its class."
},
"long_description": [],
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"purchase_limit": 1,
"keywords": [],
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"groups": [
25
],
"item_type": "Expiration",
"expiration": 1296000,
"virtual_currency_price": null,
"item_code": null
},
"amount": 1
}
}
{
"coupon_id": 1,
"project_id": 1,
"coupon_code": "CouPoNCoDe",
"campaign_code": "CaMPaiGNCoDe",
"virtual_currency_amount": 0,
"is_active": 1,
"redeems_count_remain": 1,
"redeems_count_for_user": null,
"expiration_date": "2014-10-16 21:44:31",
"virtual_items": {
"virtual_item": {
"id": 77,
"sku": "T-43-3-unique-id",
"item_code": "chinese-medium-tank",
"advertisement_type": null,
"name": {
"en": "T-34-3"
},
"description": {
"en": "This Chinese Tier VIII medium tank is a real beast in its class."
},
"long_description": [],
"prices": {
"USD": 40.09
},
"default_currency": "USD",
"enabled": true,
"permanent": false,
"purchase_limit": 1,
"keywords": [],
"image_url": "http:\/\/livedemo.xsolla.com\/airplanes\/tank5.jpg",
"groups": [
25
],
"item_type": "Expiration",
"expiration": 1296000,
"virtual_currency_price": null,
"item_code": null
},
"amount": 1
}
}
Werbeaktion anlegen
Legt eine neue Werbeaktion an.
HTTP-ANFRAGE
POST https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
technical_name | string | Arbeitstitel der Werbeaktion. |
label | array of strings | Array der lokalisierten Kennzeichnungen, die im Zahlungsportal angezeigt werden. |
name | array of strings | Array der lokalisierten Bezeichnungen der Werbeaktion. |
description | array of strings | Array der lokalisierten Werbeaktionsbeschreibungen. |
project_id | int | ID des Spiels, das bei der Werbeaktion beworben werden soll. |
Anfrage
<?php
$response = $xsollaClient->CreatePromotion(array(
'request' => array (
'technical_name' => 'Sample Promotion',
'label' =>
array (
'en' => '30% SAVE',
),
'name' =>
array (
'en' => '30% PayPal Discount',
),
'description' =>
array (
'en' => '30% PayPal Discount Sample',
),
'project_id' => 1,
)
));
POST /merchant/v2/merchants/{merchant_id}/promotions HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"technical_name": "Sample Promotion",
"label": {
"en": "30% SAVE"
},
"name": {
"en": "30% PayPal Discount"
},
"description": {
"en": "30% PayPal Discount Sample"
},
"project_id": 1
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"technical_name": "Sample Promotion",
"label": {
"en": "30% SAVE"
},
"name": {
"en": "30% PayPal Discount"
},
"description": {
"en": "30% PayPal Discount Sample"
},
"project_id": 1
}'
Antwort
<?php
// example response
$response = array (
'id' => 1
);
HTTP/1.1 201 Created
{
"id": 1
}
{
"id": 1
}
Werbeaktion anfordern
Ruft eine Werbeaktion auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->GetPromotion(array(
'promotion_id' => 'PROMOTION_ID'
));
GET /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 1,
'project_id' => 1,
'technical_name' => 'Sample Promotion',
'name' =>
array (
'en' => '30% PayPal Discount'
),
'description' =>
array (
'en' => '30% PayPal Discount Sample'
),
'read_only' => false,
'enabled' => false
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"project_id": 1,
"technical_name": "Sample Promotion",
"label": {
"en": "30% SAVE"
},
"name": {
"en": "30% PayPal Discount"
},
"description": {
"en": "30% PayPal Discount Sample"
},
"read_only": false,
"enabled": false
}
{
"id": 1,
"project_id": 1,
"technical_name": "Sample Promotion",
"label": {
"en": "30% SAVE"
},
"name": {
"en": "30% PayPal Discount"
},
"description": {
"en": "30% PayPal Discount Sample"
},
"read_only": false,
"enabled": false
}
Werbeaktion aktualisieren
Aktualisiert eine Werbeaktion. Falls die Werbeaktion schreibgeschützt ist (read_only = true), können Sie den Parameter project_id nicht ändern.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
technical_name | string | Arbeitstitel der Werbeaktion. |
label | array of strings | Array der lokalisierten Kennzeichnungen, die im Zahlungsportal angezeigt werden. |
name | array of strings | Array der lokalisierten Bezeichnungen der Werbeaktion. |
description | array of strings | Array der lokalisierten Werbeaktionsbeschreibungen. |
project_id | int | ID des Spiels, das bei der Werbeaktion beworben werden soll. |
Anfrage
<?php
$response = $xsollaClient->UpdatePromotion(array(
'request' => array (
'technical_name' => 'Sample Promotion',
'label' =>
array (
'en' => '30% SAVE',
),
'name' =>
array (
'en' => '30% PayPal Discount',
),
'description' =>
array (
'en' => '30% PayPal Discount Sample',
),
'project_id' => 1,
)
));
PUT /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"technical_name": "Sample Promotion",
"label": {
"en": "30% SAVE"
},
"name": {
"en": "30% PayPal Discount"
},
"description": {
"en": "30% PayPal Discount Sample"
},
"project_id": 1
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"technical_name": "Sample Promotion",
"label": {
"en": "30% SAVE"
},
"name": {
"en": "30% PayPal Discount"
},
"description": {
"en": "30% PayPal Discount Sample"
},
"project_id": 1
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Werbeaktion überprüfen
Sie müssen eine Werbeaktion vor der Aktivierung überprüfen. Diese Methode liefert gegebenenfalls eine Liste der Fehler.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/review
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->ReviewPromotion(array(
'promotion_id' => 'PROMOTION_ID'
));
GET /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/review HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/review' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'component' => 'rewards',
'message' => 'You didn\'t select any reward'
),
array (
'component' => 'periods',
'message' => 'Please set the promotion time periods.'
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"component": "rewards",
"message": "You didn't select any reward"
},
{
"component": "periods",
"message": "Please set the promotion time periods."
}
]
[
{
"component": "rewards",
"message": "You didn't select any reward"
},
{
"component": "periods",
"message": "Please set the promotion time periods."
}
]
Werbeaktion zu-/abschalten
Schaltet den Status einer Werbeaktion von aktiv auf inaktiv bzw. von inaktiv auf aktiv.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/toggle
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->TogglePromotion(array(
'promotion_id' => 'PROMOTION_ID'
));
PUT /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/toggle HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/toggle' \
-X PUT \
-u merchant_id:merchant_api_key \
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Werbeaktion löschen
Löscht eine Werbeaktion. Sie können Werbeaktionen nur dann löschen, wenn dem Parameter 'enabled' der Wert 'false' zugeteilt wurde.
HTTP-ANFRAGE
DELETE https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->DeletePromotion(array(
'promotion_id' => 'PROMOTION_ID'
));
DELETE /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}' \
-X DELETE \
-u merchant_id:merchant_api_key
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Werbeaktionen auflisten
Listet alle Werbeaktionen auf.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
Anfrage
<?php
$response = $xsollaClient->ListPromotions(array(
));
GET /merchant/v2/merchants/{merchant_id}/promotions HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
array (
'id' => 1,
'project' =>
array (
'id' => 1,
'localized_name' => 'Demo Project'
),
'technical_name' => '25% bonus',
'read_only' => true,
'enabled' => true,
'is_active' => false,
'datetime' =>
array (
'from' => '2014-10-15T00:00:00+04:00',
'to' => '2014-10-16T23:59:59+04:00'
)
)
);
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 1,
"project": {
"id": 1,
"localized_name": "Demo Project"
},
"technical_name": "25% bonus",
"read_only": true,
"enabled": true,
"is_active": false,
"datetime": {
"from": "2014-10-15T00:00:00+04:00",
"to": "2014-10-16T23:59:59+04:00"
}
}
]
[
{
"id": 1,
"project": {
"id": 1,
"localized_name": "Demo Project"
},
"technical_name": "25% bonus",
"read_only": true,
"enabled": true,
"is_active": false,
"datetime": {
"from": "2014-10-15T00:00:00+04:00",
"to": "2014-10-16T23:59:59+04:00"
}
}
]
Thema anfordern
Fordert Informationen zum Thema der Werbeaktion an.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/subject
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->GetPromotionSubject(array(
'promotion_id' => 'PROMOTION_ID'
));
GET /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/subject HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/subject' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 1,
'purchase' => false,
'items' =>
array (
't-43-3-unique-id'
),
'packages' => null,
'subscriptions' =>
array (
'plans' =>
array (
array (
'id' => 123456,
'localized_name' => 'Subscription plan',
'external_id' => '894db422'
)
),
'products' =>
array (
654321
),
'max_charges_count' => null,
),
'digital_contents' => null
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"purchase": false,
"items": null,
"packages": null,
"subscriptions": {
"plans": [
{
"id":123456,
"localized_name":"Subscription plan",
"external_id":"894db422"
}
],
"products": [
654321
],
"max_charges_count": null
},
"digital_contents": null
}
{
"id": 1,
"purchase": false,
"items": null,
"packages": null,
"subscriptions": {
"plans": [
{
"id":123456,
"localized_name":"Subscription plan",
"external_id":"894db422"
}
],
"products": [
654321
],
"max_charges_count": null
},
"digital_contents": null
}
Thema festlegen
Legt das Thema einer Werbeaktion fest. Falls die Werbeaktion schreibgeschützt ist (read_only = true), können Sie das Thema nicht aktualisieren. Das Thema kann folgende Werte annehmen: "purchase", "items", "packages".
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/subject
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
purchase | boolean | Legt fest, ob die Werbeaktion auf den gesamten Einkauf zutrifft. |
items | array | Array der virtuellen Gegenstände, die bei der Werbeaktion zum Einsatz kommen. |
items.sku | string | SKU des Gegenstands. |
packages | array | Array der Angebotspakete mit virtueller Währung, die bei der Werbeaktion zum Einsatz kommen. |
subscriptions | object/null | Abo-Modelle oder Produkte, die bei der Werbeaktion zum Einsatz kommen. |
subscriptions.plans | array | Array der Abo-Modelle, die bei der Werbeaktion zum Einsatz kommen. |
subscriptions.products | array | Array der Produkte, die auf Abonnements basieren und bei der Werbeaktion zum Einsatz kommen. |
subscriptions.max_charges_count | int | Maximale Anzahl an Abrechnungen, die bei der Werbeaktion möglich sein soll. |
Anfrage
<?php
$response = $xsollaClient->SetPromotionSubject(array(
'request' => array (
'purchase' => false,
'items' => array (
array (
'sku' => 't-43-3-unique-id'
)
),
'packages' => null,
'subscriptions' =>
array (
'plans' =>
array (
array (
'id' => 123456
)
),
'products' =>
array (
654321
),
'max_charges_count' => null,
),
'digital_contents' =>
array (
array (
'id' => 1,
'localized_name' => 'test',
'drm' =>
array (
array (
'id' => 1,
'name' => 'Steam',
),
array (
'id' => 2,
'name' => 'Playstation',
)
)
)
)
)
));
PUT /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/subject HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"purchase": false,
"items": [
{
"sku":"t-43-3-unique-id"
}
],
"packages": null,
"subscriptions": {
"plans": [
{
"id":123456
}
],
"products": [
654321
],
"max_charges_count": null
},
"digital_contents":[
{
"id":1,
"localized_name":"test",
"drm":[
{
"id":1,
"name":"Steam"
},
{
"id":2,
"name":"Playstation"
}
]
}
]
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/subject' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"purchase": false,
"items": [
{
"sku":"t-43-3-unique-id"
}
],
"packages": null,
"subscriptions": {
"plans": [
{
"id":123456
}
],
"products": [
654321
],
"max_charges_count": null
},
"digital_contents":[
{
"id":1,
"localized_name":"test",
"drm":[
{
"id":1,
"name":"Steam"
},
{
"id":2,
"name":"Playstation"
}
]
}
]
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Zahlungssysteme auflisten
Fordert die für eine Werbeaktion unterstützten Zahlungssysteme an. Falls die Liste leer ist, können alle Zahlungssysteme für die Werbeaktion verwendet werden.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/payment_systems
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->GetPromotionPaymentSystems(array(
'promotion_id' => 'PROMOTION_ID'
));
GET /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/payment_systems HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/payment_systems' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 1,
'payment_systems' =>
array (
array (
'id' => 24,
'name' => 'PayPal'
),
array (
'id' => 26,
'name' => 'Visa / MasterCard'
)
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"payment_systems": [
{
"id": 24,
"name": "PayPal"
},
{
"id": 26,
"name": "Visa / MasterCard"
}
]
}
{
"id": 1,
"payment_systems": [
{
"id": 24,
"name": "PayPal"
},
{
"id": 26,
"name": "Visa / MasterCard"
}
]
}
Zahlungssysteme festlegen
Legt die für eine Werbeaktion unterstützten Zahlungssysteme fest. Falls die Liste leer ist, können alle Zahlungssysteme für die Werbeaktion verwendet werden. Falls die Werbeaktion schreibgeschützt ist (read_only = true), können Sie diese Methode nicht aufrufen.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/payment_systems
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
payment_systems | array | Zahlungssysteme (array). |
int | int | ID des Zahlungssystems. |
Anfrage
<?php
$response = $xsollaClient->SetPromotionPaymentSystems(array(
'request' => array(
'payment_systems' => array(
array('id' => 24)
)
)
));
PUT /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/payment_systems HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"payment_systems": [
{
"id": 24
},
{
"id": 26
}
]
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/payment_systems' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"payment_systems": [
{
"id": 24
},
{
"id": 26
}
]
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Geltungszeiträume auflisten
Fordert Datumsbereiche/Zeiträume an, in denen eine Werbeaktion aktiv geschaltet ist.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/periods
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->GetPromotionPeriods(array(
'promotion_id' => 'PROMOTION_ID'
));
GET /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/periods HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/periods' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 1,
'periods' =>
array (
'offset' => '+05:00',
'from' => '2014-10-14T00:00:00+04:00',
'to' => '2014-10-15T00:00:00+04:00'
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"periods": [
{
"offset": "+05:00",
"from": "2014-10-14T00:00:00+04:00",
"to": "2014-10-15T00:00:00+04:00"
}
]
}
{
"id": 1,
"periods": [
{
"offset": "+05:00",
"from": "2014-10-14T00:00:00+04:00",
"to": "2014-10-15T00:00:00+04:00"
}
]
}
Geltungszeiträume festlegen
Legt Datumsbereiche/Zeiträume fest, in denen eine Werbeaktion aktiv geschaltet ist. Falls die Werbeaktion schreibgeschützt ist (read_only = true), können Sie zwar neue Zeiträume hinzufügen, aber keine bestehenden bearbeiten.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/periods
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
periods | array | Datumsbereiche/Zeiträume (Array). |
from | datetime | Beginn des Zeitraums. |
to | datetime | Ende des Zeitraums. |
Anfrage
<?php
$response = $xsollaClient->SetPromotionPeriods(array(
'request' => array(
'periods' => array(
array(
'from' => $dateTime->format(\DateTime::ISO8601),
'to' => $dateTime->modify('+ 1 month')->format(\DateTime::ISO8601)
)
)
)
));
PUT /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/periods HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
{
"periods": [
{
"from": "2014-10-14T00:00:00+04:00",
"to": "2014-10-15T00:00:00+04:00"
}
]
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/periods' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"periods": [
{
"from": "2014-10-14T00:00:00+04:00",
"to": "2014-10-15T00:00:00+04:00"
}
]
}'
Antwort
<?php
$response = null;
HTTP/1.1 204 No Content
Belohnungen auflisten
Fordert eine Liste der Belohnungen, die zur Werbeaktion gehören.
HTTP-ANFRAGE
GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/rewards
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
Anfrage
<?php
$response = $xsollaClient->GetPromotionRewards(array(
'promotion_id' => 'PROMOTION_ID'
));
GET /merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/rewards HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/rewards' \
-X GET \
-u merchant_id:merchant_api_key
Antwort
<?php
// example response
$response = array (
'id' => 1,
'purchase' =>
array (
'discount_percent' => 10
),
'package' =>
array (
'bonus_percent' => 5,
'bonus_amount' => 5
),
'item' =>
array (
'discount' =>
array (
array (
'sku' => 't-43-3-unique-id',
'localized_name' => 'T-34-3',
'max_amount' => 10,
'discount_percent' => 5
)
),
'bonus' =>
array (
array (
'sku' => 't-43-3-unique-id',
'localized_name' => 'T-34-3',
'amount' => 2
)
)
),
'subscription' =>
array (
'trial_days' => 30
)
);
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"purchase": {
"discount_percent": 10
},
"package": {
"bonus_percent": 5,
"bonus_amount": 5
},
"item": {
"discount": [
{
"sku": "t-43-3-unique-id",
"localized_name": "T-34-3",
"max_amount": 10,
"discount_percent": 5
}
],
"bonus": [
{
"sku": "t-43-3-unique-id",
"localized_name": "T-34-3",
"amount": 2
}
]
},
"subscription": {
"trial_days": 30
}
}
{
"id": 1,
"purchase": {
"discount_percent": 10
},
"package": {
"bonus_percent": 5,
"bonus_amount": 5
},
"item": {
"discount": [
{
"sku": "t-43-3-unique-id",
"localized_name": "T-34-3",
"max_amount": 10,
"discount_percent": 5
}
],
"bonus": [
{
"sku": "t-43-3-unique-id",
"localized_name": "T-34-3",
"amount": 2
}
]
},
"subscription": {
"trial_days": 30
}
}
Belohnungen festlegen
Legt Belohnungen für eine Werbeaktion fest. Falls die Werbeaktion schreibgeschützt ist (read_only = true), können Sie die Belohnungen nicht aktualisieren.
HTTP-ANFRAGE
PUT https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/promotions/{promotion_id}/rewards
Parameter | Typ | Beschreibung |
---|---|---|
merchant_id | int | Händler-ID. |
promotion_id | int | ID der Werbeaktion. |
purchase | object | Legt die Belohnung für den gesamten Einkauf fest. |
purchase.discount_percent | float | Prozentualer Rabatt. |
package | object | Legt die Belohnung für ein virtuelles Währungspaket fest. |
package.bonus_percent | float | Belohnung als Prozentsatz der Paketmenge. |
package.bonus_amount | float | Belohnung als absolute Menge der virtuellen Währung. |
item | object | Legt die Belohnung für bestimmte virtuelle Gegenstände fest. |
item.discount | array | Rabatte für bestimmte virtuelle Gegenstände. |
item.discount[].sku | string | SKU des Gegenstands. |
item.discount[].discount_percent | float | Prozentualer Rabatt. |
item.discount[].max_amount | int | Maximale Anzahl an Gegenständen, die für die Werbeaktion verwendet wird. |
item.bonus | array | Zusätzliche virtuelle Gegenstände, die als Bonus verteilt werden. |
item.bonus[].sku | string | SKU des Gegenstands. |
item.bonus[].amount | int | Anzahl der virtuellen Gegenstände, die als Bonus verteilt werden. |
subscription | object | Legt die Belohnung für ein Abonnement fest. |
subscription.trial_days | int | Probezeitraum in Tagen. |
Anfrage
<?php
$response = $xsollaClient->SetPromotionRewards(array(
'request' => array (
'purchase' => array (
'discount_percent' => 10
),
'package' => array (
'bonus_percent' => 5,
'bonus_amount' => 5
),
'item' => array (
'discount' => array (
array (
'sku' => 't-43-3-unique-id',
'name' => 'T-34-3',
'max_amount' => 10,
'discount_percent' => 5
)
),
'bonus' => array (
array (
'sku' => 't-43-3-unique-id',
'name' => 'T-34-3',
'amount' => 2
)
)
),
'subscription' =>
array (
'trial_days' => 30
)
)