# Pay Station API # Overview * **Version:** 2.0.0 * **Servers**: * `https://api.xsolla.com/api` Pay Station allows partners to monetize their products by providing users with a convenient UI to pay for in-game purchases in the game store. To set up opening the payment UI, refer to these [instructions](/doc/pay-station/how-to/how-to-open-payment-ui/). The Pay Station API provides the following groups of calls: - Token — includes the API call to generate a token with arbitrary user parameters for further payment processing via the payment UI. - [Tokenization](/doc/pay-station/features/tokenization/) — includes API calls to securely process payments without opening the payment UI or involving the user. - Reports — includes API calls to return data on user transactions, generate reports, and get payouts breakdown by currency. - Refund — includes API calls to request full and partial refunds. - Testing — includes the API call to test the chargeback process. You can find detailed information about configuring the payment UI in the [Payments solution integration guide](/solutions/payments/integration-guide/integration-flow/).

Note

You can also refer to the Xsolla Base API section in the Postman collection to test API calls used for integration.

Version: 2.0 ## Servers ``` https://api.xsolla.com/merchant/v2 ``` ## Security ### basicAuth Xsolla API uses basic access authentication. All requests to API must contain the `Authorization: Basic ` header, where `` is the `merchant_id:api_key` pair encoded according to the Base64 standard. Go to [Publisher Account](https://publisher.xsolla.com/) to find these parameters:
For more information about working with API keys, see the [API reference](https://developers.xsolla.com/api/getting-started/#api_keys_overview). Type: http Scheme: basic ## Download OpenAPI description [Pay Station API](https://developers.xsolla.com/_bundle/api/pay-station/index.yaml) ## Token ### Create token - [POST /merchants/{merchant_id}/token](https://developers.xsolla.com/api/pay-station/token/create-token.md): You can create a token with arbitrary user parameters. You send these parameters when obtaining the token and receive them back after a successful payment. A token can only contain parameters either described in this document or predefined by you. If any parameter is sent in the wrong format or has the wrong type, no token will be issued. You will receive a 422 HTTP code with the error description in the JSON body. In extended_message you will receive an information what exact parameters have been sent incorrectly. By default, the token lifetime is 24 hours. If you want to change this value, contact your Customer Success Manager or send an email to csm@xsolla.com. The new value will be enabled for all your company’s projects created in Publisher Account. NoticeThe token you obtain after calling this API method can be used only for authorizing other requests. You can use this token to open the payment UI only if you integrated the Subscriptions product.To open the payment UI in a new window, use the following link: https://secure.xsolla.com/paystation4/?token={token}, where {token} is the received token.For testing purposes, use this URL: https://sandbox-secure.xsolla.com/paystation4/?token={token}. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ## Tokenization ### Get saved accounts - [GET /projects/{project_id}/users/{user_id}/payment_accounts](https://developers.xsolla.com/api/pay-station/tokenization/get-saved-accounts.md): Lists saved payment accounts of a given user. NoteIn sandbox mode, this API call works only with test cards that have no 3-D Secure function. ### Charge with saved account - [POST /projects/{project_id}/users/{user_id}/payments/{type}/{account_id}](https://developers.xsolla.com/api/pay-station/tokenization/charge-with-saved-account.md): Charges a user via a saved payment account. NoteIn sandbox mode, this API call works only with test cards that have no 3-D Secure function. NoticeFor the API call to work correctly, configure a timeout of 2 minutes. ### Delete saved account - [DELETE /projects/{project_id}/users/{user_id}/payment_accounts/{type}/{account_id}](https://developers.xsolla.com/api/pay-station/tokenization/delete-saved-account.md): Deletes a saved payment account. NoteIn sandbox mode, this API call works only with test cards that have no 3-D Secure function. NoteYou can call this API method in sandbox mode. To do this, pass the test payment account data in the request. Refer to the instruction for more information about sandbox mode access and testing scenarios. ## Reports ### Find transactions - [GET /merchants/{merchant_id}/reports/transactions/search.{format}](https://developers.xsolla.com/api/pay-station/reports/find-transactions.md): Returns a list of transactions based on specific search parameters. In response, you get data about all payments made in your game, even if they were not completed successfully. You can specify not only the transaction period, but also other parameters, e.g., to search for transactions made by a particular user or in a particular payment status. You can get the list in JSON or CSV format. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ### Find transactions (fast search) - [GET /merchants/{merchant_id}/reports/transactions/simple_search](https://developers.xsolla.com/api/pay-station/reports/find-transactions-fast.md): Gets a list of transactions based on specific search parameters within a few seconds. This is an alternative to the Find transactions API call that returns data in JSON, CSV, or XLS format. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ### Get transaction - [GET /merchants/{merchant_id}/reports/transactions/{transaction_id}/details](https://developers.xsolla.com/api/pay-station/reports/get-transaction.md): Gets full transaction info by ID. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ### Get transactions - [GET /merchants/{merchant_id}/reports/transactions/registry.{format}](https://developers.xsolla.com/api/pay-station/reports/get-transactions.md): Returns the list of detailed information about successful and canceled transactions for a specified period. In response, you get information about payments, including data on fees, taxes, as well as order and user. You can get the list in JSON or CSV format. You can use this API call to perform financial reconciliation. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ### Get payouts - [GET /merchants/{merchant_id}/reports/transfers](https://developers.xsolla.com/api/pay-station/reports/get-payouts.md): Lists all payouts for a period. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ### Get payouts breakdown in currency - [GET /merchants/{merchant_id}/reports/transactions/summary/transfer](https://developers.xsolla.com/api/pay-station/reports/get-payouts-breakdown.md): Gets payouts breakdown in currency. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ### Get reports - [GET /merchants/{merchant_id}/reports](https://developers.xsolla.com/api/pay-station/reports/get-reports.md): Gets the list of financial reports over a specified period. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ## Refund ### Request refund - [PUT /merchants/{merchant_id}/reports/transactions/{transaction_id}/refund](https://developers.xsolla.com/api/pay-station/refund/request-refund.md): Sends a refund request to return a payment to a user. Read about the [Refund feature](https://developers.xsolla.com/doc/pay-station/features/refund/) to learn more about the process. NoteYou can call this API method in sandbox mode. To do this, pass the test payment data in the request. Refer to the instruction for more information about sandbox mode access and testing scenarios. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ### Request partial refund - [PUT /merchants/{merchant_id}/reports/transactions/{transaction_id}/partial_refund](https://developers.xsolla.com/api/pay-station/refund/request-partial-refund.md): Sends a request for a partial refund to a user. Refer to our documentation for detailed information about the refund process and payment methods that support partial refunds. NoteYou can call this API method in sandbox mode. To do this, pass the test payment data in the request. Refer to the instruction for more information about sandbox mode access and testing scenarios. NoticeThis API call does not contain the project_id path parameter, so you need to use the API key that is valid in all the company’s projects to set up authorization. ## Testing ### Request chargeback - [POST /merchants/{merchant_id}/projects/{project_id}/payments/{transaction_id}/chargeback](https://developers.xsolla.com/api/pay-station/testing/request-chargeback.md): Requests chargeback in the sandbox mode: - To access the sandbox mode, pass "mode":"sandbox" when you get the token. - Test payment has to be made in the sandbox mode in the same project that you use for testing. - Transaction status has to be other than refunded, cancelled. - Your role in Publisher Account has to be at least Financial manager. (You can find it in the Company settings > Users section.) - Refer to the instruction for more information about this testing scenario. NoteRefer to the documentation for more information about other testing scenarios.