Validation Request Example & Responses
Format: JSON-RPC
Parameter | Type | Description |
---|---|---|
id | String | A unique ID identifying the API call. |
jsonrpc | String | Fixed to “2.0” by json-rpc standard. |
method | String | Fixed to “validate”. |
params.serviceProvider | String | Payment service provider name, default value is “Coda”, but partner can decide the value. |
params.isForTest | Integer | A flag to indicate whether this order is for sandbox test or real order. If isForTest=1, this order is a sandbox test order; otherwise if isForTest=0, this order is a real order. |
params.signature | String | Generated based on the content of the message. See section on Signature Generation. |
params.user.userId | String | The user ID/player ID of the customer account in the publisher’s system. |
params.user.zoneId | String | The zone ID/server ID of the customer account in the publisher’s system. If zoneId is not required, the default value is “”. |
params.price.currency | String | An ISO 4217 currency code. |
params.price.amount | String | Representing the amount paid by the customer, in the currency defined in params.price.currency. |
params.sku | String | A product ID representing the item being purchased, e.g. “Diamonds_123”. |
params.purchaseOrigin | String | Note: purchaseOrigin is a 2 country code ISO standard. This will be the region where the user of codashop did the purchase from. https://www.iban.com/country-codes |
params.quantity | Integer | Number of the SKU to be purchased, typically 1. |
params.paymentChannelId | Integer | Payment channel id, please check section 6. |
params.txnId | String | Representing the payment transaction ID. |
params.orderId | String | Representing the Codashop order ID. |
Codashop Validation Request Responses
The Codashop Validation Response describes the response to a validation request by the partner. See below for examples of Valid and Invalid Validation responses.
Valid Validation Response
Example 1 Format: JSON-RPC
Example 2 If there are multiple roles or sub-accounts under each account, and the user needs to choose which one to top up, the option should be shared as a roleList. Only roles that can be topped up should be included. Coda will present these options to the user before proceeding to payment.
Parameter | Description |
---|---|
id | The id of the message this response is associated with. |
jsonrpc | Fixed to “2.0” by json-rpc standard. |
result | An Object representing success. |
result.username | Player username, nickname, or other identifier that can be used to let the customer confirm they are topping up the intended account. For example, a unique player id may be “123456789”, and their username (not necessarily unique) may be “Terminator123”. |
result.roleList | Listing all roles or sub-accounts under the user’s account, if applicable. |
result.roleList.roleName | Role name. |
result.roleList.roleId | Role ID. |
result.merchantTransactionId | (Optional) Unique OrderID generated by the publisher side. |
result.accountRegionCode | Note: accountRegionCode must be returned in a 2 country code ISO standard. This will be the account Region name where the userId got created. Egs: TH for thailand, SG for Singapore https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes |
Invalid Validation Response
Format: JSON-RPC
Parameter | Description |
---|---|
id | The ID of the message this response is associated with. |
jsonrpc | Fixed to “2.0” by json-rpc standard. |
error.code | A code representing the error. |
error.message | A message explaining the error. |
Last updated