Voucher (Cash Card)

The voucher payment method allows customers to redeem their voucher codes via Codapay at the Partner's website. Codapay registers completed payments in real-time, and partners are notified immediately. See Voucher details in the Profile fields in the request table for more details.

For voucher transactions, the voucher's value is confirmed only after it has been redeemed; Partners need to validate the net amount returned in Coda's API response and be able to handle the redemption of all available denominations.

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

Cash Card Channel use pay_type=4

Yes

pay_channel

3

Code for each payment channel

Yes

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

Item

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

voucher_code

20

Voucher Code.

Yes

voucher_pin

20

Voucher PIN.

Yes

card_type

N/A

Default use "card_type":"0".

Sample of Request

{
    "api_key":"<YOUR API KEY>",
    "order_id":"<Your Order ID)",
    "lang":"en",
    "merchant_name":"ebooks",
    "pay_type":"4",
    "pay_channel":"340",
    "type":"1",
    "profile":{
        "voucher_code":"12345678901231",
        "voucher_pin":"",
        "card_type":"0",
        "user_id":"12345"
    }
}

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.

total_price

N/A

Net payment amount.

Non-formatted numeric value.

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

txn_timeout

N/A

Transaction Timeout in Minutes.

pay_instructions

15

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

profile

N/A

user_id

Sample of Response

{
   "txn_id": <Coda Transaction ID>,
   "txn_timeout": 0,
   "result_code": 0,
   "total_price": 150,
   "profile":{"user_id":"12345"}
}

Reference of USD Transactions

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

Last updated