API Data Structures

Contents:

Data Format Conventions

This table lists the types and format of data utilised by OKPAY API.

Data Type Format Examples
Account ID Unique OKPAY Account ID. String containing only numbers (xxxxxxxx) up to 9 digits long. "123456789", "987654321", etc.
Wallet ID Unique OKPAY Wallet ID. String starting with OK followed by 9 digits (OKxxxxxxxxx). "OK123456789", "OK987654321", etc.
Amount


The currency amount field has the following structure:

  • The amount must have two decimal places.
  • The decimal separator must be a period (".").
  • You must not use the thousands separator.
1.26, 456.78, etc.
Timestamp String String containing date and time in the following format "dd-MM-yyyy HH:mm". "22-02-2017 10:33", "30-06-2016 01:42", etc.
Transaction ID Very long number (64-bit integer). 1234567890, 9994456683762355345868, etc.
Currency 3-character code of a currency supported by OKPAY.

"USD", "EUR", etc.

Country 2-character code of a country. "US", "DE", "CA", etc.

Structures

Result Structure

A JSON response structure returned with every API function call containing the isSuccess, result and errorMessage fields.

Field Type Description Example
isSuccess Boolean
Determines whether the API function call was processed successfully. true, false.
Result Object Displays a function specific reply or a null value in case of any errors. function specific reply.
errorMessages String Determines whether the API function call was processed successfully. null, one of the error codes.

Balance Structure

Balance Information.

Field Type Description Example
Currency Currency String One of the currencies supported by OKPAY.

"USD", "EUR", etc.

Amount Amount Decimal Amount must have two decimal places. 1.26, 456.78, etc.

AccountInfo Structure

Account details.

Field Type Description Example
WalletID Wallet ID
String
Client's Wallet ID. "OK123456789", "OK987654321"
Email String Email address. "user@okpay.com"
Name String Client's name. "John Doe"
AccountID Account ID
Long Integer
Client's Account ID. 123456789, 987654321
Country_ISO Country
String
2-character code of client's country. "FR", "DE", "CN", etc.
VerificationStatus VerificationStatuses Value Client verification status. Verified, Unverified, etc.

TxnInfo Structure

Transaction details.

Field Type Description Example
ID TransactionID Long Integer Merchant's original transaction identification number. 1401265, 1802587, etc.
Date Timestamp String Transaction date and time. "21-02-2017 10:22"
OperationName String Operation name. "Money sent"
Status TxnStatuses Value Transaction status. Completed, Pending, etc.
Net Amount Decimal Net amount. Amount + Fees. 1.26, 456.78, etc.
Amount Amount Decimal Transaction amount. 1.26, 456.78, etc.
Fees Amount Decimal Transaction fees. 1.26, -2.78, etc.
Currency Currency String One of the currencies supported by OKPAY.

"USD", "EUR", etc.

Comment String Comment accompanying transaction. "Some comment for payment"
Sender AccountInfo Structure Transaction sender details. -
Receiver AccountInfo Structure Transaction recepient details. -
Invoice String Variable that can be used to identify your invoice number for this payment. Up to 127 characters. Empty string is returned if not used. "ID345X24"

HistoryInfo Structure

Transaction history details

Field Type Description Example
PageSize Integer Number of returned transactions per page. Max value - 50. 50, 20
PageNumber Integer Number of returned page. 1, 2
PageCount Integer Number of transactions on current page. 50, 20
TotalCount Integer Number of all transactions. 100, 200
Transactions List of TxnInfo Structures List of transactions for current page. -

Enumerable Types

TxnStatuses

Contains description of the operation status.

Value Description
None Operation status is not set yet.
Error An error occurred.
Canceled Operation is canceled.
Pending Operation is not finished yet.
Reversed Operation is reversed.
Hold Operation is held.
Completed Operation is successful.

VerificationStatuses Enum

Contains verification statuses description.

Value Description
Unverified Unverified account.
Formal Verified. Electronic photocopies of documents received.
Verified Verified. Notarized copies of documents received.
OKPAY RSS
OKPAY Forum
OKPAY on Facebook
OKPAY on Livejournal
OKPAY on Twitter
OKPAY on VK
OKPAY on Linkedin
OKPAY on Youtube