# Table of Contents - [Overview | Coda Distribution Platform Technical Documentation](#overview-coda-distribution-platform-technical-documentation) - [Integration Guides | Coda Distribution Platform Technical Documentation](#integration-guides-coda-distribution-platform-technical-documentation) - [Integration checklist | Coda Distribution Platform Technical Documentation](#integration-checklist-coda-distribution-platform-technical-documentation) - [Getting API credentials, IP Whitelisting, and Postman Collection | Coda Distribution Platform Technical Documentation](#getting-api-credentials-ip-whitelisting-and-postman-collection-coda-distribution-platform-technical-documentation) - [Direct topup purchase flow | Coda Distribution Platform Technical Documentation](#direct-topup-purchase-flow-coda-distribution-platform-technical-documentation) - [Type of gaming content for distribution | Coda Distribution Platform Technical Documentation](#type-of-gaming-content-for-distribution-coda-distribution-platform-technical-documentation) - [Sandbox environment | Coda Distribution Platform Technical Documentation](#sandbox-environment-coda-distribution-platform-technical-documentation) - [Timeout and handling retries | Coda Distribution Platform Technical Documentation](#timeout-and-handling-retries-coda-distribution-platform-technical-documentation) - [Distributor Portal | Coda Distribution Platform Technical Documentation](#distributor-portal-coda-distribution-platform-technical-documentation) - [Managing team members | Coda Distribution Platform Technical Documentation](#managing-team-members-coda-distribution-platform-technical-documentation) - [Product lists | Coda Distribution Platform Technical Documentation](#product-lists-coda-distribution-platform-technical-documentation) - [Secret key rotation | Coda Distribution Platform Technical Documentation](#secret-key-rotation-coda-distribution-platform-technical-documentation) - [Managing prepaid balance | Coda Distribution Platform Technical Documentation](#managing-prepaid-balance-coda-distribution-platform-technical-documentation) - [Transferring balance across wallet currency | Coda Distribution Platform Technical Documentation](#transferring-balance-across-wallet-currency-coda-distribution-platform-technical-documentation) - [Topping up prepaid balance | Coda Distribution Platform Technical Documentation](#topping-up-prepaid-balance-coda-distribution-platform-technical-documentation) - [Deciding which balance to use | Coda Distribution Platform Technical Documentation](#deciding-which-balance-to-use-coda-distribution-platform-technical-documentation) - [Transaction reports | Coda Distribution Platform Technical Documentation](#transaction-reports-coda-distribution-platform-technical-documentation) - [API References | Coda Distribution Platform Technical Documentation](#api-references-coda-distribution-platform-technical-documentation) - [Purchasing direct top-up and voucher codes | Coda Distribution Platform Technical Documentation](#purchasing-direct-top-up-and-voucher-codes-coda-distribution-platform-technical-documentation) - [Get order details | Coda Distribution Platform Technical Documentation](#get-order-details-coda-distribution-platform-technical-documentation) - [Request header & Authentication | Coda Distribution Platform Technical Documentation](#request-header-authentication-coda-distribution-platform-technical-documentation) - [Get prepayment balance | Coda Distribution Platform Technical Documentation](#get-prepayment-balance-coda-distribution-platform-technical-documentation) - [Voucher purchase | Coda Distribution Platform Technical Documentation](#voucher-purchase-coda-distribution-platform-technical-documentation) - [Error codes | Coda Distribution Platform Technical Documentation](#error-codes-coda-distribution-platform-technical-documentation) - [Direct-topup purchase | Coda Distribution Platform Technical Documentation](#direct-topup-purchase-coda-distribution-platform-technical-documentation) - [Get Product and SKU catalogue | Coda Distribution Platform Technical Documentation](#get-product-and-sku-catalogue-coda-distribution-platform-technical-documentation) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) --- # Overview | Coda Distribution Platform Technical Documentation ![Page cover](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252F2YHPEqBBhWIfrgJXkop0%252FCoda%2520Technical%2520Documentation%2520Header%2520Image%2520-%2520distribution.png%3Falt%3Dmedia%26token%3Dcd75f8ea-d903-45c9-b375-64bb727fdf0b&width=1248&dpr=3&quality=100&sign=72f975d3&sv=2) For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/overview.md) . Coda Distribution Network is a solution to help you - Coda's distribution partners, to sell and distribute the most popular digital content on your platforms. We have partnered with the biggest publishers globally to help you build a comprehensive portfolio. The most popular platforms rely on Coda to access top digital content. Get ready to discover why Coda is the absolute game-changer:[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation#get-ready-to-discover-why-coda-is-the-absolute-game-changer) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- * **Comprehensive distribution solution**: We offer a platform to manage your distribution business end-to-end within [**Coda Distributor Portal**](https://distributor-portal.codapayments.com/) **-** from managing API credentials, product lists, downloading transaction reports, to submitting payment. * **Widest content offering**: Get access to all of Coda's exclusive content and wider range of content formats through Vouchers and Direct Top-Ups. * **Dedicated operations team**: Contact our support 7 days a week via email or WhatsApp to ensure uninterrupted business operations. * **Rock-solid reliability:** We've got your back with 99.95%+ uptime with 24/7 monitoring and rapid response. [NextIntegration Guides](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides) Last updated 1 year ago --- # Integration Guides | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides.md) . This section provides a detailed overview of the process and steps needed to integrate to Coda Distribution Network. [PreviousOverview](https://coda-payments.gitbook.io/coda-distribution-technical-documentation) [NextIntegration checklist](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/integration-checklist) Last updated 1 year ago --- # Integration checklist | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/integration-checklist.md) . Follow this checklist to prepare your distribution account for launch. We suggest to read through all the documentation before coming back here again. * Review the API documentation and plan your integration * (If you are buying direct-topup product) - Read [Direct topup purchase flow](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow) guide * Access your account in the distribution portal (request access from your account manager if you don't have access) * [Get API Credentials](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/getting-api-credentials-ip-whitelisting-and-postman-collection) and whitelist your IP in sandbox & production in distributor portal * Download postman collection from distributor portal and test it locally * [Start API integration](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references) * [Handle timeout and retry mechanism](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/timeout-and-handling-retries) * Test the various purchase flow for following products in a [sandbox environment](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/sandbox-environment): * Voucher * Direct-topup with subtype = 1 (userid) * Direct-topup with subtype = 2 (userid, serverlist) * Direct-topup with subtype = 3 (userid, zoneid) * Direct-topup with haveRole = True * (If under prepayment model) [Make a prepayment submission](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/topping-up-prepaid-balance) * Ensure production credentials are correct * Request for assets (product images, description) from your account manager or Coda support team or download it directly from codashop.com * Launch [PreviousIntegration Guides](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides) [NextType of gaming content for distribution](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/type-of-gaming-content-for-distribution) Last updated 1 year ago --- # Getting API credentials, IP Whitelisting, and Postman Collection | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/getting-api-credentials-ip-whitelisting-and-postman-collection.md) . To obtain your API key, download our Postman API collection, and whitelist your IP addresses, navigate to Settings -> Integration tab. You would require to setup MFA authenticator before accessing this page * **API Key and Postman Collection:** Access the page to obtain your API key and download our Postman API collection. * **Key Expiry:** Note that the API secret key expires after 365 days. You will need to refresh it before it expires. You can have two secret keys at the same time for renewal purposes. * **IP Whitelisting:** Ensure all your IP addresses are added to the IP whitelist. Failure to whitelist IPs may result in rejection of your API requests. Note that the IP whitelist and credentials are different between production and sandbox environment. You need to whitelist the IP in both environment and also use the respective API credentials when doing sandbox or production testing. ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FL4iZnAxO4v65wXDHcOwF%252F12.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=d2294800&sv=2) [PreviousDirect topup purchase flow](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow) [NextSandbox environment](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/sandbox-environment) Last updated 1 year ago --- # Direct topup purchase flow | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow.md) . Transaction processing flow[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow#transaction-processing-flow) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ _API References:_ [Direct-topup purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase) Direct topup products will require two steps to place an order * **Validate API**: to validate whether the request sent from the partner system is correct by checking the following information: 1. Whether user account information entered is correct or not. 2. Whether the SKU is valid, and if the user is eligible to buy the SKU. 3. Whether the price entered is valid or not. We do price validation based on the listSKU response and validate requests to make sure you send the right price to us * **Topup API**: to top-up in-game products to the user account: * Response of validate will contain orderId which must be passed as part of topup. * Top-up must occur within 7 days of the validation call. Failure to do so will result in an order expiry error, as all initiated orders (those successfully validated) expire after 7 days if not topped up within that timeframe. We will only charge you for successful top-up requests. Orders that are validated but do not result in any successful top-ups will not incur any charges. ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FLfn24zifCduzWDaR19xl%252Fimage.png%3Falt%3Dmedia%26token%3Dc985c6db-9323-482c-90e1-e922a7e181e3&width=768&dpr=3&quality=100&sign=abbc8b75&sv=2) * * * Type of game account to collect from end-user[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow#type-of-game-account-to-collect-from-end-user) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Various games have different types of game account information required. There are two pieces of information that you need to consider: * Game account info type (`subtype`) * Userid only (`subtype=1`) * Userid and server list selection (`subtype=2`) * Require partner to ask user to select server from a predefined server list, which is supported in our [listServer API](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase) ) * Userid and zoneid (`subtype=3`) * zoneid is the region information from the game * If role selection is required (`haveRole=True`) * Some games have multiple accounts / roles from a userid, this is called "role" in Coda context. After validating the userid, the user will need to select which role the topup is meant for. * If True, you will need to ask user for their role upon successful **validate** request. **Validate** will return a role list and partner need to display the role selection UI to select the role. The the roleId will need to be passed to the **topup** request. ### Examples of type of game accounts in Codashop[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow#examples-of-type-of-game-accounts-in-codashop) Product type Subtype Codashop example topup 1 (userid) **FC Mobile** Require userid input ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FCCF2y9wTFNmPizN5e2Te%252Fimage.png%3Falt%3Dmedia%26token%3D43f777eb-4803-432f-9139-34ca6d694b45&width=300&dpr=3&quality=100&sign=423d484&sv=2) topup 2 (userid, serverlist) **Honkai: Star Rail** Require userid and serverlist selection ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FVpll9bjp2rlQ0OGbzdDa%252F4.png%3Falt%3Dmedia&width=300&dpr=3&quality=100&sign=8824e9d8&sv=2) topup 3 (userid, zoneid) **Mobile Legends** Require userid and zoneid input ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252F823ZdlW3VkRbPfSarmqU%252F5.png%3Falt%3Dmedia&width=300&dpr=3&quality=100&sign=500e6081&sv=2) topup any subtype and haveRole = TRUE **Era of Celestials** Require role selection after validating the gamer information ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FSIZo4IueuMrJ0pZM8319%252F6.png%3Falt%3Dmedia&width=300&dpr=3&quality=100&sign=ff9fd641&sv=2) After doing validate (clicking **Buynow** in Codashop), user is required to select their Role ID before proceeding to topup ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FU3g5LZqnJP3W0R2lowxf%252F7.png%3Falt%3Dmedia&width=300&dpr=3&quality=100&sign=186bfab1&sv=2) You can also check out the product in Codashop to see a live example of the user details needed for topup. [PreviousType of gaming content for distribution](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/type-of-gaming-content-for-distribution) [NextGetting API credentials, IP Whitelisting, and Postman Collection](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/getting-api-credentials-ip-whitelisting-and-postman-collection) Last updated 1 year ago --- # Type of gaming content for distribution | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/type-of-gaming-content-for-distribution.md) . Vouchers[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/type-of-gaming-content-for-distribution#vouchers) ----------------------------------------------------------------------------------------------------------------------------------------------------------- These products return end-users with a voucher code that can be redeemed on the publishers' or providers' platform. Example: Steam Wallet Code ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FdPYRYz8XQUk1jayA2r19%252Fimage.png%3Falt%3Dmedia%26token%3Db05bc4e3-4200-4d09-97d2-c34bf4cafb1b&width=768&dpr=3&quality=100&sign=b531ceb&sv=2) Direct Top-up[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/type-of-gaming-content-for-distribution#direct-top-up) --------------------------------------------------------------------------------------------------------------------------------------------------------------------- This product automatically tops up in-game currency to the game account. This will require partner to collect the game account information on the purchase flow. More detail can be found at:[Direct topup purchase flow](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow) Examples: Mobile Legends, Valorant ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FN9ZxMWqhzH1jQZl0uxdZ%252Fimage.png%3Falt%3Dmedia%26token%3D684ae375-6fb0-4746-bccb-e305111b6138&width=768&dpr=3&quality=100&sign=9184667d&sv=2) During integration, these two types have different integration flows. Direct topup products will require you to do two steps ordering process: validate and topup [PreviousIntegration checklist](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/integration-checklist) [NextDirect topup purchase flow](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow) Last updated 1 year ago --- # Sandbox environment | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/sandbox-environment.md) . You can access our sandbox environment by switching to test mode located at the bottom left corner of the Distributor Portal left side menu: ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FeiMcsShpiZFeMTKzSmnY%252Fimage.png%3Falt%3Dmedia%26token%3D1e5849bf-846e-4969-8a24-b21c489ccd6e&width=768&dpr=3&quality=100&sign=4d69f193&sv=2) The sandbox environment is pre-configured with 7 titles, which should cover various topup flows. These products may or may not be available in your account in the production environment, but can be used for the initial integration testing purposes. To explore the products available in our sandbox environment, please refer to the **API Document Page in Distributor Portal** which you can access in **Test Mode**. ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FahJVPQdqmZRD7HHHagUC%252F11.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=a89befac&sv=2) Game Endpoint Product Type Subtype haveRole Sample UserID Steam Voucher [https://xshop-sandbox.codashop.com/v2/steam-voucher](https://xshop-sandbox.codashop.com/v2/steam-voucher) voucher \- \- Free Fire [https://xshop-sandbox.codashop.com/v2/free-fire](https://xshop-sandbox.codashop.com/v2/free-fire) topup 1 \- Copy { "userAccount": "1029384", } Ragnarok X [https://xshop-sandbox.codashop.com/v2/ragnarok-x](https://xshop-sandbox.codashop.com/v2/ragnarok-x) topup 2 \- Copy { "userAccount": { "userId": "1029384", "server": { "id": "s1", "name": "Server 1" } } } Mobile Legends [https://xshop-sandbox.codashop.com/v2/mobile-legends](https://xshop-sandbox.codashop.com/v2/mobile-legends) topup 3 \- Copy { "userAccount": { "userId": "1029384", "zoneId": "111" } } Era of Celestials [https://xshop-sandbox.codashop.com/v2/era-of-celestials](https://xshop-sandbox.codashop.com/v2/era-of-celestials) topup 2 Y Copy { "userAccount": { "userId": "1029384", "server": { "id": "s1", "name": "Server 1" } } } Honkai Star Rail Cross Border [https://xshop-sandbox.codashop.com/v2/honkai-star-rail-crossborder](https://xshop-sandbox.codashop.com/v2/honkai-star-rail-crossborder) topup 2 \- Copy { "userAccount": { "userId": "1029384", "server": { "id": "s1", "name": "Server 1" } } } ### [](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/sandbox-environment#id-77ms4v40ob6z) [PreviousGetting API credentials, IP Whitelisting, and Postman Collection](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/getting-api-credentials-ip-whitelisting-and-postman-collection) [NextTimeout and handling retries](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/timeout-and-handling-retries) Last updated 1 year ago --- # Timeout and handling retries | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/timeout-and-handling-retries.md) . Our API is semi-idempotent. You can retry any method using the same `requestId` to check the status of the original request. However, each new request requires an updated `iat` (issued at) timestamp. Reusing the same `requestId` will not create a new record; it will return the same result as the previous request. We recommend to set a timeout of 12 seconds for all API methods. Make sure the iat (issued at) is within 5 minutes from when the request is made, anything more than that will result in an error. **Voucher Products:** * **placeOrder**: We set a timeout of 10 seconds for responses from our merchant partners. If we do not receive a response within this time, we will return a Failure. You can retry with the same `requestId` and a new `iat`. * **getOrder**: Only use `getOrder` if you have already received a response from `placeOrder`. If you haven’t received a response from `placeOrder`, retry `placeOrder` with a new `iat`. **Topup Products:** * **validate**: We set a timeout of 10 seconds for responses from our merchant partners, and 5 seconds for Mobile Legends. If there is no response within this timeframe, we will return a Failure. You can retry the `validate`request with a new `iat`. * Note: For `validate` the same request may not always return the same response. For instance, a `userId`might be eligible for a specific SKU on one day but not on another. * **topup**: We always reply instantly with `FULFILLED`. If a timeout occurs on the merchant side, we handle retries internally. If you receive no reply, simply retry the `topup` request with the same payload and a new `iat`. [PreviousSandbox environment](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/sandbox-environment) [NextDistributor Portal](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal) Last updated 1 year ago --- # Distributor Portal | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal.md) . The [Distributor Portal](https://distributor-portal.codapayments.com/) serves as your primary platform to access: 1. Sandbox and production credentials for integration 2. Team member management 3. Product & Price Lists 4. Submitting payment notification 5. Purchasing direct top-up or voucher codes 6. Monitoring and downloading transaction reports Upon onboarding, you will receive an email invitation to access the distributor portal, as shown below. If you have not received it, please contact your account manager to obtain access. The portal can be accessed at https://distributor-portal.codapayments.com/home. Please ensure to activate your account and update your password within 3 days of receiving the email. Failure to do so may require us to resend the invitation to your account. ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252Fh96qSUyDrVDyVKVcNYz0%252F8.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=e1e27c26&sv=2) ### [](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal#m9vq21dbnw1q) [PreviousTimeout and handling retries](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/timeout-and-handling-retries) [NextManaging team members](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-team-members) Last updated 1 year ago --- # Managing team members | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-team-members.md) . To manage your team members, navigate to [Settings](https://distributor-portal.codapayments.com/settings) -> Users tab on the distributor portal. In this section, you can add, remove, or modify access to the distributor portal. There are three available roles: Role Access No Access Admin Full access to all features Operations \[Transactions\] Access transactions page \[Products\] View list of products and SKUs \[API Document\] Access sandbox and prod API documents \[Topup/Crossborder\] Can place orders \[Prepayment\] Can only view submitted prepayments \[Settings - General\] Can update personal info \[Settings - General\] Can change password, enable/disable MFA \[Settings - Users\] See list of assigned users \[Convert Balance\] Cannot create balance transfers \[Prepayment\] Cannot create/update prepayment submissions \[Settings - Users\] Cannot add/update/remove users \[Settings - Integration\] Cannot access IP whitelisting \[Settings - General\] Cannot update business info Finance \[Convert Balance\] Create balance transfer requests \[Transactions\] Access transactions page \[Products\] View list of products and SKUs \[API Document\] Access sandbox and prod API documents \[Prepayment\] Create/update prepayment submissions \[Settings - General\] Update personal info \[Settings - General\] Change password, enable/disable MFA \[Settings - Users\] See list of assigned users \[Topup/Crossborder\] Cannot place orders \[Settings - Users\] Cannot add/update/remove users \[Settings - Integration\] Cannot access IP whitelisting \[Settings - General\] Cannot update business info User will need to accept the invitation in 3 days, or the invitation will expire. If the invitation expires, the user must be removed first from the User and readded to resend the invitation ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FpXp7due3vj9qWiLCGbZu%252Fimage.png%3Falt%3Dmedia%26token%3Da4b60551-8609-47cd-beb7-847acb214f0e&width=768&dpr=3&quality=100&sign=cc0f02df&sv=2) [PreviousDistributor Portal](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal) [NextProduct lists](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/product-lists) Last updated 1 year ago --- # Product lists | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/product-lists.md) . You can access and download the product lists, SKUs, and pricings available to your account by visiting the [**Product Page**](https://distributor-portal.codapayments.com/products/local) **.** You can also quickly identify a product's [subtype](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow) based on the tags beside their product name. You can also quickly copy a product's URL endpoint by clicking the **v2/** tag (v2/echocalypse in the screenshot example). There are also 2 different pricings you can see per product, **Distributor Price** and **Retail Price**. Distributor price is your purchase price from Coda, while retail price is a suggested price you can sell to your customers. ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FpVMcqGN7avZFLLesErQd%252Fimage.png%3Falt%3Dmedia%26token%3Dfef07122-6d40-48be-8f68-403cd1d4085d&width=768&dpr=3&quality=100&sign=8745538e&sv=2) **Voucher Terms & Conditions** You can download our vouchers terms & conditions from the same product page. If you don't see the terms & conditions available, please reach out to our support team and request for one. ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FJ1oIBNPbSVAvAWmuy56f%252Fimage.png%3Falt%3Dmedia%26token%3D439d0d64-eefa-4dd7-bad6-a3862455992f&width=768&dpr=3&quality=100&sign=d9eb0826&sv=2) [PreviousManaging team members](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-team-members) [NextManaging prepaid balance](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance) Last updated 1 year ago --- # Secret key rotation | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/secret-key-rotation.md) . Your secret key is valid for 365 days. To maintain security and compliance with standards, partners must update their secret key before it expires. There are two methods for secret key rotation: 1. **On-Demand Rotation**: The key will expire one year after it is rotated. 2. **Annual Auto-Rotation**: The key is automatically rotated once a year. To check the expiration date of your current key and obtain a new one, follow these steps in the distributor portal: 1. Navigate to the **Settings** section. 2. Go to **Integration** (enable MFA if it is not already enabled). 3. Review the expiration date of your current key and retrieve the new secret key. Ensure you update your key before the expiration date to avoid transaction issues. Last updated 1 year ago --- # Managing prepaid balance | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance.md) . If you are onboarded under prepaid structure, we will be processing your order by deducting your wallet balance. This section will provide the guide on how you can topup your wallet and manage your balance to buy content from Coda 1. [Topping up your prepaid balance](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/topping-up-prepaid-balance) 2. [Deciding which currency and balance to use](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/deciding-which-balance-to-use) 3. [Transferring balance across currency](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/transferring-balance-across-wallet-currency) [PreviousProduct lists](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/product-lists) [NextTopping up prepaid balance](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/topping-up-prepaid-balance) Last updated 1 year ago --- # Transferring balance across wallet currency | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/transferring-balance-across-wallet-currency.md) . Our portal supports currency conversion across wallets to facilitate your cross-border purchases: * The conversion will be processed manually by our team, and we have an internal benchmark to quote these conversion request * For example, if you request $100,000 USD to be converted to MYR, using a rate of 4.6263, we will add 462,630 MYR to your prepayment balance for purchasing MYR skus, and deduct $100,000 USD from your USD wallet. * Please consult with your account managers to obtain a quote before proceeding with currency conversion. Steps Screenshot 1. Click convert button ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fslidesz%2FAGV_vUf8Eis-1b3GZIfKyi5CLSGTaTp8zA2GgOuN4PkXhvpDc7OUetdH5ipRcG3Aacj5pmGPTh5K6rNAbf9Ggike0XfYI495-Y4tqsAvR55Xfw8qndS9347OJj7jKmNq3p7AZ0sr8hKB3g%3Ds2048%3Fkey%3DWnSRC-bqn1TTqbwyTwzb8g&width=300&dpr=3&quality=100&sign=4ce99138&sv=2) 1. Decide which currency wallet to convert from and to. ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fslidesz%2FAGV_vUfFRHj07SWw8FOGmaZrfm9GHwzBs2UDwX8VUyQlO2c8O6onhQdSXvwbEk2O1xD6oVBOVtSQkRqbnsmyV7RcZwqdQGja7-XSh_UHvnAqmldgv07Y4wyKZ-iGHk8ac4ISdb1orE4sOg%3Ds2048%3Fkey%3DWnSRC-bqn1TTqbwyTwzb8g&width=300&dpr=3&quality=100&sign=6e39ab43&sv=2) ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fslidesz%2FAGV_vUdrT04cgGDeaJ_EziftqwBiUmP89SJVX-ECT79-AmNC9KkXRIO-qCtNiLaKzklcFes6kSmTC5abdgHBVN0ycPnCOAPSYD58Jn7Jw2CKlfIGpeV7cKVE7J4RCuYICXPNvhuRqZ0bjg%3Ds2048%3Fkey%3DWnSRC-bqn1TTqbwyTwzb8g&width=300&dpr=3&quality=100&sign=362b34e8&sv=2) 1. Our team will review the request and convert it as per our internal benchmark rate. Reach out to support team if you want to confirm on the FX rate prior to making the conversion request ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fslidesz%2FAGV_vUcoaGulJWyE3DtJ-ihh2QKU0nIoWcneHtYFRnZ07mokCxyLAPS0D7oXA_AnU7AW29RJOntA_8UtS360UgRzMWZJ1T9fFeBO404DQRQZkk1oUI-Wde0bY8mDaaX-5eBwxi2pfL4Tzw%3Ds2048%3Fkey%3DWnSRC-bqn1TTqbwyTwzb8g&width=300&dpr=3&quality=100&sign=457c22bb&sv=2) If your requested transfer balance is originating from previous wallet transfer, there maybe some additional charges which will be baked in to the rate. [PreviousDeciding which balance to use](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/deciding-which-balance-to-use) [NextPurchasing direct top-up and voucher codes](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/purchasing-direct-top-up-and-voucher-codes) Last updated 1 year ago --- # Topping up prepaid balance | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/topping-up-prepaid-balance.md) . This is only applicable to partner under prepayment model or limited credits with Coda. If you are on a postpaid, you can ignore this section If you are onboarded under a prepayment model, follow these steps to fund your balance (if you are on a postpaid, you can ignore this section): Steps Screenshot 1. Open Prepayment Submission page by clicking **Top-up balance** or clicking **Prepayment Submissions** Menu ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FLmyTAebOXH9LFBCNlOHd%252Fimage.png%3Falt%3Dmedia%26token%3D9d7e2067-deaa-4692-99e4-6772722aa099&width=300&dpr=3&quality=100&sign=6291734a&sv=2) 1. Enter the currency and amount that you will be transferring ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fslidesz%2FAGV_vUdI2L6w6ItcBtDPWHapGapqQ6lswkxujQb-cAVSJwiDV7nTgV7KxXCEmEd93Iq1PyrPqnfySJj2JLxOk5FlrhaW2HbL6b4tirdSjss1E-akdVim0HI0y5CExJ61kdvcPoK9JMFMmw%3Ds2048%3Fkey%3DCV13BxhwUIn5oQf2cDH7jJZy&width=300&dpr=3&quality=100&sign=81e4dcf0&sv=2) 1. Make transfer to the displayed bank account. Include the Reference ID in your payment instruction ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fslidesz%2FAGV_vUeeuIJJ5Jv-yWtZHRVa2K0gkxmAMaPASXcxPTfXOnVTIMR9GwJKNLBaOuC7ZM35hRjIRp0_4zGc9LchqqFQ1zniMCiMeH8HycTGQaa9zLHVj61Ro6VD-Ac-HmrZ7mF8UgycCG55Ww%3Ds2048%3Fkey%3DCV13BxhwUIn5oQf2cDH7jJZy&width=300&dpr=3&quality=100&sign=dd3ad761&sv=2) (Optional) Download supporting document if needed from your bank ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fslidesz%2FAGV_vUf3S4oh_KNjlU8b3eyRcM8Nq75I5uTPcm_DcfAk0MicA9zu0J3YuxP4_8PhPy0y0yM9-t-qw_kjS4tZU85jhXvmpylPQKkFwpthdDsEGPLxXeDKmfknUqkNb-c9CTnt-IYH9xfz%3Ds2048%3Fkey%3DCV13BxhwUIn5oQf2cDH7jJZy&width=300&dpr=3&quality=100&sign=c1694abe&sv=2) 1. Submit proof of payment * After successfully transferring funds to our bank account, upload the payment proof ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FJ5GlmXrPi3KBbsexi8UL%252Fimage.png%3Falt%3Dmedia%26token%3D563aea3d-ce99-4a86-9517-8853f2af6527&width=768&dpr=3&quality=100&sign=962353ae&sv=2) **Finance team review** * Our Finance team will review the uploaded proof during working days (Monday to Friday, 9 AM to 5 PM GMT+7, JKT time). * Payments submitted outside these hours will be processed the next working day. Payments made after hours on Friday will be processed on the following Monday morning. * Once finance team has approved the submission, your balance will be topped up and you can see this on the top left of the dashboard ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FC7dPTarGdjvjebvWvI3A%252Fimage.png%3Falt%3Dmedia%26token%3D325c0411-e0e8-49e3-be94-1147ec10020b&width=768&dpr=3&quality=100&sign=64d3ebfb&sv=2) **Important Notes:** Payments must originate from the entity contracted with Coda. Do not transfer funds from personal bank accounts or uncontracted entities, as these payments will be rejected and returned. If upon entering the Prepayment Submissions page you encounter an error, please reach out to Coda's Distributor Support team to help create a wallet for your account. [PreviousManaging prepaid balance](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance) [NextDeciding which balance to use](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/deciding-which-balance-to-use) Last updated 1 year ago --- # Deciding which balance to use | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/deciding-which-balance-to-use.md) . We support two options for you to manage your balance in buying product from us 1. **USD Pricing and deduct USD wallet:** * We convert local currency SKU pricing to USD daily, and we will deduct your USD balance to process your order * Our FX rates are refreshed at 12:30AM UTC. Ensure you fetch the updated prices post-refresh to avoid transaction failures due to price validation checks. * We source our FX rates from [xignite](https://www.xignite.com/faqs/cryptocurrency-and-fx-rates/where-does-the-xignite-fx-rates-data-come-from/) and add a spread to manage the day-to-day fluctuation (spread may be different from country-to-country). 2. **Local Currency (LCY) Pricing and deduct LCY credit balance:** * You can send payment directly according to the LCY and we will topup your LCY wallet * We also support [wallet conversion feature](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/transferring-balance-across-wallet-currency) if you can't send payment in local currency to help you manage your balance and funds with us * By default, our pricing will be in USD, and if you want to proceed with this option, please raise request to our support team or your account manager so we can [PreviousTopping up prepaid balance](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/topping-up-prepaid-balance) [NextTransferring balance across wallet currency](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/transferring-balance-across-wallet-currency) Last updated 1 year ago --- # Transaction reports | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/transaction-reports.md) . You can access and download your historical transactions from the distributor portal under the Transactions tab. For direct-topup orders initiated after a 'validate' request, they remain valid for 7 days. During this period, partners can continue to make top-up requests. After 7 days, any orders without a top-up request will be automatically cancelled and marked as Failed. Orders that have failed the 'validate' request will not appear in the transaction history. We offer several filters to enhance your search: * **Country**: Source country of the SKU for the order. * **Product**: Name of the game or product. * **Timezone**: Display configuration of dates in the order table. * **OrderID**: Unique identifier for the order. * **Bulk Txn ID**: Transaction ID from bulk purchases made via the distributor portal. * **Request ID**: Partner ID sent from the API request. * **Status**: * **New**: Direct top-up order validated but not yet top-up requested. * **Fulfilled**: Direct top-up order with a top-up request. All voucher orders are marked with this status. * **Failed**: Direct top-up order that has failed after 7 days without a top-up request. Our reports default to displaying timezone in UTC. You can adjust the timezone display in the expanded filter options within the order history. ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FBT4mdKdFGXfHaq2l28t4%252F16.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=341c7507&sv=2) ### [](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/transaction-reports#id-41wtlqoblk1w) [PreviousPurchasing direct top-up and voucher codes](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/purchasing-direct-top-up-and-voucher-codes) [NextAPI References](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references) Last updated 1 year ago --- # API References | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references.md) . Our API can be accessed using using the following hostname: * Production: `https://xshop.codashop.com/v2/` * Sandbox: `https://xshop-sandbox.codashop.com/v2/` Our API is based on JSON-RPC standard ([https://www.jsonrpc.org/specification](https://www.jsonrpc.org/specification) ) Below is complete list of our API [Request header & Authentication](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/request-header-and-authentication) [Product and SKU catalogue](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue) [Direct topup purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase) [Voucher purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/voucher-purchase) [Get order details](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details) [Get prepayment balance](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-prepayment-balance) [Error codes](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes) [PreviousTransaction reports](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/transaction-reports) [NextRequest header & Authentication](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/request-header-and-authentication) Last updated 1 year ago --- # Purchasing direct top-up and voucher codes | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/purchasing-direct-top-up-and-voucher-codes.md) . In addition to using the API, you can purchase vouchers or top-ups directly from the distributor portal under the Top-Up menu When making transactions, if you are on a prepayment, we will deduct the balance according to the transaction amount and currency. For purchasing voucher codes, you can bulk purchase up to 20,000 codes per transaction. The codes will be delivered to the requester via email. Note some codes may not support bulk purchase as it's dependent on the supplier of the codes This feature is only applicable to partner under prepayment settlement flow. ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FRPbEhlt1GRtjPcms4RbF%252F14.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=33f34632&sv=2) ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2F532338858-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FeJPadAPb8Few47C1v6hy%252Fuploads%252FUbxWrLPZUZGkTpJSFcSe%252F15.png%3Falt%3Dmedia&width=768&dpr=3&quality=100&sign=7148fd9c&sv=2) ### [](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/purchasing-direct-top-up-and-voucher-codes#runwpwvie3c8) [PreviousTransferring balance across wallet currency](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/transferring-balance-across-wallet-currency) [NextTransaction reports](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/transaction-reports) Last updated 1 year ago --- # Get order details | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details.md) . Copy On this page Partner can get order detail by passing either: * [RequestId](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details#product-name) : Id that was submitted by partner during validate or placeOrder API * [OrderId](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details#product-name-1) : Coda Order Id that was returned after validate or placeOrder API ### Get order detail by request Id[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details#post-product-name) post https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /{product-name} Path parameters product-namestringRequired Name of the product to purchase Example: `mobile-legends` Body application/json application/json jsonrpcstringRequired Constant jsonrpc version 2.0 Example: `2.0` idstringRequired Request ID generated by client Example: `ID-TEST-1234` methodstringRequiredExample: `getOrder` paramsobjectRequired Show properties Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptional Unique request ID from the client resultobjectOptional Show properties post/{product-name} HTTP HTTPcURLJavaScriptPython Copy POST /v2/{product-name} HTTP/1.1 Host: xshop.codashop.com Content-Type: application/json Accept: */* Content-Length: 112 { "jsonrpc": "2.0", "id": "ID-TEST-1234", "method": "getOrder", "params": { "requestId": "ID-TEST-1234", "iat": 1524535871 } } 200 successful requests Copy { "jsonrpc": "2.0", "id": "text", "result": { "status": "FULFILLED", "orderId": "abcdefg-hijklkmn-opqrtuvwxyz", "items": [\ {\ "sku": "MLBB_123",\ "codes": "ABCDEFGHIJKLMNOP"\ }\ ] } } ### Get order detail by order Id[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details#post-product-name-1) post https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /{product-name} Path parameters product-namestringRequired Name of the product to purchase Example: `mobile-legends` Body application/json application/json jsonrpcstringRequired Constant jsonrpc version 2.0 Example: `2.0` idstringRequired Request ID generated by client Example: `ID-TEST-1234` methodstringRequiredExample: `getOrder` paramsobjectRequired Show properties Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptional Unique request ID from the client resultobjectOptional Show properties post/{product-name} HTTP HTTPcURLJavaScriptPython Copy POST /v2/{product-name} HTTP/1.1 Host: xshop.codashop.com Content-Type: application/json Accept: */* Content-Length: 126 { "jsonrpc": "2.0", "id": "ID-TEST-1234", "method": "getOrder", "params": { "orderId": "abcdefg-hijklkmn-opqrtuvwxyz", "iat": 1524535871 } } 200 successful requests Copy { "jsonrpc": "2.0", "id": "text", "result": { "status": "FULFILLED", "orderId": "abcdefg-hijklkmn-opqrtuvwxyz", "items": [\ {\ "sku": "MLBB_123",\ "codes": "ABCDEFGHIJKLMNOP"\ }\ ] } } [PreviousVoucher purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/voucher-purchase) [NextGet prepayment balance](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-prepayment-balance) Last updated 1 year ago --- # Request header & Authentication | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/request-header-and-authentication.md) . Coda xShop API is using `x-api-key` and auth token to authenticate your requests in the header. The authentication data ( `x-api-key`, `x-client-id` , `secret`) that is used to generate the authentication token can be fetched from [Integration Settings](https://distributor-portal.codapayments.com/settings) of your distributor portal ### Request Headers[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/request-header-and-authentication#request-headers) Name Value Content-Type `application/json` x-api-key `` x-api-version `2.0` Authorization `Bearer ` ### `Bearer ` generation method[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/request-header-and-authentication#bearer-less-than-token-greater-than-generation-method) * We use JSON Web Token generated based on header, payload, and signature. => [https://jwt.io/](https://jwt.io/introduction) * JSON Web Token consist of three parts separated by dots(.) which are: header.payload.signature * Header: `alg`, `typ`, `x-api-key`, `x-api-version`, `x-client-id` * `alg` must be "HS256", `typ` must be "JWT", and `x-api-version` must be "2.0" * `x-api-key` and `x-client-id` can be fetched from the distributor portal * Payload: payload used for the API call. Will be different for all API calls. **This needs to be stringified** when generating JWT token * Signature: encoded key based on `header`, `payload`, and `secret` * `secret` can be fetched from distributor portal * The easiest way to generate a JWT token is by using a jwt library, and can be found in [https://jwt.io/#libraries-io](https://jwt.io/#libraries-io) * Below is the sample of header, payload, and signature to generate the authorization token Sample header value Sample payload value Sample signature Copy { "alg": "HS256", "typ": "JWT", "x-api-key": "{your-api-key}", "x-api-version": "2.0", "x-client-id": "{your-client-id}" } Copy { "jsonrpc": "2.0", "id": "12345", "method": "placeOrder", "params": { "items": [\ {\ "sku": "SAMPLE-SKU-0U36C",\ "quantity": 1\ }\ ], "customerId": "customersIdHere", "iat": 1524535871 } } Copy key = '{your-secret-key}' unsignedToken = encodeBase64Url(header) + '.' + encodeBase64Url(payload) signature = HMAC-SHA256(key, unsignedToken) JWT = unsignedToken + ‘.’ + signature ### Code Sample[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/request-header-and-authentication#code-sample) NodeJS Java Copy function base64url(source) { // Encode in classical base64 encodedSource = CryptoJS.enc.Base64.stringify(source); // Remove padding equal characters encodedSource = encodedSource.replace(/=+$/, ''); // Replace characters according to base64url specifications encodedSource = encodedSource.replace(/\+/g, '-'); encodedSource = encodedSource.replace(/\//g, '_'); return encodedSource; } function getIAT() { return Math.floor(Date.now() / 1000) + 257; } var xApiKey = pm.environment.get("x-api-key"); var clientId = pm.environment.get("clientId"); var secret = pm.environment.get("secret"); var header = { "alg": "HS256", "typ": "JWT", "x-api-key": xApiKey, "x-api-version": "2.0", "x-client-id": clientId }; var data = request.data; var iat = getIAT(); postman.setGlobalVariable("iat", iat); var varObj = pm.globals.values.toObject(); for(var k in varObj) { data = data.replace(new RegExp("{{" + k + "}}", "g"), varObj[k]); } // console.log(data); // encode header var stringifiedHeader = CryptoJS.enc.Utf8.parse(JSON.stringify(header)); var encodedHeader = base64url(stringifiedHeader); // encode data var stringifiedData = CryptoJS.enc.Utf8.parse(JSON.stringify(data)); var encodedData = base64url(stringifiedData); // build token var token = encodedHeader + "." + encodedData; // sign token var signature = CryptoJS.HmacSHA256(token, secret); signature = base64url(signature); var signedToken = token + "." + signature; Copy package com.xshop.example; import org.json.simple.JSONObject; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.Base64; public class Application { public static final String HMAC_SHA256 = "HmacSHA256"; private static final String xApiKey = "YOUR_API_KEY"; private static final String clientId ="YOUR_CLIENT_KEY"; private static final String secret = "YOUR_SECRET"; public static void main(String [] args) { try { JSONObject headersJson = new JSONObject(); headersJson.put("alg", "HS256"); headersJson.put("typ", "JWT"); headersJson.put("x-api-key", xApiKey); headersJson.put("x-api-version", "2.0"); headersJson.put("x-client-id", clientId); String headers = headersJson.toJSONString(); System.out.println("headers: " + headers); String encodedHeader = Base64.getUrlEncoder().withoutPadding().encodeToString(headers.getBytes(StandardCharsets.UTF_8)); System.out.println("encodedHeader: " + encodedHeader); long iat = System.currentTimeMillis(); JSONObject payloadJson = new JSONObject(); payloadJson.put("jsonrpc", "2.0"); payloadJson.put("id", "ID-TEST-" + iat); payloadJson.put("method", "listSku"); JSONObject paramsJson = new JSONObject(); paramsJson.put("iat", iat); payloadJson.put("params", paramsJson); String payload = payloadJson.toJSONString(); System.out.println("payload: " + payload); String encodedPayload = Base64.getUrlEncoder().withoutPadding().encodeToString(payload.getBytes(StandardCharsets.UTF_8)); System.out.println("encodedPayload: " + encodedPayload); String token = encodedHeader + "." + encodedPayload; System.out.println("encodedHeader.encodedPayload: " + token); String signature = generate(token, secret); System.out.println("signature: " + signature); token = token + "." + signature; System.out.println("token: " + token); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (InvalidKeyException e) { e.printStackTrace(); } } public static String generate(final String data, final String key) throws NoSuchAlgorithmException, InvalidKeyException { if (key == null || data == null) throw new NullPointerException(); final Mac hMacSHA256 = Mac.getInstance(HMAC_SHA256); byte[] hmacKeyBytes = key.getBytes(StandardCharsets.UTF_8); final SecretKeySpec secretKey = new SecretKeySpec(hmacKeyBytes, HMAC_SHA256); hMacSHA256.init(secretKey); byte[] dataBytes = data.getBytes(StandardCharsets.UTF_8); byte[] res = hMacSHA256.doFinal(dataBytes); return Base64.getUrlEncoder().withoutPadding().encodeToString(res); } } Sample token generated Copy Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsIngtYXBpLWtleSI6IjllekV2WTNVWnY3Mm91cWVMbnplTDQ0eWxyYlBkWjVDNlkzZTJjMUgiLCJ4LWFwaS12ZXJzaW9uIjoiMi4wIiwieC1jbGllbnQtaWQiOiJ5b3VyQ2xpZW50SWRQcm92aWRlZEJ5Q29kYSJ9.eyJqc29ucnBjIjoiMi4wIiwiaWQiOiIxMjM0NSIsIm1ldGhvZCI6InBsYWNlT3JkZXIiLCJwYXJhbXMiOnsiaXRlbXMiOlt7InNrdSI6IlNBTVBMRS1TS1UtMFUzNkMiLCJxdWFudGl0eSI6Mn1dLCJjdXN0b21lcklkIjoiY3VzdG9tZXJzSWRIZXJlIiwiaWF0IjoxNTI0NTM1ODcxfX0.-xq9-FyTpVfbyMnJycJeQOXbHBB_WjiOoKHnmnLaZLo Example of curl with the header: Copy curl --location 'https://dev-api.codashop.com/v3/mobile-legends-coda-voucher' --header 'Authorization: Bearer ' --header 'x-api-key: ' --header 'Content-Type: application/json' --data '{yourpayloadhere}' **Note**: Do not expose the ClientId in the header. Encode it as part of the token. Your HTTP header should only contain: * X-Api-Key * X-Api-Version * Authorization * Content-Type [PreviousAPI References](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references) [NextGet Product and SKU catalogue](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue) Last updated 1 year ago --- # Get prepayment balance | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-prepayment-balance.md) . Copy On this page ### Get current prepayment balance[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-prepayment-balance#get-balance) get https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /balance List all prepayment balance partner have Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptionalExample: `ID-TEST-1234` resultobjectOptional Show properties get/balance HTTP HTTPcURLJavaScriptPython Copy GET /v2/balance HTTP/1.1 Host: xshop.codashop.com Accept: */* 200 successful requests Copy { "jsonrpc": "2.0", "id": "ID-TEST-1234", "result": { "balanceList": [\ {\ "country": "TH",\ "currency": "THB",\ "balance": 9104\ }\ ] } } ### Get current prepayment balance[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-prepayment-balance#get-balance-1) get https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /balance List all prepayment balance partner have Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptionalExample: `ID-TEST-1234` resultobjectOptional Show properties get/balance HTTP HTTPcURLJavaScriptPython Copy GET /v2/balance HTTP/1.1 Host: xshop.codashop.com Accept: */* 200 successful requests Copy { "jsonrpc": "2.0", "id": "ID-TEST-1234", "result": { "balanceList": [\ {\ "country": "TH",\ "currency": "THB",\ "balance": 9104\ }\ ] } } This API is not yet available in sandbox [PreviousGet order details](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details) [NextError codes](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes) Last updated 1 year ago --- # Voucher purchase | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/voucher-purchase.md) . Copy On this page The Voucher interface is for placing orders to purchase a voucher / gift code for product with type =`voucher`, `voucher 3rd-party` and `coda-voucher.` ### Place order for voucher product type[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/voucher-purchase#post-product-name) post https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /{product-name} Place an order for voucher which will return the code to be sent to the end-user. Method must be equal to 'placeOrder' Path parameters product-namestringRequired Name of the product to purchase Example: `steam-voucher` Body application/json application/json jsonrpcstringRequired Constant jsonrpc version 2.0 Example: `2.0` idstringRequired Unique request ID generated by your system that can be used for your reference. Example: `ID-TEST-1234` methodstringRequired must be 'placeOrder' to purchase voucher code. Direct-topup product will have different method. Example: `placeOrder` paramsobjectRequired Show properties Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptional Unique request ID from the client resultobjectOptional Show properties post/{product-name} HTTP HTTPcURLJavaScriptPython Copy POST /v2/{product-name} HTTP/1.1 Host: xshop.codashop.com Content-Type: application/json Accept: */* Content-Length: 195 { "jsonrpc": "2.0", "id": "ID-TEST-1234", "method": "placeOrder", "params": { "iat": 1524535871, "customerId": "customerId", "items": [\ {\ "sku": "MLBB_123",\ "quantity": 1,\ "price": {\ "currency": "USD",\ "amount": 100\ }\ }\ ] } } 200 successful requests Copy { "jsonrpc": "2.0", "id": "text", "result": { "status": "FULFILLED", "orderId": "abcdefg-hijklkmn-opqrtuvwxyz", "items": [\ {\ "sku": "MLBB_123",\ "codes": "ABCDEFGHIJKLMNOP",\ "expiryDate": "2024-09-15T23:59:59Z"\ }\ ] } } [PreviousDirect-topup purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase) [NextGet order details](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details) Last updated 1 year ago --- # Error codes | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes.md) . **Unauthorised Error**[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes#unauthorised-error) --------------------------------------------------------------------------------------------------------------------------------------------------- Error Code Error Name Error Message How to handle 30101 Unauthorised Access Authentication Failed: Unauthorized Access. Contact Coda Distribution Support Team to check 40000 Unauthorised Access Authentication Failed: Please ensure the authorization header is included with a valid token. Double-check authorization header 40001 Unauthorised Access Authentication Failed: Bearer token is missing or invalid. Double-check bearer token 40002 Unauthorised Access Authentication Failed: Client ID is missing or invalid. Double-check Client ID 40003 Unauthorised Access Authentication Failed: Your IP address is not allowed to access this resource. Whitelist IP via Distributor Portal in Settings > Integration 40004 Unauthorised Access Authentication Failed: IAT is missing or expired. Double-check IAT. IAT must be within 5 minutes from when the request is made **Invalid Request**[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes#invalid-request) --------------------------------------------------------------------------------------------------------------------------------------------- Error Code Error Name Error Message How to handle 30102 Invalid Request Order Not Found: The provided order ID does not exist. Double check the params.requestId or params.orderId that you are sending 30114 Invalid Request Invalid Request: Method in payload not applicable to this product. Double-check method parameter. Check API document for available API methods 30117 Invalid Request Transaction Denied: Your credit limit is not enough to process this request. Please top-up to resume transactions 32602 Invalid Request Invalid Request: Unknown Error Contact Coda Distribution Support Team to check 50000 Invalid Request Invalid Request: No order ID or request ID were found in the payload. Double-check payload contents 50001 Invalid Request Invalid Request: No method is found in the payload. Double-check payload contents 50002 Invalid Request Invalid Request: The request is invalid or improperly formatted. Double-check payload contents. Refer to API document for sample format **Internal Error**[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes#internal-error) ------------------------------------------------------------------------------------------------------------------------------------------- Error Code Error Name Error Message How to handle 30104 Internal Error Internal Error(30104): The server encountered an internal error. Please try again, or reach out to support for assistance. Contact Coda Distribution Support Team to check 30112 Internal Error Internal Error(30112): The server encountered an internal error. Please try again, or reach out to support for assistance. Contact Coda Distribution Support Team to check 32603 Internal Error Internal Error(32603): The server encountered an internal error. Please try again, or reach out to support for assistance. Contact Coda Distribution Support Team to check 60001 Internal Error Internal Error(60001): The server encountered an internal error. Please try again, or reach out to support for assistance. Contact Coda Distribution Support Team to check 60002 Internal Error Internal Error(60002): The server encountered an internal error. Please try again, or reach out to support for assistance. Contact Coda Distribution Support Team to check 60003 Internal Error Internal Error(60003): The server encountered an internal error. Please try again, or reach out to support for assistance. Contact Coda Distribution Support Team to check 60004 Internal Error Internal Error(60004): The server encountered an internal error. Please try again, or reach out to support for assistance. Contact Coda Distribution Support Team to check 60005 Internal Error Internal Error(60005): The server encountered an internal error. Please try again, or reach out to support for assistance. Contact Coda Distribution Support Team to check 60006 Internal Error Internal Error(60006): The server encountered an internal error. Please try again, or reach out to support for assistance. Contact Coda Distribution Support Team to check **Product/SKU Error**[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes#product-sku-error) ------------------------------------------------------------------------------------------------------------------------------------------------- Error Code Error Name Error Message How to handle 30106 SKU Error SKU Error: The specified SKU does not exist or is incorrect. Double-check SKU ID and product endpoint that you are hitting. If error still exist, contact Coda Distribution Support Team to check 30110 Quantity Error Quantity Error: The quantity entered does not match the expected value. Double-check quantity parameter. Must always be 1 30113 Price Error Price Error: The price entered does not match the expected value. Make sure you are fetching the latest price using listSku method. If error still persists, contact Coda Distribution Support Team to check 70000 Product Error Product Error: Invalid Product. Contact Coda Distribution Support Team to check **User Account Error**[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes#user-account-error) --------------------------------------------------------------------------------------------------------------------------------------------------- Error Code Error Name Error Message How to handle 30107 Invalid User Account Invalid User Account. Contact Coda Distribution Support Team to check 30108 Invalid User Account Invalid User Account: The user account is not recognized. Please confirm your account information. Double-check account information of the user. If error still persists, contact Coda Distribution Support Team to check 30111 Geolock Error Invalid User Account: The user's game account country is not eligible for sku in this country. Inform user to purchase the SKUs eligible for their account instead 80000 Invalid User Account Invalid User Account: The request payload is missing the 'userAccount' attribute. Double-check userAccount parameter 80001 Invalid User Account Invalid User Account: The request payload is missing the 'roleId' attribute. Double-check roleId parameter. 80002 Invalid User Account Invalid User Account: The request payload attribute, 'roleId', is invalid. Double-check roleId parameter. Must be the same roleId returned from validate 80003 Invalid User Account Invalid User Account: The request payload attribute, 'userAccount', is invalid or improperly formatted for subtype 1. Double-check userAccount parameter. Refer to API document for sample format 80004 Invalid User Account Invalid User Account: The request payload attribute, 'userAccount', is invalid or improperly formatted for subtype 2. Double-check userAccount parameter. Refer to API document for sample format 80005 Invalid User Account Invalid User Account: The request payload attribute, 'userAccount', is invalid or improperly formatted for subtype 3. Double-check userAccount parameter. Refer to API document for sample format 80006 Invalid User Account Invalid User Account: The request payload attribute, 'userAccount', is invalid or improperly formatted. Double-check userAccount parameter. Refer to API document for sample format 80007 Invalid User Account Invalid User Account: The user account in the validate process does not match the one in the top-up process Double-check userAccount parameter. **Miscellaneous Error**[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes#miscellaneous-error) ----------------------------------------------------------------------------------------------------------------------------------------------------- Error Code Error Name Error Message How to handle 30118 Stacking Exception Stack Limit exceeded (Only applicable for Tinder) Contact Coda Distribution Support Team to check 30199 Unknown Error An unknown error will be returned if the system encounters any unexpected circumstances. Contact Coda Distribution Support Team to check \-207 Too Many requests The same userID is not allowed to make a purchase within 2 seconds Make sure that requests from same userIDs are spaced for at least 2 seconds [PreviousGet prepayment balance](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-prepayment-balance) Last updated 1 year ago --- # Direct-topup purchase | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase.md) . Copy On this page The Top-up Interface is for placing orders to directly top-up a user account for product with type = `topup` As we are using JSON-RPC 2.0, The `/{product-name}` endpoint supports different kind of operations and differentiated through the `method` payload: 1. [Direct-topup purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase#product-name) with `"method" = "listServer"`\- Get server list selection (only for product with subtype = 2) 2. [Direct-topup purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase#product-name-1) with `"method"="validate"` - Validate userid and eligibility to buy skuid (step 1 of order flow). This will generate a new order with status = NEW and need to continue with topup to complete the order. 3. [Direct-topup purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase#product-name-2) with `"method" = "topup"` - Topup the userid after successful validate (step 2 of order flow). Your account will only be charged after topup is successful ![](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fdocsz%2FAD_4nXegv6ctxFQfyHrQWunTX-m-de_eL-QueJsdoY1wfQ4-N7THcrdGQ7IM9NMV8T4AsDQwUGX_3HxWBhXesWSZG42RZnn2z29ODjQwMPTLFqkah4fxYU_nl26m91LbAmI0uGYDMd8peQ_dHA53qJHPE2BIiQg%3Fkey%3DDHabZHQtc6xBCE9O-Uhipw&width=768&dpr=3&quality=100&sign=ba264658&sv=2) ### Get server list for product subtype = 2[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase#post-product-name) post https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /{product-name} Server list for user to select and required to do validate and topup. Must submit method="listServer". Authorizations ApiKeyAuth & BearerAuth ApiKeyAuth & BearerAuth x-api-keystringRequired AuthorizationstringRequired Bearer authentication header of the form Bearer . Path parameters product-namestringRequired Name of the product to purchase Example: `honkai-star-rail` Header parameters x-api\_keystringRequiredExample: `` Body application/json application/json jsonrpcstringRequired Constant jsonrpc version 2.0 Example: `2.0` idstringRequired Unique ID generated by the client Example: `ID-TEST-1234` methodstringRequiredExample: `listServer` paramsobjectRequired Show properties Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptionalExample: `ID-TEST-1234` serversobject\[\]Optional Show properties post/{product-name} HTTP HTTPcURLJavaScriptPython Copy POST /v2/{product-name} HTTP/1.1 Host: xshop.codashop.com x-api-key: YOUR_API_KEY Authorization: Bearer YOUR_SECRET_TOKEN x-api_key: text Content-Type: application/json Accept: */* Content-Length: 87 { "jsonrpc": "2.0", "id": "ID-TEST-1234", "method": "listServer", "params": { "iat": 1524535871 } } 200 successful requests Copy { "jsonrpc": "2.0", "id": "ID-TEST-1234", "servers": [\ {\ "id": "s1",\ "name": "server1",\ "area": "text",\ "platform": "text"\ }\ ] } ### Validate - first step to place order for a topup product[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase#post-product-name-1) post https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /{product-name} Validate the userid and eligibility to buy the skuid, required step before placing "topup" request. Must submit method="validate" in the payload. Path parameters product-namestringRequired Name of the product to purchase Example: `free-fire` Body application/json application/json jsonrpcstringRequired Constant jsonrpc version 2.0 Example: `2.0` idstringRequired Unique request ID generated by the partner. Same ID should be used in subsequent API method=topup call. Example: `ID-TEST-1234` methodstringRequired must be 'validate' Example: `validate` paramsobjectRequired Show properties Responses 200 successful request application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptional Unique request ID from the partner Example: `ID-TEST-1234` resultobjectOptional Show properties post/{product-name} HTTP HTTPcURLJavaScriptPython Copy POST /v2/{product-name} HTTP/1.1 Host: xshop.codashop.com Content-Type: application/json Accept: */* Content-Length: 215 { "jsonrpc": "2.0", "id": "ID-TEST-1234", "method": "validate", "params": { "iat": 1524535871, "customerId": "customerId", "items": [\ {\ "sku": "MLBB_123",\ "quantity": 1,\ "price": {\ "currency": "USD",\ "amount": 100\ }\ }\ ], "userAccount": 1029384 } } 200 successful request Copy { "jsonrpc": "2.0", "id": "ID-TEST-1234", "result": { "orderId": "abcdefg-hijklkmn-opqrtuvwxyz", "message": { "username": "game account username", "userAccount": 1029384, "sku": { "description": "11 Diamonds" }, "roles": [\ {\ "id": 13482,\ "name": "Role B"\ }\ ] } } } **User Account format for Validate Requests based on the product subtype** subtype = 1 subtype = 2 subtype = 3 Example: EA FC Mobile Copy "userAccount": "371507836" Example: Honkai Star Rail, Genshin Impact Copy "userAccount": { "userId": "4294967319", "server": { "id": "90001", "name": "Eternal Love" } Example: Mobile Legends: Bang Bang, Valorant Copy "userAccount": { "userId": "4294967319", "zoneId":"771" } **Validate Response Sample based on haveRole** haveRole=FALSE haveRole=TRUE Copy { "jsonrpc": "2.0", "id": "ID-TEST-1655871292", "result": { "message": { "username": "my game account username", "userAccount": { "userId": "4294967319", "server": { "id": "90001", "name": "Eternal Love" } }, }, "sku": { "description": "11 Diamonds" }, "orderId": "1c6cda00-375c-476e-8e1f-6b59ec958632" } } Copy { "jsonrpc": "2.0", "id": "ID-TEST-1655871292", "result": { "message": { "username": "my game account username", "userAccount": { "userId": "13482", "server": { "id": "1493310771", "name": "HKT-SERVER" } }, "roles": [\ {\ "id": "13482",\ "name": "Role A"\ },\ {\ "id": "13484",\ "name": "Role B"\ }\ ] }, "sku": { "description": "11 Diamonds" }, "orderId": "1c6cda00-375c-476e-8e1f-6b59ec958632" } } ### Topup - Final step to place order for a topup product[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase#post-product-name-2) post https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /{product-name} Topup the userid based on successful validate orderid. Must submit method="topup" in the payload Path parameters product-namestringRequired Name of the product to purchase Example: `free-fire` Body application/json application/json jsonrpcstringRequired Constant jsonrpc version 2.0 Example: `2.0` idstringRequired Unique request ID generated by the partner. Same ID should be used in previous API method=validate call Example: `ID-TEST-1234` methodstringRequired must be 'topup'. Example: `topup` usingValidateIdForTopupbooleanOptional if using the same Id when submitting validate and topup request, this will speed up the response time Example: `true` paramsobjectRequired Show properties Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptional Unique request ID from the client Example: `ID-TEST-1234` resultobjectOptional Show properties post/{product-name} HTTP HTTPcURLJavaScriptPython Copy POST /v2/{product-name} HTTP/1.1 Host: xshop.codashop.com Content-Type: application/json Accept: */* Content-Length: 284 { "jsonrpc": "2.0", "id": "ID-TEST-1234", "method": "topup", "usingValidateIdForTopup": true, "params": { "iat": 1524535871, "orderId": "abcdefg-hijklkmn-opqrtuvwxyz", "customerId": "customerId", "items": [\ {\ "sku": "MLBB_123",\ "quantity": 1,\ "price": {\ "currency": "USD",\ "amount": 100\ }\ }\ ], "userAccount": 1029384 } } 200 successful requests Copy { "jsonrpc": "2.0", "id": "ID-TEST-1234", "result": { "status": "FULFILLED", "orderId": "abcdefg-hijklkmn-opqrtuvwxyz" } } **User Account format for topup requests based on the product subtype** subtype = 1 subtype = 2 subtype = 3 `haveRole=FALSE` Copy "userAccount": "4294967319" `haveRole=TRUE` Copy "userAccount": { "userId": "4294967319", "roleId": "1234" } `haveRole=FALSE` Copy "userAccount": { "userId": "4294967319", "server": { "id": "90001", "name": "Eternal Love" } } `haveRole=TRUE` Copy "userAccount": { "userId": "4294967319", "server": { "id": "90001", "name": "Eternal Love" }, "roleId": "1234" } `haveRole=FALSE` Copy "userAccount": { "userId": "4294967319", "zoneId":"771" } `haveRole=TRUE` Copy "userAccount": { "userId": "4294967319", "zoneId":"771", "roleId": "1234" } [PreviousGet Product and SKU catalogue](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue) [NextVoucher purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/voucher-purchase) Last updated 1 year ago --- # Get Product and SKU catalogue | Coda Distribution Platform Technical Documentation For the complete documentation index, see [llms.txt](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt) . This page is also available as [Markdown](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue.md) . Copy On this page * Products: A collection of SKUs associated with a game or platform codes (e.g., MLBB Topup, Steam Wallet Code). To obtain a complete list of the product catalog, you can use the relevant API endpoint. * [Get Product and SKU catalogue](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue#products) to get complete list of product catalogue * There are two type of products: topup or vouchers (with possible values of `voucher`, `coda voucher`, or `voucher 3rd-party`). * For topup product: You must collect user game account information specified in the `subtype` and `haveRole` fields returned from this endpoint, as it will affect the payload structure in [Direct-topup purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase) . Refer to [Direct topup purchase flow](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow) for different user ID requirements for direct-topup products. * SKU: In-game item that will be delivered to the user (e.g 100 Diamonds, $50 Steam Wallet Code) * [Get Product and SKU catalogue](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue#product-name) with `"method"="listSku"`to get active SKUs for the product * `{product-name}` is included on the `apiPath` field that is returned from `/products` endpoint ### List all active products[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue#get-products) get https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /products This API will return all active Product in your account. This include information about product type (voucher or topup), subtype, and haveRole that should be used to determine the integration flow Query parameters countryCodeintegerOptional To get list of products originating from the ISO country code. Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptional Unique ID generated by our system Example: `ID-TEST-1234` resultobjectOptional Contains the response payload for a particular request. Show properties get/products HTTP HTTPcURLJavaScriptPython Copy GET /v2/products HTTP/1.1 Host: xshop.codashop.com Accept: */* 200 successful requests Copy { "jsonrpc": "2.0", "id": "ID-TEST-1234", "result": { "productList": [\ {\ "name": "Mobile Legends",\ "type": "topup",\ "subtype": 1,\ "haveRole": false,\ "haveVerify": false,\ "apiPath": "/mobile-legends",\ "supportedCountries": [\ "360,702"\ ],\ "metadata": {}\ }\ ] } } ### List SKUs of the product[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue#post-product-name) post https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /{product-name} List all SKUs of the product with its description, price and retail price. Method must be 'listSku'. Path parameters product-namestringRequired Name of the product from /products endpoint Example: `steam-voucher` Body application/json application/json jsonrpcstringRequired Constant jsonrpc version 2.0 Example: `2.0` idstringRequired Unique request ID generated by your system that can be used for your reference. Example: `ID-TEST-1234` methodstringRequiredExample: `listSku` paramsobjectRequired Show properties Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptional Request ID generated by the client (Any Unique Id) Example: `ID-TEST-1234` resultobjectOptional Contains the response payload for a particular request. Show properties post/{product-name} HTTP HTTPcURLJavaScriptPython Copy POST /v2/{product-name} HTTP/1.1 Host: xshop.codashop.com Content-Type: application/json Accept: */* Content-Length: 133 { "jsonrpc": "2.0", "id": "ID-TEST-1234", "method": "listSku", "params": { "iat": 1524535871, "countryCode": "text", "variableRetailRate": "text" } } 200 successful requests Copy { "jsonrpc": "2.0", "id": "ID-TEST-1234", "result": { "skuList": [\ {\ "sku": "MLBB_5_D",\ "description": "5 Diamond",\ "countryCode": 360,\ "origin": "id",\ "price": {\ "amount": 100,\ "currency": "USD"\ },\ "originalPrice": {\ "amount": 1350000,\ "currency": "IDR"\ },\ "retailPrice": {\ "amount": 2000000,\ "currency": "IDR"\ },\ "variableRetailPrice": {\ "amount": 120,\ "currency": "USD"\ }\ }\ ] } } ### Detail of the SKU[](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue#get-sku-skuid) get https://xshop.codashop.com/v2Production server https://xshop.codashop.com/v2https://xshop-sandbox.codashop.com/v2 /sku/{skuId} This API will return the detail of SKU. If SKU is inactive (due to out-of-stock or disabled), it will throw an error message with 200 response code Path parameters skuIdstringRequired SKU ID of the product returned from listSku API Example: `MLPHP11` Responses 200 successful requests application/json jsonrpcstringOptional Constant jsonrpc version 2.0 Example: `2.0` idstringOptional Request ID generated by our system. Example: `ID-TEST-1234` resultobjectOptional Contains the response payload for a particular request. Show properties get/sku/{skuId} HTTP HTTPcURLJavaScriptPython Copy GET /v2/sku/{skuId} HTTP/1.1 Host: xshop.codashop.com Accept: */* 200 successful requests Copy { "jsonrpc": "2.0", "id": "ID-TEST-1234", "result": { "resourcePath": "/mobile-legends", "sku": { "sku": "MLBB_5_D", "description": "5 Diamond", "countryCode": "US", "origin": "id", "price": { "amount": 100, "currency": "USD" }, "originalPrice": { "amount": 13500, "currency": "IDR" }, "retailPrice": { "amount": 20000, "currency": "IDR" } } } } [PreviousRequest header & Authentication](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/request-header-and-authentication) [NextDirect-topup purchase](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase) Last updated 1 year ago --- # Unknown \# Coda Distribution Platform Technical Documentation ## Coda Distribution Technical Documentation - \[Overview\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/overview.md) - \[Integration Guides\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides.md) - \[Integration checklist\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/integration-checklist.md) - \[Type of gaming content for distribution\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/type-of-gaming-content-for-distribution.md) - \[Direct topup purchase flow\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow.md) - \[Getting API credentials, IP Whitelisting, and Postman Collection\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/getting-api-credentials-ip-whitelisting-and-postman-collection.md) - \[Sandbox environment\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/sandbox-environment.md) - \[Timeout and handling retries\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/timeout-and-handling-retries.md) - \[Secret key rotation\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/secret-key-rotation.md) - \[Distributor Portal\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal.md) - \[Managing team members\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-team-members.md) - \[Product lists\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/product-lists.md) - \[Managing prepaid balance\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance.md) - \[Topping up prepaid balance\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/topping-up-prepaid-balance.md) - \[Deciding which balance to use\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/deciding-which-balance-to-use.md) - \[Transferring balance across wallet currency\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/transferring-balance-across-wallet-currency.md) - \[Purchasing direct top-up and voucher codes\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/purchasing-direct-top-up-and-voucher-codes.md) - \[Transaction reports\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/transaction-reports.md) - \[API References\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references.md) - \[Request header & Authentication\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/request-header-and-authentication.md) - \[Get Product and SKU catalogue\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue.md) - \[Direct-topup purchase\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase.md) - \[Voucher purchase\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/voucher-purchase.md) - \[Get order details\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details.md) - \[Get prepayment balance\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-prepayment-balance.md) - \[Error codes\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes.md): This page details the various error codes you might encounter and how to handle them. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/overview.md). # Overview Coda Distribution Network is a solution to help you - Coda's distribution partners, to sell and distribute the most popular digital content on your platforms. We have partnered with the biggest publishers globally to help you build a comprehensive portfolio. The most popular platforms rely on Coda to access top digital content. ## Get ready to discover why Coda is the absolute game-changer: \* \*\*Comprehensive distribution solution\*\*: We offer a platform to manage your distribution business end-to-end within \[\*\*Coda Distributor Portal\*\*\](https://distributor-portal.codapayments.com/) \*\*-\*\* from managing API credentials, product lists, downloading transaction reports, to submitting payment. \* \*\*Widest content offering\*\*: Get access to all of Coda's exclusive content and wider range of content formats through Vouchers and Direct Top-Ups. \* \*\*Dedicated operations team\*\*: Contact our support 7 days a week via email or WhatsApp to ensure uninterrupted business operations. \* \*\*Rock-solid reliability:\*\* We've got your back with 99.95%+ uptime with 24/7 monitoring and rapid response.

--- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides.md). # Integration Guides This section provides a detailed overview of the process and steps needed to integrate to Coda Distribution Network. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow.md). # Direct topup purchase flow ## Transaction processing flow \*API References:\* \[Direct-topup purchase\](/coda-distribution-technical-documentation/api-references/direct-topup-purchase.md) Direct topup products will require two steps to place an order \* \*\*Validate API\*\*: to validate whether the request sent from the partner system is correct by checking the following information: 1. Whether user account information entered is correct or not. 2. Whether the SKU is valid, and if the user is eligible to buy the SKU. 3. Whether the price entered is valid or not. We do price validation based on the listSKU response and validate requests to make sure you send the right price to us \* \*\*Topup API\*\*: to top-up in-game products to the user account: \* Response of validate will contain orderId which must be passed as part of topup. \* Top-up must occur within 7 days of the validation call. Failure to do so will result in an order expiry error, as all initiated orders (those successfully validated) expire after 7 days if not topped up within that timeframe. {% hint style="info" %} We will only charge you for successful top-up requests. Orders that are validated but do not result in any successful top-ups will not incur any charges. {% endhint %}
\*\*\* ## Type of game account to collect from end-user Various games have different types of game account information required. There are two pieces of information that you need to consider: \* Game account info type (\`subtype\`) \* Userid only (\`subtype=1\`) \* Userid and server list selection (\`subtype=2\`) \* Require partner to ask user to select server from a predefined server list, which is supported in our \[listServer API\](/coda-distribution-technical-documentation/api-references/direct-topup-purchase.md)) \* Userid and zoneid (\`subtype=3\`) \* zoneid is the region information from the game \* If role selection is required (\`haveRole=True\`) \* Some games have multiple accounts / roles from a userid, this is called "role" in Coda context. After validating the userid, the user will need to select which role the topup is meant for. \* If True, you will need to ask user for their role upon successful \*\*validate\*\* request. \*\*Validate\*\* will return a role list and partner need to display the role selection UI to select the role. The the roleId will need to be passed to the \*\*topup\*\* request. ### Examples of type of game accounts in Codashop
Product typeSubtypeCodashop example
topup1 (userid)

FC Mobile

Require userid input

topup2 (userid, serverlist)

Honkai: Star Rail

Require userid and serverlist selection

topup3 (userid, zoneid)

Mobile Legends

Require userid and zoneid input

topupany subtype and haveRole = TRUE

Era of Celestials

Require role selection after validating the gamer information

After doing validate (clicking Buynow in Codashop), user is required to select their Role ID before proceeding to topup

{% hint style="info" %} You can also check out the product in Codashop to see a live example of the user details needed for topup. {% endhint %} --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/type-of-gaming-content-for-distribution.md). # Type of gaming content for distribution ## Vouchers These products return end-users with a voucher code that can be redeemed on the publishers' or providers' platform. Example: Steam Wallet Code
## Direct Top-up This product automatically tops up in-game currency to the game account. This will require partner to collect the game account information on the purchase flow. More detail can be found at:\[Direct topup purchase flow\](/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow.md) Examples: Mobile Legends, Valorant
{% hint style="info" %} During integration, these two types have different integration flows. Direct topup products will require you to do two steps ordering process: validate and topup {% endhint %} --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/getting-api-credentials-ip-whitelisting-and-postman-collection.md). # Getting API credentials, IP Whitelisting, and Postman Collection To obtain your API key, download our Postman API collection, and whitelist your IP addresses, navigate to Settings -> Integration tab. You would require to setup MFA authenticator before accessing this page \* \*\*API Key and Postman Collection:\*\* Access the page to obtain your API key and download our Postman API collection. \* \*\*Key Expiry:\*\* Note that the API secret key expires after 365 days. You will need to refresh it before it expires. You can have two secret keys at the same time for renewal purposes. \* \*\*IP Whitelisting:\*\* Ensure all your IP addresses are added to the IP whitelist. Failure to whitelist IPs may result in rejection of your API requests. {% hint style="info" %} Note that the IP whitelist and credentials are different between production and sandbox environment. You need to whitelist the IP in both environment and also use the respective API credentials when doing sandbox or production testing. {% endhint %} !\[\](/files/pyu31COOgmb4WNsDTTHP) --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/integration-checklist.md). # Integration checklist {% hint style="info" %} Follow this checklist to prepare your distribution account for launch. We suggest to read through all the documentation before coming back here again. {% endhint %} \* \[x\] Review the API documentation and plan your integration \* \[x\] (If you are buying direct-topup product) - Read \[Direct topup purchase flow\](/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow.md) guide \* \[x\] Access your account in the distribution portal (request access from your account manager if you don't have access) \* \[x\] \[Get API Credentials\](/coda-distribution-technical-documentation/integration-guides/getting-api-credentials-ip-whitelisting-and-postman-collection.md) and whitelist your IP in sandbox & production in distributor portal \* \[x\] Download postman collection from distributor portal and test it locally \* \[x\] \[Start API integration\](/coda-distribution-technical-documentation/api-references.md) \* \[x\] \[Handle timeout and retry mechanism\](/coda-distribution-technical-documentation/integration-guides/timeout-and-handling-retries.md) \* \[x\] Test the various purchase flow for following products in a\[ sandbox environment\](/coda-distribution-technical-documentation/integration-guides/sandbox-environment.md): \* \[x\] Voucher \* \[x\] Direct-topup with subtype = 1 (userid) \* \[x\] Direct-topup with subtype = 2 (userid, serverlist) \* \[x\] Direct-topup with subtype = 3 (userid, zoneid) \* \[x\] Direct-topup with haveRole = True \* \[x\] (If under prepayment model) \[Make a prepayment submission\](/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/topping-up-prepaid-balance.md) \* \[x\] Ensure production credentials are correct \* \[x\] Request for assets (product images, description) from your account manager or Coda support team or download it directly from codashop.com \* \[x\] Launch --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/timeout-and-handling-retries.md). # Timeout and handling retries Our API is semi-idempotent. You can retry any method using the same \`requestId\` to check the status of the original request. However, each new request requires an updated \`iat\` (issued at) timestamp. Reusing the same \`requestId\` will not create a new record; it will return the same result as the previous request. We recommend to set a timeout of 12 seconds for all API methods. {% hint style="info" %} Make sure the iat (issued at) is within 5 minutes from when the request is made, anything more than that will result in an error. {% endhint %} \*\*Voucher Products:\*\* \* \*\*placeOrder\*\*: We set a timeout of 10 seconds for responses from our merchant partners. If we do not receive a response within this time, we will return a Failure. You can retry with the same \`requestId\` and a new \`iat\`. \* \*\*getOrder\*\*: Only use \`getOrder\` if you have already received a response from \`placeOrder\`. If you haven’t received a response from \`placeOrder\`, retry \`placeOrder\` with a new \`iat\`. \*\*Topup Products:\*\* \* \*\*validate\*\*: We set a timeout of 10 seconds for responses from our merchant partners, and 5 seconds for Mobile Legends. If there is no response within this timeframe, we will return a Failure. You can retry the \`validate\`request with a new \`iat\`. \* Note: For \`validate\` the same request may not always return the same response. For instance, a \`userId\`might be eligible for a specific SKU on one day but not on another. \* \*\*topup\*\*: We always reply instantly with \`FULFILLED\`. If a timeout occurs on the merchant side, we handle retries internally. If you receive no reply, simply retry the \`topup\` request with the same payload and a new \`iat\`. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/sandbox-environment.md). # Sandbox environment You can access our sandbox environment by switching to test mode located at the bottom left corner of the Distributor Portal left side menu:
The sandbox environment is pre-configured with 7 titles, which should cover various topup flows. These products may or may not be available in your account in the production environment, but can be used for the initial integration testing purposes. To explore the products available in our sandbox environment, please refer to the \*\*API Document Page in Distributor Portal\*\* which you can access in \*\*Test Mode\*\*. !\[\](/files/JCO3kUcfOFHK4X6n9qW2)
GameEndpointProduct TypeSubtypehaveRoleSample UserID
Steam Voucherhttps://xshop-sandbox.codashop.com/v2/steam-vouchervoucher--
Free Firehttps://xshop-sandbox.codashop.com/v2/free-firetopup1-
{
    "userAccount": "1029384",
}
Ragnarok Xhttps://xshop-sandbox.codashop.com/v2/ragnarok-xtopup2-
{
    "userAccount":
        {
            "userId": "1029384",
            "server": {
            "id": "s1",
            "name": "Server 1"
            }
        }
}
Mobile Legendshttps://xshop-sandbox.codashop.com/v2/mobile-legendstopup3-
{
      "userAccount":
            {
                  "userId": "1029384",
                  "zoneId": "111"
            }
}
Era of Celestialshttps://xshop-sandbox.codashop.com/v2/era-of-celestialstopup2Y
{
    "userAccount":
        {
            "userId": "1029384",
            "server": {
                "id": "s1",
                "name": "Server 1"
                }
        }
}
Honkai Star Rail Cross Borderhttps://xshop-sandbox.codashop.com/v2/honkai-star-rail-crossbordertopup2-

{
    "userAccount":
        {
            "userId": "1029384",
            "server": {
                "id": "s1",
                "name": "Server 1"
                }
        }
}
### --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal.md). # Distributor Portal The \[Distributor Portal\](https://distributor-portal.codapayments.com/) serves as your primary platform to access: 1. Sandbox and production credentials for integration 2. Team member management 3. Product & Price Lists 4. Submitting payment notification 5. Purchasing direct top-up or voucher codes 6. Monitoring and downloading transaction reports Upon onboarding, you will receive an email invitation to access the distributor portal, as shown below. If you have not received it, please contact your account manager to obtain access. The portal can be accessed at . Please ensure to activate your account and update your password within 3 days of receiving the email. Failure to do so may require us to resend the invitation to your account. !\[\](/files/FpqdA8WIVQ0oJY0XmEne) ### --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-team-members.md). # Managing team members To manage your team members, navigate to \[Settings\](https://distributor-portal.codapayments.com/settings) -> Users tab on the distributor portal. In this section, you can add, remove, or modify access to the distributor portal. There are three available roles:
RoleAccessNo Access
AdminFull access to all features
Operations\[Transactions\] Access transactions page
\[Products\] View list of products and SKUs
\[API Document\] Access sandbox and prod API documents
\[Topup/Crossborder\] Can place orders
\[Prepayment\] Can only view submitted prepayments
\[Settings - General\] Can update personal info
\[Settings - General\] Can change password, enable/disable MFA
\[Settings - Users\] See list of assigned users
\[Convert Balance\] Cannot create balance transfers
\[Prepayment\] Cannot create/update prepayment submissions
\[Settings - Users\] Cannot add/update/remove users
\[Settings - Integration\] Cannot access IP whitelisting
\[Settings - General\] Cannot update business info
Finance\[Convert Balance\] Create balance transfer requests
\[Transactions\] Access transactions page
\[Products\] View list of products and SKUs
\[API Document\] Access sandbox and prod API documents
\[Prepayment\] Create/update prepayment submissions
\[Settings - General\] Update personal info
\[Settings - General\] Change password, enable/disable MFA
\[Settings - Users\] See list of assigned users
\[Topup/Crossborder\] Cannot place orders
\[Settings - Users\] Cannot add/update/remove users
\[Settings - Integration\] Cannot access IP whitelisting
\[Settings - General\] Cannot update business info
User will need to accept the invitation in 3 days, or the invitation will expire. If the invitation expires, the user must be removed first from the User and readded to resend the invitation
--- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/product-lists.md). # Product lists You can access and download the product lists, SKUs, and pricings available to your account by visiting the \[\*\*Product Page\*\*\](https://distributor-portal.codapayments.com/products/local)\*\*.\*\* You can also quickly identify a product's \[subtype\](/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow.md) based on the tags beside their product name. You can also quickly copy a product's URL endpoint by clicking the \*\*v2/\*\* tag (v2/echocalypse in the screenshot example). There are also 2 different pricings you can see per product, \*\*Distributor Price\*\* and \*\*Retail Price\*\*. Distributor price is your purchase price from Coda, while retail price is a suggested price you can sell to your customers.
\*\*Voucher Terms & Conditions\*\* You can download our vouchers terms & conditions from the same product page. If you don't see the terms & conditions available, please reach out to our support team and request for one.
--- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/integration-guides/secret-key-rotation.md). # Secret key rotation Your secret key is valid for 365 days. To maintain security and compliance with standards, partners must update their secret key before it expires. There are two methods for secret key rotation: 1. \*\*On-Demand Rotation\*\*: The key will expire one year after it is rotated. 2. \*\*Annual Auto-Rotation\*\*: The key is automatically rotated once a year. To check the expiration date of your current key and obtain a new one, follow these steps in the distributor portal: 1. Navigate to the \*\*Settings\*\* section. 2. Go to \*\*Integration\*\* (enable MFA if it is not already enabled). 3. Review the expiration date of your current key and retrieve the new secret key. {% hint style="info" %} Ensure you update your key before the expiration date to avoid transaction issues. {% endhint %}
--- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance.md). # Managing prepaid balance If you are onboarded under prepaid structure, we will be processing your order by deducting your wallet balance. This section will provide the guide on how you can topup your wallet and manage your balance to buy content from Coda 1. \[Topping up your prepaid balance\](/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/topping-up-prepaid-balance.md) 2. \[Deciding which currency and balance to use\](/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/deciding-which-balance-to-use.md) 3. \[Transferring balance across currency\](/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/transferring-balance-across-wallet-currency.md) --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/transferring-balance-across-wallet-currency.md). # Transferring balance across wallet currency Our portal supports currency conversion across wallets to facilitate your cross-border purchases: \* The conversion will be processed manually by our team, and we have an internal benchmark to quote these conversion request \* For example, if you request $100,000 USD to be converted to MYR, using a rate of 4.6263, we will add 462,630 MYR to your prepayment balance for purchasing MYR skus, and deduct $100,000 USD from your USD wallet. \* Please consult with your account managers to obtain a quote before proceeding with currency conversion. | Steps | Screenshot | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
  1. Click convert button
| !\[\](https://lh7-rt.googleusercontent.com/slidesz/AGV\_vUf8Eis-1b3GZIfKyi5CLSGTaTp8zA2GgOuN4PkXhvpDc7OUetdH5ipRcG3Aacj5pmGPTh5K6rNAbf9Ggike0XfYI495-Y4tqsAvR55Xfw8qndS9347OJj7jKmNq3p7AZ0sr8hKB3g=s2048?key=WnSRC-bqn1TTqbwyTwzb8g) | |
  1. Decide which currency wallet to convert from and to.
|

| |
  1. Our team will review the request and convert it as per our internal benchmark rate. Reach out to support team if you want to confirm on the FX rate prior to making the conversion request
| !\[\](https://lh7-rt.googleusercontent.com/slidesz/AGV\_vUcoaGulJWyE3DtJ-ihh2QKU0nIoWcneHtYFRnZ07mokCxyLAPS0D7oXA\_AnU7AW29RJOntA\_8UtS360UgRzMWZJ1T9fFeBO404DQRQZkk1oUI-Wde0bY8mDaaX-5eBwxi2pfL4Tzw=s2048?key=WnSRC-bqn1TTqbwyTwzb8g) | {% hint style="info" %} If your requested transfer balance is originating from previous wallet transfer, there maybe some additional charges which will be baked in to the rate. {% endhint %} --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/topping-up-prepaid-balance.md). # Topping up prepaid balance {% hint style="info" %} This is only applicable to partner under prepayment model or limited credits with Coda. If you are on a postpaid, you can ignore this section {% endhint %} If you are onboarded under a prepayment model, follow these steps to fund your balance (if you are on a postpaid, you can ignore this section): | Steps | Screenshot | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
  1. Open Prepayment Submission page by clicking Top-up balance or clicking Prepayment Submissions Menu
| !\[\](/files/AgXRaxc8ekQ8j8RlRwAj) | |
  1. Enter the currency and amount that you will be transferring
| !\[\](https://lh7-rt.googleusercontent.com/slidesz/AGV\_vUdI2L6w6ItcBtDPWHapGapqQ6lswkxujQb-cAVSJwiDV7nTgV7KxXCEmEd93Iq1PyrPqnfySJj2JLxOk5FlrhaW2HbL6b4tirdSjss1E-akdVim0HI0y5CExJ61kdvcPoK9JMFMmw=s2048?key=CV13BxhwUIn5oQf2cDH7jJZy) | |
  1. Make transfer to the displayed bank account. Include the Reference ID in your payment instruction
| !\[\](https://lh7-rt.googleusercontent.com/slidesz/AGV\_vUeeuIJJ5Jv-yWtZHRVa2K0gkxmAMaPASXcxPTfXOnVTIMR9GwJKNLBaOuC7ZM35hRjIRp0\_4zGc9LchqqFQ1zniMCiMeH8HycTGQaa9zLHVj61Ro6VD-Ac-HmrZ7mF8UgycCG55Ww=s2048?key=CV13BxhwUIn5oQf2cDH7jJZy) | | (Optional) Download supporting document if needed from your bank | !\[\](https://lh7-rt.googleusercontent.com/slidesz/AGV\_vUf3S4oh\_KNjlU8b3eyRcM8Nq75I5uTPcm\_DcfAk0MicA9zu0J3YuxP4\_8PhPy0y0yM9-t-qw\_kjS4tZU85jhXvmpylPQKkFwpthdDsEGPLxXeDKmfknUqkNb-c9CTnt-IYH9xfz=s2048?key=CV13BxhwUIn5oQf2cDH7jJZy) | |
  1. Submit proof of payment
  • After successfully transferring funds to our bank account, upload the payment proof

|
| |

Finance team review

  • Our Finance team will review the uploaded proof during working days (Monday to Friday, 9 AM to 5 PM GMT+7, JKT time).
  • Payments submitted outside these hours will be processed the next working day. Payments made after hours on Friday will be processed on the following Monday morning.
  • Once finance team has approved the submission, your balance will be topped up and you can see this on the top left of the dashboard
|
| {% hint style="info" %} \*\*Important Notes:\*\* Payments must originate from the entity contracted with Coda. Do not transfer funds from personal bank accounts or uncontracted entities, as these payments will be rejected and returned. {% endhint %} {% hint style="danger" %} If upon entering the Prepayment Submissions page you encounter an error, please reach out to Coda's Distributor Support team to help create a wallet for your account. {% endhint %} --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/request-header-and-authentication.md). # Request header & Authentication Coda xShop API is using \`x-api-key\` and auth token to authenticate your requests in the header. The authentication data ( \`x-api-key\`, \`x-client-id\` , \`secret\`) that is used to generate the authentication token can be fetched from \[Integration Settings\](https://distributor-portal.codapayments.com/settings) of your distributor portal ### Request Headers
NameValue
Content-Typeapplication/json
x-api-key<x-api-key>
x-api-version2.0
AuthorizationBearer <token>
### \`Bearer \` generation method \* We use JSON Web Token generated based on header, payload, and signature. => \[https://jwt.io/\](https://jwt.io/introduction) \* JSON Web Token consist of three parts separated by dots(.) which are: header.payload.signature \* Header: \`alg\`, \`typ\`, \`x-api-key\`, \`x-api-version\`, \`x-client-id\` \* \`alg\` must be "HS256", \`typ\` must be "JWT", and \`x-api-version\` must be "2.0" \* \`x-api-key\` and \`x-client-id\` can be fetched from the distributor portal \* Payload: payload used for the API call. Will be different for all API calls. \*\*This needs to be stringified\*\* when generating JWT token \* Signature: encoded key based on \`header\`, \`payload\`, and \`secret\` \* \`secret\` can be fetched from distributor portal \* The easiest way to generate a JWT token is by using a jwt library, and can be found in \* Below is the sample of header, payload, and signature to generate the authorization token {% tabs %} {% tab title="Sample header value" %} \`\`\`json { "alg": "HS256", "typ": "JWT", "x-api-key": "{your-api-key}", "x-api-version": "2.0", "x-client-id": "{your-client-id}" } \`\`\` {% endtab %} {% tab title="Sample payload value" %} \`\`\`json { "jsonrpc": "2.0", "id": "12345", "method": "placeOrder", "params": { "items": \[\ {\ "sku": "SAMPLE-SKU-0U36C",\ "quantity": 1\ }\ \], "customerId": "customersIdHere", "iat": 1524535871 } } \`\`\` {% endtab %} {% tab title="Sample signature" %} \`\`\` key = '{your-secret-key}' unsignedToken = encodeBase64Url(header) + '.' + encodeBase64Url(payload) signature = HMAC-SHA256(key, unsignedToken) JWT = unsignedToken + ‘.’ + signature \`\`\` {% endtab %} {% endtabs %} ### Code Sample {% tabs %} {% tab title="NodeJS" %} \`\`\`javascript function base64url(source) { // Encode in classical base64 encodedSource = CryptoJS.enc.Base64.stringify(source); // Remove padding equal characters encodedSource = encodedSource.replace(/=+$/, ''); // Replace characters according to base64url specifications encodedSource = encodedSource.replace(/\\+/g, '-'); encodedSource = encodedSource.replace(/\\//g, '\_'); return encodedSource; } function getIAT() { return Math.floor(Date.now() / 1000) + 257; } var xApiKey = pm.environment.get("x-api-key"); var clientId = pm.environment.get("clientId"); var secret = pm.environment.get("secret"); var header = { "alg": "HS256", "typ": "JWT", "x-api-key": xApiKey, "x-api-version": "2.0", "x-client-id": clientId }; var data = request.data; var iat = getIAT(); postman.setGlobalVariable("iat", iat); var varObj = pm.globals.values.toObject(); for(var k in varObj) { data = data.replace(new RegExp("{{" + k + "}}", "g"), varObj\[k\]); } // console.log(data); // encode header var stringifiedHeader = CryptoJS.enc.Utf8.parse(JSON.stringify(header)); var encodedHeader = base64url(stringifiedHeader); // encode data var stringifiedData = CryptoJS.enc.Utf8.parse(JSON.stringify(data)); var encodedData = base64url(stringifiedData); // build token var token = encodedHeader + "." + encodedData; // sign token var signature = CryptoJS.HmacSHA256(token, secret); signature = base64url(signature); var signedToken = token + "." + signature; \`\`\` {% endtab %} {% tab title="Java" %} \`\`\`java package com.xshop.example; import org.json.simple.JSONObject; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.Base64; public class Application { public static final String HMAC\_SHA256 = "HmacSHA256"; private static final String xApiKey = "YOUR\_API\_KEY"; private static final String clientId ="YOUR\_CLIENT\_KEY"; private static final String secret = "YOUR\_SECRET"; public static void main(String \[\] args) { try { JSONObject headersJson = new JSONObject(); headersJson.put("alg", "HS256"); headersJson.put("typ", "JWT"); headersJson.put("x-api-key", xApiKey); headersJson.put("x-api-version", "2.0"); headersJson.put("x-client-id", clientId); String headers = headersJson.toJSONString(); System.out.println("headers: " + headers); String encodedHeader = Base64.getUrlEncoder().withoutPadding().encodeToString(headers.getBytes(StandardCharsets.UTF\_8)); System.out.println("encodedHeader: " + encodedHeader); long iat = System.currentTimeMillis(); JSONObject payloadJson = new JSONObject(); payloadJson.put("jsonrpc", "2.0"); payloadJson.put("id", "ID-TEST-" + iat); payloadJson.put("method", "listSku"); JSONObject paramsJson = new JSONObject(); paramsJson.put("iat", iat); payloadJson.put("params", paramsJson); String payload = payloadJson.toJSONString(); System.out.println("payload: " + payload); String encodedPayload = Base64.getUrlEncoder().withoutPadding().encodeToString(payload.getBytes(StandardCharsets.UTF\_8)); System.out.println("encodedPayload: " + encodedPayload); String token = encodedHeader + "." + encodedPayload; System.out.println("encodedHeader.encodedPayload: " + token); String signature = generate(token, secret); System.out.println("signature: " + signature); token = token + "." + signature; System.out.println("token: " + token); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (InvalidKeyException e) { e.printStackTrace(); } } public static String generate(final String data, final String key) throws NoSuchAlgorithmException, InvalidKeyException { if (key == null || data == null) throw new NullPointerException(); final Mac hMacSHA256 = Mac.getInstance(HMAC\_SHA256); byte\[\] hmacKeyBytes = key.getBytes(StandardCharsets.UTF\_8); final SecretKeySpec secretKey = new SecretKeySpec(hmacKeyBytes, HMAC\_SHA256); hMacSHA256.init(secretKey); byte\[\] dataBytes = data.getBytes(StandardCharsets.UTF\_8); byte\[\] res = hMacSHA256.doFinal(dataBytes); return Base64.getUrlEncoder().withoutPadding().encodeToString(res); } } \`\`\` {% endtab %} {% endtabs %} Sample token generated {% code overflow="wrap" %} \`\`\` Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsIngtYXBpLWtleSI6IjllekV2WTNVWnY3Mm91cWVMbnplTDQ0eWxyYlBkWjVDNlkzZTJjMUgiLCJ4LWFwaS12ZXJzaW9uIjoiMi4wIiwieC1jbGllbnQtaWQiOiJ5b3VyQ2xpZW50SWRQcm92aWRlZEJ5Q29kYSJ9.eyJqc29ucnBjIjoiMi4wIiwiaWQiOiIxMjM0NSIsIm1ldGhvZCI6InBsYWNlT3JkZXIiLCJwYXJhbXMiOnsiaXRlbXMiOlt7InNrdSI6IlNBTVBMRS1TS1UtMFUzNkMiLCJxdWFudGl0eSI6Mn1dLCJjdXN0b21lcklkIjoiY3VzdG9tZXJzSWRIZXJlIiwiaWF0IjoxNTI0NTM1ODcxfX0.-xq9-FyTpVfbyMnJycJeQOXbHBB\_WjiOoKHnmnLaZLo \`\`\` {% endcode %} Example of curl with the header: {% code overflow="wrap" %} \`\`\`sh curl --location 'https://dev-api.codashop.com/v3/mobile-legends-coda-voucher' --header 'Authorization: Bearer ' --header 'x-api-key: ' --header 'Content-Type: application/json' --data '{yourpayloadhere}' \`\`\` {% endcode %} {% hint style="info" %} \*\*Note\*\*: Do not expose the ClientId in the header. Encode it as part of the token. Your HTTP header should only contain: \* X-Api-Key \* X-Api-Version \* Authorization \* Content-Type
{% endhint %} --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-order-details.md). # Get order details Partner can get order detail by passing either: \* \[RequestId\](#product-name): Id that was submitted by partner during validate or placeOrder API \* \[OrderId\](#product-name-1): Coda Order Id that was returned after validate or placeOrder API ## POST /{product-name} > Get order detail by request Id \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"voucher","description":"All endpoint available for product with type = voucher / 3rd-party-voucher / coda-voucher"},{"name":"topup","description":"All endpoint available for product with type = topup"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"paths":{"/{product-name}":{"post":{"tags":\["voucher","topup"\],"summary":"Get order detail by request Id","operationId":"getOrder","parameters":\[{"name":"product-name","in":"path","description":"Name of the product to purchase","required":true,"schema":{"type":"string"}}\],"requestBody":{"$ref":"#/components/requestBodies/getOrder"},"responses":{"200":{"description":"successful requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/placeOrderResponse"}}}}}}}},"components":{"requestBodies":{"getOrder":{"description":"getOrder","content":{"application/json":{"schema":{"$ref":"#/components/schemas/getOrder"}}}}},"schemas":{"getOrder":{"allOf":\[{"$ref":"#/components/schemas/interface"},{"type":"object","required":\["method","params"\],"properties":{"method":{"type":"string"},"params":{"required":\["requestId","iat"\],"properties":{"requestId":{"type":"string","description":"Unique ID from the client that is submitted on placeOrder or topup API."},"iat":{"type":"integer","description":"The \\"iat\\" (issued at) field indicates the token's issuance time, which must be a UNIX EPOCH timestamp in UTC and within 5 minutes of the request time.","format":"int64"}}}}}\]},"interface":{"type":"object","required":\["jsonrpc","id"\],"properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Request ID generated by client"}}},"placeOrderResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique request ID from the client"},"result":{"type":"object","properties":{"status":{"type":"string","enum":\["FULFILLED","FAILED"\]},"orderId":{"type":"string"},"items":{"description":"Only for voucher orders.","type":"array","items":{"type":"object","properties":{"sku":{"type":"string","description":"SKU ID from list SKU"},"codes":{"type":"string","description":"Voucher code"}}}}}}}}}}} \`\`\` ## POST /{product-name} > Get order detail by order Id \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"voucher","description":"All endpoint available for product with type = voucher / 3rd-party-voucher / coda-voucher"},{"name":"topup","description":"All endpoint available for product with type = topup"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"paths":{"/{product-name}":{"post":{"tags":\["voucher","topup"\],"summary":"Get order detail by order Id","operationId":"getOrder","parameters":\[{"name":"product-name","in":"path","description":"Name of the product to purchase","required":true,"schema":{"type":"string"}}\],"requestBody":{"$ref":"#/components/requestBodies/getOrder"},"responses":{"200":{"description":"successful requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/placeOrderResponse"}}}}}}}},"components":{"requestBodies":{"getOrder":{"description":"getOrder","content":{"application/json":{"schema":{"$ref":"#/components/schemas/getOrder"}}}}},"schemas":{"getOrder":{"allOf":\[{"$ref":"#/components/schemas/interface"},{"type":"object","required":\["method","params"\],"properties":{"method":{"type":"string"},"params":{"required":\["orderId","iat"\],"properties":{"orderId":{"type":"string","description":"The orderid returned from placeOrder. OrderID that belongs to Coda system"},"iat":{"type":"integer","description":"The \\"iat\\" (issued at) field indicates the token's issuance time, which must be a UNIX EPOCH timestamp in UTC and within 5 minutes of the request time.","format":"int64"}}}}}\]},"interface":{"type":"object","required":\["jsonrpc","id"\],"properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Request ID generated by client"}}},"placeOrderResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique request ID from the client"},"result":{"type":"object","properties":{"status":{"type":"string","enum":\["FULFILLED","FAILED"\]},"orderId":{"type":"string"},"items":{"description":"Only for voucher orders.","type":"array","items":{"type":"object","properties":{"sku":{"type":"string","description":"SKU ID from list SKU"},"codes":{"type":"string","description":"Voucher code"}}}}}}}}}}} \`\`\` --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-prepayment-balance.md). # Get prepayment balance ## Get current prepayment balance > List all prepayment balance partner have \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"balance","description":"Get prepayment balance"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"paths":{"/balance":{"get":{"tags":\["balance"\],"summary":"Get current prepayment balance","description":"List all prepayment balance partner have","operationId":"getBalance","responses":{"200":{"description":"successful requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/prepaymentBalance"}}}}}}}},"components":{"schemas":{"prepaymentBalance":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string"},"result":{"type":"object","properties":{"balanceList":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string","description":"Prepayment balance country"},"currency":{"type":"string","description":"Prepayment balance currency"},"balance":{"type":"number","description":"Prepayment balance remaining"}}}}}}}}}}} \`\`\` {% openapi src="/files/SnnDkcw3IYp2i7vpUYJN" path="/balance" method="get" %} \[balance.yaml\](https://532338858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeJPadAPb8Few47C1v6hy%2Fuploads%2FMU4wEc38YyHpGpkVjSzW%2Fbalance.yaml?alt=media\\&token=c3c41cf4-7544-44d8-a585-be74a3307ac0) {% endopenapi %} {% hint style="info" %} This API is not yet available in sandbox {% endhint %} --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/get-product-and-sku-catalogue.md). # Get Product and SKU catalogue \* Products: A collection of SKUs associated with a game or platform codes (e.g., MLBB Topup, Steam Wallet Code). To obtain a complete list of the product catalog, you can use the relevant API endpoint. \* \[#products\](#products "mention") to get complete list of product catalogue \* There are two type of products: topup or vouchers (with possible values of \`voucher\`, \`coda voucher\`, or \`voucher 3rd-party\`). \* For topup product: You must collect user game account information specified in the \`subtype\` and \`haveRole\` fields returned from this endpoint, as it will affect the payload structure in \[Direct-topup purchase\](/coda-distribution-technical-documentation/api-references/direct-topup-purchase.md). Refer to \[Direct topup purchase flow\](/coda-distribution-technical-documentation/integration-guides/direct-topup-purchase-flow.md) for different user ID requirements for direct-topup products. \* SKU: In-game item that will be delivered to the user (e.g 100 Diamonds, $50 Steam Wallet Code) \* \[#product-name\](#product-name "mention") with \`"method"="listSku"\`to get active SKUs for the product \* \`{product-name}\` is included on the \`apiPath\` field that is returned from \`/products\` endpoint ## List all active products > This API will return all active Product in your account. This include information about product type (voucher or topup), subtype, and haveRole that should be used to determine the integration flow \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"products","description":"Get all products and its endpoint"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"paths":{"/products":{"get":{"tags":\["products"\],"summary":"List all active products","description":"This API will return all active Product in your account. This include information about product type (voucher or topup), subtype, and haveRole that should be used to determine the integration flow","operationId":"getProducts","parameters":\[{"in":"query","name":"countryCode","schema":{"type":"integer"},"description":"To get list of products originating from the ISO country code."}\],"responses":{"200":{"description":"successful requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Products"}}}}}}}},"components":{"schemas":{"Products":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique ID generated by our system"},"result":{"type":"object","description":"Contains the response payload for a particular request.","properties":{"productList":{"type":"array","description":"List of all products available in xshop","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the product"},"type":{"type":"string","description":"Type of product (Voucher or topup)","enum":\["topup","voucher","3rd-party-voucher","coda-voucher"\]},"subtype":{"type":"integer","description":"different subtype will require different game account information in the validate and topup response. For voucher product, this field will not be returned","enum":\[null,1,2,3\]},"haveRole":{"type":"boolean","description":"If True, RoleId that is returned from the validate request must be selected and submitted to its topup request"},"haveVerify":{"type":"boolean","description":"If True, the product have a verify method to verify the validity of game account information"},"apiPath":{"type":"string","description":"the product name to be used as the endpoint. The format will be xshop.codashop.com/v2/{apiPath}"},"supportedCountries":{"type":"array","description":"List of countries in ISO country code where the product is available","items":{"type":"integer"}},"metadata":{"type":"object"}}}}}}}}}}} \`\`\` ## List SKUs of the product > List all SKUs of the product with its description, price and retail price. Method must be 'listSku'. \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"voucher","description":"All endpoint available for product with type = voucher / 3rd-party-voucher / coda-voucher"},{"name":"topup","description":"All endpoint available for product with type = topup"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"paths":{"/{product-name}":{"post":{"tags":\["topup","voucher"\],"summary":"List SKUs of the product","description":"List all SKUs of the product with its description, price and retail price. Method must be 'listSku'.","operationId":"listSku","parameters":\[{"name":"product-name","in":"path","description":"Name of the product from /products endpoint","required":true,"schema":{"type":"string"}}\],"requestBody":{"$ref":"#/components/requestBodies/listSku"},"responses":{"200":{"description":"successful requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/listSkuResponse"}}}}}}}},"components":{"requestBodies":{"listSku":{"description":"listSKU object that needs to be submitted to listSKU","content":{"application/json":{"schema":{"$ref":"#/components/schemas/listSkuBody"}}}}},"schemas":{"listSkuBody":{"allOf":\[{"$ref":"#/components/schemas/interface"},{"type":"object","required":\["method","params"\],"properties":{"method":{"type":"string"},"params":{"type":"object","required":\["iat"\],"properties":{"iat":{"type":"integer","description":"The \\"iat\\" (issued at) identifies the time at which the token was issued. This will be used to determine the age of the token. Its value MUST be a number containing a UNIX EPOCH timestamp expressed in Coordinated Universal Time (UTC) value.","format":"int64"},"countryCode":{"type":"string","description":"Optional, When ISO countryCode is present in params, the result will only show the skus belong to the countryCode"},"variableRetailRate":{"type":"string","description":"Optional. When variableRetailRate is present in params, we will return additional parameters for variableRetailPrice in mentioned currency. Only accepts “USD”"}}}}}\]},"interface":{"type":"object","required":\["jsonrpc","id"\],"properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique request ID generated by your system that can be used for your reference."}}},"listSkuResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Request ID generated by the client (Any Unique Id)"},"result":{"type":"object","description":"Contains the response payload for a particular request.","properties":{"skuList":{"type":"array","description":"List of all products available in xshop","items":{"type":"object","properties":{"sku":{"type":"string","description":"Unique SKU ID of the item. Need to be passed to the placeOrder or validate and topup API."},"description":{"type":"string","description":"Description of the SKU"},"countryCode":{"type":"integer","description":"Country of the SKU"},"origin":{"type":"string","description":"Origin of the SKU (Alpha2 format for country)"},"price":{"type":"object","description":"price of the item. Need to be passed to the placeOrder or validate and topup API for price validation.","properties":{"amount":{"type":"number","description":"amount to be charged to the account"},"currency":{"type":"string","description":"currency of the amount to be charged to the account"}}},"originalPrice":{"type":"object","description":"original price of the item before conversion.","properties":{"amount":{"type":"number","description":"the amount of original price"},"currency":{"type":"string","description":"the currency of original price"}}},"retailPrice":{"type":"object","description":"recommended selling price","properties":{"amount":{"type":"number","description":"amount of standard selling price of the SKU in codashop"},"currency":{"type":"string","description":"currency of standard selling price of the SKU in codashop"}}},"variableRetailPrice":{"type":"object","properties":{"amount":{"type":"number","description":"Only returned when variableRetailRate is used. Converted value of the retail price in variable currency."},"currency":{"type":"string","description":"Only returned when variableRetailRate is used. The variable currency used."}}}}}}}}}}}}} \`\`\` ## Detail of the SKU > This API will return the detail of SKU. If SKU is inactive (due to out-of-stock or disabled), it will throw an error message with 200 response code \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"sku","description":"Get sku details"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"paths":{"/sku/{skuId}":{"get":{"tags":\["sku"\],"summary":"Detail of the SKU","description":"This API will return the detail of SKU. If SKU is inactive (due to out-of-stock or disabled), it will throw an error message with 200 response code","operationId":"getSku","parameters":\[{"name":"skuId","in":"path","description":"SKU ID of the product returned from listSku API","required":true,"schema":{"type":"string"}}\],"responses":{"200":{"description":"successful requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/getSkuResponse"}}}}}}}},"components":{"schemas":{"getSkuResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Request ID generated by our system."},"result":{"type":"object","description":"Contains the response payload for a particular request.","properties":{"resourcePath":{"type":"string","description":"Endpoint of the product used to listSku, placeOrder, validate, or topup"},"sku":{"type":"object","description":"Object of the SKU detail","properties":{"sku":{"type":"string","description":"Unique SKU ID of the item. Need to be passed to the placeOrder or validate and topup API."},"description":{"type":"string","description":"Description of the SKU"},"countryCode":{"type":"string","description":"Country of the SKU (Alpha2 format for country)"},"origin":{"type":"string","description":"Origin of the SKU (Alpha2 format for country)"},"price":{"type":"object","description":"price of the item charged to the client account. Need to be passed to the placeOrder or validate and topup API for price validation.","properties":{"amount":{"type":"number","format":"float","description":"amount to be charged to the account"},"currency":{"type":"string","description":"currency of the amount to be charged to the account"}}},"originalPrice":{"type":"object","description":"original price of the item charged to the client account before currency conversion.","properties":{"amount":{"type":"number","format":"float","description":"the amount of original price"},"currency":{"type":"string","description":"the currency of original price"}}},"retailPrice":{"type":"object","description":"recommended standard retail price to the end user","properties":{"amount":{"type":"number","format":"float","description":"amount of standard retail price of the SKU"},"currency":{"type":"string","description":"currency of standard retail price of the SKU"}}}}}}}}}}}} \`\`\` --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/voucher-purchase.md). # Voucher purchase The Voucher interface is for placing orders to purchase a voucher / gift code for product with type =\`voucher\`, \`voucher 3rd-party\` and \`coda-voucher.\` ## Place order for voucher product type > Place an order for voucher which will return the code to be sent to the end-user. Method must be equal to 'placeOrder' \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"voucher","description":"All endpoint available for product with type = voucher / 3rd-party-voucher / coda-voucher"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"paths":{"/{product-name}":{"post":{"tags":\["voucher"\],"summary":"Place order for voucher product type","description":"Place an order for voucher which will return the code to be sent to the end-user. Method must be equal to 'placeOrder'","operationId":"placeOrder","parameters":\[{"name":"product-name","in":"path","description":"Name of the product to purchase","required":true,"schema":{"type":"string"}}\],"requestBody":{"$ref":"#/components/requestBodies/placeOrder"},"responses":{"200":{"description":"successful requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/placeOrderResponse"}}}}}}}},"components":{"requestBodies":{"placeOrder":{"description":"placeOrder","content":{"application/json":{"schema":{"$ref":"#/components/schemas/placeOrderBody"}}}}},"schemas":{"placeOrderBody":{"allOf":\[{"$ref":"#/components/schemas/interface"},{"type":"object","required":\["method","params"\],"properties":{"method":{"type":"string","description":"must be 'placeOrder' to purchase voucher code. Direct-topup product will have different method."},"params":{"type":"object","required":\["iat","customerId","items"\],"properties":{"iat":{"type":"integer","description":"The \\"iat\\" (issued at) field indicates the token's issuance time, which must be a UNIX EPOCH timestamp in UTC and within 5 minutes of the request time.","format":"int64"},"customerId":{"type":"string","description":"Unique customer account identifier in client’s system. They can send customer email or their internal customer unique identifier in their system."},"items":{"type":"array","description":"Currently only support one array of item.","items":{"type":"object","required":\["sku","quantity","price"\],"properties":{"sku":{"type":"string","description":"SKU ID from list SKU"},"quantity":{"type":"integer","description":"Currently only support one quantity"},"price":{"type":"object","required":\["currency","amount"\],"properties":{"currency":{"type":"string","description":"Currency from listSKU. This will be what is charged to your account"},"amount":{"type":"number","description":"Amount from listSKU. This will be what is charged to your account"}}}}}}}}}}\]},"interface":{"type":"object","required":\["jsonrpc","id"\],"properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique request ID generated by your system that can be used for your reference."}}},"placeOrderResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique request ID from the client"},"result":{"type":"object","properties":{"status":{"type":"string","enum":\["FULFILLED","FAILED"\]},"orderId":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":\["sku","codes"\],"properties":{"sku":{"type":"string","description":"SKU ID from list SKU"},"codes":{"type":"string","description":"Voucher code"},"expiryDate":{"type":"string","description":"Expiration period. Only applicable to coda voucher product type"}}}}}}}}}}} \`\`\` --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/error-codes.md). # Error codes ## \*\*Unauthorised Error\*\* | Error Code | Error Name | Error Message | How to handle | | ---------- | ------------------- | --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | 30101 | Unauthorised Access | Authentication Failed: Unauthorized Access. | Contact Coda Distribution Support Team to check | | 40000 | Unauthorised Access | Authentication Failed: Please ensure the authorization header is included with a valid token. | Double-check authorization header | | 40001 | Unauthorised Access | Authentication Failed: Bearer token is missing or invalid. | Double-check bearer token | | 40002 | Unauthorised Access | Authentication Failed: Client ID is missing or invalid. | Double-check Client ID | | 40003 | Unauthorised Access | Authentication Failed: Your IP address is not allowed to access this resource. | Whitelist IP via Distributor Portal in Settings > Integration | | 40004 | Unauthorised Access | Authentication Failed: IAT is missing or expired. | Double-check IAT. IAT must be within 5 minutes from when the request is made | ## \*\*Invalid Request\*\* | Error Code | Error Name | Error Message | How to handle | | ---------- | --------------- | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | 30102 | Invalid Request | Order Not Found: The provided order ID does not exist. | Double check the params.requestId or params.orderId that you are sending | | 30114 | Invalid Request | Invalid Request: Method in payload not applicable to this product. | Double-check method parameter. Check API document for available API methods | | 30117 | Invalid Request | Transaction Denied: Your credit limit is not enough to process this request. | Please top-up to resume transactions | | 32602 | Invalid Request |

Invalid Request: Unknown Error


| Contact Coda Distribution Support Team to check | | 50000 | Invalid Request | Invalid Request: No order ID or request ID were found in the payload. | Double-check payload contents | | 50001 | Invalid Request | Invalid Request: No method is found in the payload. | Double-check payload contents | | 50002 | Invalid Request | Invalid Request: The request is invalid or improperly formatted. | Double-check payload contents. Refer to API document for sample format | ## \*\*Internal Error\*\* | Error Code | Error Name | Error Message | How to handle | | ---------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | | 30104 | Internal Error |

Internal Error(30104): The server encountered an internal error. Please try again, or reach out to support for assistance.


| Contact Coda Distribution Support Team to check | | 30112 | Internal Error | Internal Error(30112): The server encountered an internal error. Please try again, or reach out to support for assistance. | Contact Coda Distribution Support Team to check | | 32603 | Internal Error | Internal Error(32603): The server encountered an internal error. Please try again, or reach out to support for assistance. | Contact Coda Distribution Support Team to check | | 60001 | Internal Error | Internal Error(60001): The server encountered an internal error. Please try again, or reach out to support for assistance. | Contact Coda Distribution Support Team to check | | 60002 | Internal Error | Internal Error(60002): The server encountered an internal error. Please try again, or reach out to support for assistance. | Contact Coda Distribution Support Team to check | | 60003 | Internal Error | Internal Error(60003): The server encountered an internal error. Please try again, or reach out to support for assistance. | Contact Coda Distribution Support Team to check | | 60004 | Internal Error | Internal Error(60004): The server encountered an internal error. Please try again, or reach out to support for assistance. | Contact Coda Distribution Support Team to check | | 60005 | Internal Error | Internal Error(60005): The server encountered an internal error. Please try again, or reach out to support for assistance. | Contact Coda Distribution Support Team to check | | 60006 | Internal Error | Internal Error(60006): The server encountered an internal error. Please try again, or reach out to support for assistance. | Contact Coda Distribution Support Team to check | ## \*\*Product/SKU Error\*\* | Error Code | Error Name | Error Message | How to handle | | ---------- | -------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | 30106 | SKU Error | SKU Error: The specified SKU does not exist or is incorrect. | Double-check SKU ID and product endpoint that you are hitting. If error still exist, contact Coda Distribution Support Team to check | | 30110 | Quantity Error | Quantity Error: The quantity entered does not match the expected value. | Double-check quantity parameter. Must always be 1 | | 30113 | Price Error | Price Error: The price entered does not match the expected value. | Make sure you are fetching the latest price using listSku method. If error still persists, contact Coda Distribution Support Team to check | | 70000 | Product Error | Product Error: Invalid Product. | Contact Coda Distribution Support Team to check | ## \*\*User Account Error\*\* | Error Code | Error Name | Error Message | How to handle | | ---------- | -------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | 30107 | Invalid User Account | Invalid User Account. | Contact Coda Distribution Support Team to check | | 30108 | Invalid User Account | Invalid User Account: The user account is not recognized. Please confirm your account information. | Double-check account information of the user. If error still persists, contact Coda Distribution Support Team to check | | 30111 | Geolock Error | Invalid User Account: The user's game account country is not eligible for sku in this country. | Inform user to purchase the SKUs eligible for their account instead | | 80000 | Invalid User Account | Invalid User Account: The request payload is missing the 'userAccount' attribute. | Double-check userAccount parameter | | 80001 | Invalid User Account | Invalid User Account: The request payload is missing the 'roleId' attribute. | Double-check roleId parameter. | | 80002 | Invalid User Account | Invalid User Account: The request payload attribute, 'roleId', is invalid. | Double-check roleId parameter. Must be the same roleId returned from validate | | 80003 | Invalid User Account | Invalid User Account: The request payload attribute, 'userAccount', is invalid or improperly formatted for subtype 1. | Double-check userAccount parameter. Refer to API document for sample format | | 80004 | Invalid User Account | Invalid User Account: The request payload attribute, 'userAccount', is invalid or improperly formatted for subtype 2. | Double-check userAccount parameter. Refer to API document for sample format | | 80005 | Invalid User Account | Invalid User Account: The request payload attribute, 'userAccount', is invalid or improperly formatted for subtype 3. | Double-check userAccount parameter. Refer to API document for sample format | | 80006 | Invalid User Account | Invalid User Account: The request payload attribute, 'userAccount', is invalid or improperly formatted. | Double-check userAccount parameter. Refer to API document for sample format | | 80007 | Invalid User Account | Invalid User Account: The user account in the validate process does not match the one in the top-up process | Double-check userAccount parameter. | ## \*\*Miscellaneous Error\*\* | Error Code | Error Name | Error Message | How to handle | | ---------- | ------------------ | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | 30118 | Stacking Exception | Stack Limit exceeded (Only applicable for Tinder) | Contact Coda Distribution Support Team to check | | 30199 | Unknown Error | An unknown error will be returned if the system encounters any unexpected circumstances. | Contact Coda Distribution Support Team to check | | -207 | Too Many requests | The same userID is not allowed to make a purchase within 2 seconds | Make sure that requests from same userIDs are spaced for at least 2 seconds | --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references/direct-topup-purchase.md). # Direct-topup purchase The Top-up Interface is for placing orders to directly top-up a user account for product with type = \`topup\` As we are using JSON-RPC 2.0, The \`/{product-name}\` endpoint supports different kind of operations and differentiated through the \`method\` payload: 1. \[#product-name\](#product-name "mention") with \`"method" = "listServer"\`- Get server list selection (only for product with subtype = 2) 2. \[#product-name-1\](#product-name-1 "mention") with \`"method"="validate"\` - Validate userid and eligibility to buy skuid (step 1 of order flow). This will generate a new order with status = NEW and need to continue with topup to complete the order. 3. \[#product-name-2\](#product-name-2 "mention") with \`"method" = "topup"\` - Topup the userid after successful validate (step 2 of order flow). Your account will only be charged after topup is successful
## Get server list for product subtype = 2 > Server list for user to select and required to do validate and topup. Must submit method="listServer". \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"topup","description":"All endpoint available for product with type = topup"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"security":\[{"BearerAuth":\[\],"ApiKeyAuth":\[\]}\],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"requestBodies":{"listServer":{"description":"listServer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/listServerBody"}}}}},"schemas":{"listServerBody":{"allOf":\[{"$ref":"#/components/schemas/interface"},{"type":"object","required":\["method","params"\],"properties":{"method":{"type":"string"},"params":{"type":"object","required":\["iat"\],"properties":{"iat":{"type":"integer","description":"The \\"iat\\" (issued at) field indicates the token's issuance time, which must be a UNIX EPOCH timestamp in UTC and within 5 minutes of the request time.","format":"int64"}}}}}\]},"interface":{"type":"object","required":\["jsonrpc","id"\],"properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique ID generated by the client"}}},"listServerResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string"},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Id of the server which must be passed as input to validate and topup request for title that has server selection by customer"},"name":{"type":"string","description":"Name of the server which must be passed as input to validate and topup request for title that has server selection by customer"},"area":{"type":"string","description":"Optional. Only available for Be the king product, where there must be two dropdown, once user selects area, then we must filter by area and ask the user to select servername"},"platform":{"type":"string","description":"Optional. Only available for Heroes evolved product, where there must be two dropdown, once user selects Platform (IOS, android etc), then we must filter by Platform and ask the user to select the servername"}}}}}}}},"paths":{"/{product-name}":{"post":{"tags":\["topup"\],"summary":"Get server list for product subtype = 2","description":"Server list for user to select and required to do validate and topup. Must submit method=\\"listServer\\".","operationId":"listServer","parameters":\[{"name":"x-api\_key","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"product-name","in":"path","description":"Name of the product to purchase","required":true,"schema":{"type":"string"}}\],"requestBody":{"$ref":"#/components/requestBodies/listServer"},"responses":{"200":{"description":"successful requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/listServerResponse"}}}}}}}}} \`\`\` ## Validate - first step to place order for a topup product > Validate the userid and eligibility to buy the skuid, required step before placing "topup" request. Must submit method="validate" in the payload. \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"topup","description":"All endpoint available for product with type = topup"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"paths":{"/{product-name}":{"post":{"tags":\["topup"\],"summary":"Validate - first step to place order for a topup product","description":"Validate the userid and eligibility to buy the skuid, required step before placing \\"topup\\" request. Must submit method=\\"validate\\" in the payload.","operationId":"validate","parameters":\[{"name":"product-name","in":"path","description":"Name of the product to purchase","required":true,"schema":{"type":"string"}}\],"requestBody":{"$ref":"#/components/requestBodies/validate"},"responses":{"200":{"description":"successful request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/validateResponse"}}}}}}}},"components":{"requestBodies":{"validate":{"description":"validate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/validate"}}}}},"schemas":{"validate":{"allOf":\[{"$ref":"#/components/schemas/interface"},{"type":"object","required":\["method","params"\],"properties":{"method":{"type":"string","description":"must be 'validate'"},"params":{"type":"object","required":\["iat","customerId","userAccount","items"\],"properties":{"iat":{"type":"integer","description":"The \\"iat\\" (issued at) field indicates the token's issuance time, which must be a UNIX EPOCH timestamp in UTC and within 5 minutes of the request time..","format":"int64"},"customerId":{"type":"string","description":"Unique customer account identifier in client’s system. You can send customer email or their internal customer unique identifier in their system."},"items":{"type":"array","description":"Currently only support one array of item.","items":{"type":"object","required":\["sku","quantity","price"\],"properties":{"sku":{"type":"string","description":"SKU ID from list SKU"},"quantity":{"type":"integer","description":"Currently only support one quantity"},"price":{"type":"object","description":"Must match the price returned from listSKU. Will be used to do price validation, will return invalid SKU if price does not match.","required":\["currency","amount"\],"properties":{"currency":{"type":"string","description":"Currency from listSKU. This will be what is charged to your account"},"amount":{"type":"number","description":"Amount from listSKU. This will be what is charged to your account"}}}}}},"userAccount":{"description":"The userAccount is either string or Object based on subtype we get the listProduct API","oneOf":\[{"$ref":"#/components/schemas/accountSubtypeOne"},{"$ref":"#/components/schemas/accountSubtypeTwo"},{"$ref":"#/components/schemas/accountSubtypeThree"}\]}}}}}\]},"interface":{"type":"object","required":\["jsonrpc","id"\],"properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique request ID generated by the partner. Same ID should be used in subsequent API method=topup call."}}},"accountSubtypeOne":{"type":"string"},"accountSubtypeTwo":{"type":"object","properties":{"userId":{"type":"string"},"server":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}},"accountSubtypeThree":{"type":"object","properties":{"userId":{"type":"string"},"zoneId":{"type":"string"}}},"validateResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique request ID from the partner"},"result":{"type":"object","properties":{"orderId":{"type":"string"},"message":{"type":"object","properties":{"username":{"type":"string","description":"In-game UserName of the entered userAccount details, which must be shown to the end user before doing payment/topup. Note: We encourage you to decode the username from the validate response, as game usernames may be including special characters.For example: username:%e6%99%9a%e5%ae%89%e6%98%8e%e6%97%a5%e9%a6%99 Decodes to :晚安明日香. If userName don’t exist in the Validate response, userId can be used for showing up userName"},"userAccount":{"description":"The userAccount is either string or Object based on subtype we get the listProduct API","oneOf":\[{"$ref":"#/components/schemas/accountSubtypeOne"},{"$ref":"#/components/schemas/accountSubtypeTwo"},{"$ref":"#/components/schemas/accountSubtypeThree"}\]},"sku":{"type":"object","properties":{"description":{"type":"string"}}},"roles":{"type":"array","description":"Only for product with haveRole = True. Role selection is required from the user after validate step and roleId must be submitted during \\"topup\\" request.","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}}}}}}}}}} \`\`\` \*\*User Account format for Validate Requests based on the product subtype\*\* {% tabs %} {% tab title="subtype = 1" %} Example: EA FC Mobile \`\`\`json "userAccount": "371507836" \`\`\` {% endtab %} {% tab title="subtype = 2" %} Example: Honkai Star Rail, Genshin Impact \`\`\`json "userAccount": { "userId": "4294967319", "server": { "id": "90001", "name": "Eternal Love" } \`\`\` {% endtab %} {% tab title="subtype = 3" %} Example: Mobile Legends: Bang Bang, Valorant \`\`\`json "userAccount": { "userId": "4294967319", "zoneId":"771" } \`\`\` {% endtab %} {% endtabs %} \*\*Validate Response Sample based on haveRole\*\* {% tabs %} {% tab title="haveRole=FALSE" %} \`\`\`json { "jsonrpc": "2.0", "id": "ID-TEST-1655871292", "result": { "message": { "username": "my game account username", "userAccount": { "userId": "4294967319", "server": { "id": "90001", "name": "Eternal Love" } }, }, "sku": { "description": "11 Diamonds" }, "orderId": "1c6cda00-375c-476e-8e1f-6b59ec958632" } } \`\`\` {% endtab %} {% tab title="haveRole=TRUE" %} \`\`\`json { "jsonrpc": "2.0", "id": "ID-TEST-1655871292", "result": { "message": { "username": "my game account username", "userAccount": { "userId": "13482", "server": { "id": "1493310771", "name": "HKT-SERVER" } }, "roles": \[\ {\ "id": "13482",\ "name": "Role A"\ },\ {\ "id": "13484",\ "name": "Role B"\ }\ \] }, "sku": { "description": "11 Diamonds" }, "orderId": "1c6cda00-375c-476e-8e1f-6b59ec958632" } } \`\`\` {% endtab %} {% endtabs %} ## Topup - Final step to place order for a topup product > Topup the userid based on successful validate orderid. Must submit method="topup" in the payload \`\`\`json {"openapi":"3.0.3","info":{"title":"xShop API","version":"2.0.0"},"tags":\[{"name":"topup","description":"All endpoint available for product with type = topup"}\],"servers":\[{"url":"https://xshop.codashop.com/v2","description":"Production server"},{"url":"https://xshop-sandbox.codashop.com/v2","description":"Sandbox server"}\],"paths":{"/{product-name}":{"post":{"tags":\["topup"\],"summary":"Topup - Final step to place order for a topup product","description":"Topup the userid based on successful validate orderid. Must submit method=\\"topup\\" in the payload","operationId":"topUp","parameters":\[{"name":"product-name","in":"path","description":"Name of the product to purchase","required":true,"schema":{"type":"string"}}\],"requestBody":{"$ref":"#/components/requestBodies/topup"},"responses":{"200":{"description":"successful requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/topupResponse"}}}}}}}},"components":{"requestBodies":{"topup":{"description":"topup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/topupBody"}}}}},"schemas":{"topupBody":{"allOf":\[{"$ref":"#/components/schemas/interface"},{"type":"object","required":\["method","params"\],"properties":{"method":{"type":"string","description":"must be 'topup'."},"usingValidateIdForTopup":{"type":"boolean","description":"if using the same Id when submitting validate and topup request, this will speed up the response time"},"params":{"type":"object","required":\["iat","orderId","customerId","userAccount","items"\],"properties":{"iat":{"type":"integer","description":"The \\"iat\\" (issued at) field indicates the token's issuance time, which must be a UNIX EPOCH timestamp in UTC and within 5 minutes of the request time..","format":"int64"},"orderId":{"type":"string","description":"OrderID that is generated from success validate step."},"customerId":{"type":"string","description":"Unique customer account identifier in client’s system. They can send customer email or their internal customer unique identifier in their system."},"items":{"type":"array","description":"Currently only support one array of item.","items":{"type":"object","required":\["sku","quantity","price"\],"properties":{"sku":{"type":"string","description":"SKU ID from list SKU"},"quantity":{"type":"integer","description":"Currently only support one quantity"},"price":{"type":"object","description":"Must match the price returned from listSKU. Will be used to do price validation, will return invalid SKU if price does not match.","required":\["currency","amount"\],"properties":{"currency":{"type":"string","description":"Currency from listSKU. This will be what is charged to your account"},"amount":{"type":"number","description":"Amount from listSKU. This will be what is charged to your account"}}}}}},"userAccount":{"oneOf":\[{"$ref":"#/components/schemas/accountSubtypeOne"},{"$ref":"#/components/schemas/accountSubtypeTwo"},{"$ref":"#/components/schemas/accountSubtypeThree"}\]}}}}}\]},"interface":{"type":"object","required":\["jsonrpc","id"\],"properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique request ID generated by the partner. Same ID should be used in previous API method=validate call"}}},"accountSubtypeOne":{"type":"string"},"accountSubtypeTwo":{"type":"object","properties":{"userId":{"type":"string"},"server":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}},"accountSubtypeThree":{"type":"object","properties":{"userId":{"type":"string"},"zoneId":{"type":"string"}}},"topupResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","description":"Constant jsonrpc version 2.0"},"id":{"type":"string","description":"Unique request ID from the client"},"result":{"type":"object","properties":{"status":{"type":"string","enum":\["FULFILLED","FAILED"\]},"orderId":{"type":"string"}}}}}}}} \`\`\` \*\*User Account format for topup requests based on the product subtype\*\* {% tabs %} {% tab title="subtype = 1" %} \`haveRole=FALSE\` \`\`\`json "userAccount": "4294967319" \`\`\` \`haveRole=TRUE\` \`\`\`json "userAccount": { "userId": "4294967319", "roleId": "1234" } \`\`\` {% endtab %} {% tab title="subtype = 2" %} \`haveRole=FALSE\` \`\`\`json "userAccount": { "userId": "4294967319", "server": { "id": "90001", "name": "Eternal Love" } } \`\`\` \`haveRole=TRUE\` \`\`\`json "userAccount": { "userId": "4294967319", "server": { "id": "90001", "name": "Eternal Love" }, "roleId": "1234" } \`\`\` {% endtab %} {% tab title="subtype = 3" %} \`haveRole=FALSE\` \`\`\`json "userAccount": { "userId": "4294967319", "zoneId":"771" } \`\`\` \`haveRole=TRUE\` \`\`\`json "userAccount": { "userId": "4294967319", "zoneId":"771", "roleId": "1234" } \`\`\` {% endtab %} {% endtabs %} --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/transaction-reports.md). # Transaction reports You can access and download your historical transactions from the distributor portal under the Transactions tab. For direct-topup orders initiated after a 'validate' request, they remain valid for 7 days. During this period, partners can continue to make top-up requests. After 7 days, any orders without a top-up request will be automatically cancelled and marked as Failed. Orders that have failed the 'validate' request will not appear in the transaction history. We offer several filters to enhance your search: \* \*\*Country\*\*: Source country of the SKU for the order. \* \*\*Product\*\*: Name of the game or product. \* \*\*Timezone\*\*: Display configuration of dates in the order table. \* \*\*OrderID\*\*: Unique identifier for the order. \* \*\*Bulk Txn ID\*\*: Transaction ID from bulk purchases made via the distributor portal. \* \*\*Request ID\*\*: Partner ID sent from the API request. \* \*\*Status\*\*: \* \*\*New\*\*: Direct top-up order validated but not yet top-up requested. \* \*\*Fulfilled\*\*: Direct top-up order with a top-up request. All voucher orders are marked with this status. \* \*\*Failed\*\*: Direct top-up order that has failed after 7 days without a top-up request. {% hint style="info" %} Our reports default to displaying timezone in UTC. You can adjust the timezone display in the expanded filter options within the order history. {% endhint %} !\[\](/files/TrlSDlFEnADhaRsMzNDS) ### --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/deciding-which-balance-to-use.md). # Deciding which balance to use We support two options for you to manage your balance in buying product from us 1. \*\*USD Pricing and deduct USD wallet:\*\* \* We convert local currency SKU pricing to USD daily, and we will deduct your USD balance to process your order \* Our FX rates are refreshed at 12:30AM UTC. Ensure you fetch the updated prices post-refresh to avoid transaction failures due to price validation checks. \* We source our FX rates from \[xignite\](https://www.xignite.com/faqs/cryptocurrency-and-fx-rates/where-does-the-xignite-fx-rates-data-come-from/) and add a spread to manage the day-to-day fluctuation (spread may be different from country-to-country). 2. \*\*Local Currency (LCY) Pricing and deduct LCY credit balance:\*\* \* You can send payment directly according to the LCY and we will topup your LCY wallet \* We also support \[wallet conversion feature\](/coda-distribution-technical-documentation/distributor-portal/managing-prepaid-balance/transferring-balance-across-wallet-currency.md) if you can't send payment in local currency to help you manage your balance and funds with us \* By default, our pricing will be in USD, and if you want to proceed with this option, please raise request to our support team or your account manager so we can --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/distributor-portal/purchasing-direct-top-up-and-voucher-codes.md). # Purchasing direct top-up and voucher codes In addition to using the API, you can purchase vouchers or top-ups directly from the distributor portal under the Top-Up menu When making transactions, if you are on a prepayment, we will deduct the balance according to the transaction amount and currency. For purchasing voucher codes, you can bulk purchase up to 20,000 codes per transaction. The codes will be delivered to the requester via email. Note some codes may not support bulk purchase as it's dependent on the supplier of the codes {% hint style="info" %} This feature is only applicable to partner under prepayment settlement flow. {% endhint %} !\[\](/files/3ref83LJ329uECzAUBfN) !\[\](/files/wxYwAAEhLqhfXyIm8g0y) ### --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://coda-payments.gitbook.io/coda-distribution-technical-documentation/api-references.md). # API References Our API can be accessed using using the following hostname: \* Production: \`https://xshop.codashop.com/v2/\` \* Sandbox: \`https://xshop-sandbox.codashop.com/v2/\` {% hint style="info" %} Our API is based on JSON-RPC standard () {% endhint %} Below is complete list of our API
Request header & Authentication
Product and SKU catalogue
Direct topup purchase
Voucher purchase
Get order details
Get prepayment balance
Error codes
---