For the complete documentation index, see llms.txt. This page is also available as Markdown.

Top-Up API Request Example & Responses

Example Format: JSON-RPC

// 
{
  "id": "6164699909785264260",
  "jsonrpc": "2.0",
  "method": "topup",
  "params": [
    {
      "isForTest": 1,
      "price": {
        "amount": "50000",
        "currency": "IDR"
      },
      "serviceProvider": "Coda",
      "quantity": 1,
      "paymentChannelId": 227,
      "sku": "Diamonds_10",
      "purchaseOrigin": "TH",
      "user": {
        "userId": "111111",
        "zoneId": "101",
        "roleId": "111"
      },
      "signature": "73d173363f6706d59c35bcea785f543488389b68d582a9b2339e9450db177695",
      "txnId": "6164699909785264260",
      "orderId": "6164699909782101750",
      "merchantTransactionId": "816176257914769"
    }
  ]
}
Parameter
Type
Description

id

String

A per-method unique string (the ID can be repeated in calls for different methods).

jsonrpc

String

Fixed to “2.0” by json-rpc standard.

method

String

Fixed to “topup”.

params.serviceProvider

String

Payment service provider name, default value is “Coda”, but partners can decide the value.

params.isForTest

Integer

1 for sandbox test order; 0 for production orders.

params.signature

String

A generated string with the content of the message.

params.user.userId

String

The user ID/player ID of the customer account in the partner'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.user.roleId

String

Optional. The role ID/character ID of this user account.

If the Validate API response includes roleList, it is required.

params.price.currency

String

Currency code of the purchase amount (ISO 4217)

params.price.amount

String

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 7 below for values.

params.txnId

String

Payment transaction identifier

params.orderId

String

Codashop order identifier

params.merchantTransactionId

String

Optional. publisher’s order ID in validate response

Top-up Request Responses

The Codashop Top-up Request Response describes the response to a top-up request by the publisher. See below for examples of Valid and Invalid Top-up responses.

Valid Top-up Transaction 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

result

An Object representing success.

Invalid Top-up Transaction Response

The response returned when a top-up failed.

While failures in the validation process are expected, a failure in this method is an unexpected event, as all parameters of the top-up should already have been validated.

Example 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 cause.

error.message

A message explaining the error condition.

Last updated

Was this helpful?