Validation Request Example & Responses

Format: JSON-RPC

// {
  "id": "6164695159717629913",
  "jsonrpc": "2.0",
  "method": "validate",
  "params": [
    {
      "isForTest": 1,
      "price": {
        "amount": "50000",
        "currency": "IDR"
      },
      "serviceProvider": "Coda",
      "quantity": 1,
      "paymentChannelId": 227,
      "sku": "Diamonds_10",
      "purchaseOrigin": "TH",
      "user": {
        "userId": "111111",
        "zoneId": "101"
      },
      "signature": "4646fbd3363ab452f40187f8744cd321f71968ed01cdc19c416203832cddd76e",
      "txnId": "6164695159717629913",
      "orderId": "6164695159719894644"
    }
  ]
}

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

// 
{
  "id": "6164695159717629913",
  "jsonrpc": "2.0",
  "result": {
    "merchantTransactionId": "816176257914769",
    "username": "Test User",
    "accountRegionCode": "SG"
  }
}

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.

// 
{
  "id": "6164695159717629913",
  "jsonrpc": "2.0",
  "result": {
    "roleList": [
      {
        "roleName": "roleA",
        "roleId": "111"
      },
      {
        "roleName": "roleB",
        "roleId": "222"
      },
      {
        "roleName": "roleC",
        "roleId": "333"
      }
    ],
    "merchantTransactionId": "816176257914769",
    "accountRegionCode": "SG"
  }
}

Invalid Validation Response

Format: JSON-RPC

// 
{
    "id": "6164695159717629913",
    "jsonrpc": "2.0",
    "error": {
        "code": -100,
        "message": "Invalid user ID"
    }
}

Last updated