Card Payments

Customers can pay for their orders using a debit or credit card. The method of authorization varies based on the payment channel, such as directly inputting card information on the Coda payment page with 3DS authentication or being redirected to the channel provider's page.

Request Message

ParametersLengthDescriptionMandatory

api_key

256

Secret key assigned by Coda (Unique to each country).

Yes

order_id

64

Merchant-assigned unique transaction identifier.

Yes

lang

2

2-character language code. Language Table

Yes

pay_type

1

Card Payment use pay_type=6.

Yes

pay_channel

3

Code for each payment channel.

Yes

email

128

Only include this if email is required and not MSISDN.

merchant_name

128

If the partner wants to specify the partner's name, please enter the name in this field.

The default value is empty.

type

1

1: digital content,

2: non-digital content

Yes

items

N/A

ItemInfo array

See Item Info table below for more details.

Yes

profile

N/A

Other details.

See Other details in Profile field below for more details.

Yes

Item Info

Item represents a SKU

Code and Name should be unique and univocally represent the item. The name needs to be user-friendly, as it shows to end-users in the payment window.

ParametersLengthDescriptionMandatory

Code

128

Partner-managed item code.

Yes

Name

128

The name of the purchased item or topup, e.g. “50 diamonds”.

If purchases can be made for multiple games or services, include also the name of that, e.g. “Hero's Glory - 200 gold”.

Yes

Price

N/A

Non-formatted numeric value.

For Indonesia, Chile, South Korea, Taiwan, and Vietnam currency, decimals are not supported.

Yes

Type

N/A

Default=1.

Yes

Other Details In Profile Field

ParametersLengthDescriptionMandatory

user_id

128

Customer's user ID.

Yes

client_ip

15

Customer IP Address.

user_agent

512

Customer's user agent data (details of browser and operating system).

name

256

Customer Full Name.

No, except for Bharain Benefit card payments.

Sample Of Request

{
  "api_key": "<Your APIKey>",
  "order_id": "<Your Order ID>",
  "lang": "en",
  "merchant_name": "Koko eBooks",
  "type": "1",
  "pay_type": "6",
  "pay_channel": "-14",
  "email": "test@codapayments.com",
  "items": [
    {
      "code": "9",
      "name": "Killing",
      "price": 150
    }
  ],
  "profile": {
    "user_id": "Testuser397"
  }
}

Response Message

ParametersLengthDescription

result_code

N/A

Success or Error code. Success = 0. Common Error Codes

result_desc

512

If the resultCode is an error, this value describes the error. Common Error Codes

txn_id

N/A

Unique payment transaction identifier.

txn_timeout

N/A

Transaction Timeout in Minutes.

total_price

N/A

Net payment amount.

Non-formatted numeric value.

For Indonesia, Chile, South Korea, Taiwan, and Vietnam currency, decimals are not supported.

pay_instructions

15

If this value is populated, partner should display the instructions provided on screen to the customer.

profile

N/A

Other details

See Other details in Profile field below for more details

Other Details In Profile Field

ParametersLengthDescription

redirect_url

128

Return payment gateway's redirect URL.

Please be aware this response only available if the payment channel has a redirect URL workflow.

merchantType

128

Please ignore this field.

user_id

128

Customer's user ID.

payment_code

N/A

A code generated by payment channel.

Sample of Response

{
    "txn_id": <Coda Transaction ID>,
    "txn_timeout": 26,
    "result_code": 0,
    "total_price": 150.0,
    "pay_instructions": "",
    "profile": {
        "user_id": "Testuser397",
        "merchantType": "Codapay",
        "redirect_url": "sample_URL.com",
        "payment_code": ""
    }
}

Reference of USD Transactions

Please check out this guide to learn more about USD transactions.

Last updated