> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/codapay/direct-api-integration/direct-api-integration-for-alternative-payment-methods/backend-call-flow/e-wallet.md).

# E-Wallet

## E-wallet Call Flow

<figure><img src="/files/9wF6qPG2IGSZwfrLqImJ" alt=""><figcaption></figcaption></figure>

For Wallet payments, partners will receive a redirect link for the customer to complete their transaction. This link may either be a deep link that directly opens the wallet app or a redirection page where the customer provides additional details and authorizes the payment.

## Request Message

<table><thead><tr><th width="148">Parameters</th><th width="95">Type</th><th width="116">Length</th><th>Description</th></tr></thead><tbody><tr><td>api_key</td><td>String</td><td>256</td><td><strong>Mandatory</strong><br>API key provided by Coda. Refer to <a data-mention href="/pages/SJ2KtFdcmUYgMDiplZT1">/pages/SJ2KtFdcmUYgMDiplZT1</a> to find out how to get it.</td></tr><tr><td>project_id</td><td>String</td><td>10</td><td><p>*<strong>This field is only needed for v2.0 API</strong></p><p><strong>Mandatory</strong> </p><p>Project ID provided by Coda, unique for each title product. Refer to <a data-mention href="/pages/SJ2KtFdcmUYgMDiplZT1">/pages/SJ2KtFdcmUYgMDiplZT1</a> to find out how to get it.</p></td></tr><tr><td>order_id</td><td>String</td><td>64</td><td><p><strong>Mandatory</strong> </p><p>Your unique identifier for the transaction</p></td></tr><tr><td>country</td><td>Number</td><td>N/A</td><td><strong>Mandatory</strong><br>ISO 3166 based country code. Can refer to <a data-mention href="/pages/7B3qZnefeSwkSs84sKuB">/pages/7B3qZnefeSwkSs84sKuB</a></td></tr><tr><td>lang</td><td>String</td><td>2</td><td><p><strong>Mandatory</strong></p><p>2-character language code. See <a data-mention href="/pages/lumiE4ZV7er3NqdusLTc">/pages/lumiE4ZV7er3NqdusLTc</a>for options.</p></td></tr><tr><td>type</td><td>Number</td><td>1</td><td>1: Digital content,<br>2: Non-digital content</td></tr><tr><td>pay_type</td><td>Number</td><td>1</td><td><p><strong>Mandatory</strong></p><p>E-wallet use pay_type = 5</p><p></p><p>Refer <a data-mention href="/pages/H5smNhrW5H8UuJgvQJ6Y">/pages/H5smNhrW5H8UuJgvQJ6Y</a> for more details</p></td></tr><tr><td>pay_channel</td><td>Number</td><td>3</td><td><strong>Mandatory</strong><br>Code for each payment channel.</td></tr><tr><td>pay_at</td><td>Number</td><td>2</td><td><p>This field refers to where the customer should complete their purchase.</p><p></p><p>1 = Bank Counter</p><p>2 = Internet Banking</p><p>3 = Online Bill Payment</p><p>4 = E-wallet</p><p>5 = ATM</p><p>14 = Convenience Store</p></td></tr><tr><td>msisdn</td><td>Number</td><td>15</td><td><p><strong>Optional</strong></p><p>MSISDN (non-formatted; without country code).<br><br>Only include this if MSISDN is required and not email.</p></td></tr><tr><td>email</td><td>String</td><td>128</td><td><p><strong>Optional</strong></p><p>Only include this if email is required and not MSISDN.</p></td></tr><tr><td>merchant_name</td><td>String</td><td>128</td><td><p><strong>Optional</strong></p><p>If the partner wants to specify the partner's name, please enter the name in this field.<br></p><p>The default value is empty.</p></td></tr><tr><td>type</td><td>Number</td><td>1</td><td><p>Mandatory<br>1: digital content</p><p>2: non-digital content</p></td></tr><tr><td>items</td><td>ItemInfo</td><td>N/A</td><td><p><strong>Mandatory</strong></p><p>List of items being purchased by the users</p></td></tr><tr><td>items[].code</td><td>String</td><td>128</td><td><p><strong>Mandatory</strong></p><p>Code associated with the item on your side</p></td></tr><tr><td>items[].name</td><td>String</td><td>128</td><td><strong>Mandatory</strong> Name of the item being purchased. Only supports latin characters.</td></tr><tr><td>items[].price</td><td>Number</td><td>N/A</td><td><strong>Mandatory</strong><br>Price of the item inclusive of any taxes in the currency specified in the request.</td></tr><tr><td>profile</td><td>Map</td><td>N/A</td><td><strong>Mandatory</strong><br>Refer Profile Info below for more details</td></tr></tbody></table>

## Profile Info

<table data-full-width="false"><thead><tr><th width="188">Parameters</th><th width="109">Type</th><th width="88.33333333333331">Length</th><th>Description</th></tr></thead><tbody><tr><td>user_id</td><td>String</td><td>128</td><td><p><strong>Mandatory</strong></p><p>Customer's user ID.</p></td></tr><tr><td>client_ip</td><td>String</td><td>15</td><td><p><strong>Optional</strong></p><p>Customer IP Address. (only support IPv4)</p></td></tr><tr><td>user_agent</td><td>String</td><td>512</td><td><p><strong>Optional</strong></p><p>Customer's user agent data (details of browser and operating system).</p></td></tr><tr><td>name</td><td>String</td><td>256</td><td><p><strong>Optional</strong></p><p>Customer's Full Name.</p></td></tr><tr><td>id_no</td><td>Number</td><td>14</td><td><p><strong>Optional</strong></p><p>The Brazilian/Mexican/Argentinian Identification Document is called the CPF.</p></td></tr><tr><td>document_type</td><td>String</td><td>N/A</td><td><p><strong>Optional</strong></p><p>Customer Document.<br></p><p>a. Cédula de ciudadanía (Citizenship ID card).</p><p>b. Tarjeta de identidad del menor de edad (Minor's ID card).</p><p>C. Cédula de extranjería (Foreigner ID card).</p></td></tr><tr><td>document_number</td><td>Number</td><td>N/A</td><td><p><strong>Optional</strong></p><p>CC - Cédula de ciudadanía.<br></p><p>TI - Tarjeta de identidad del menor de edad.<br></p><p>CE - Cédula de extranjería.</p></td></tr><tr><td>email</td><td>String</td><td></td><td><p><strong>Optional</strong></p><p>The email address where the successful transaction receipt will be sent. Upon a successful payment, Coda will automatically deliver a digital receipt to this address. <em>This feature is not enabled by default. To activate automated receipt delivery for your titles, please contact the payment enablement team at</em> <a href="mailto:codapay_integration@coda.co"><em>codapay_integration@coda.co</em></a><em>.</em><br></p><p><em>Receipt example:</em> <img src="/files/VpemzyLCFf0d472Nomf0" alt=""></p></td></tr></tbody></table>

### v2.0 Sample Request

{% tabs %}
{% tab title="Require msisdn and email" %}

```json
{
  "project_id": "1", //This field is only needed for v2.0 API
  "country": "458",
  "api_key": "test_e944d44f065eade8157737385a09",
  "order_id": "<Your OrderID>",
  "lang": "en",
  "merchant_name": "Codapay",
  "type": "1",
  "pay_type": "5",
  "pay_channel": "-77",
  "email": "test@codapayments.com",
  "msisdn": "<Your Number>",
  "items": [
    {
      "code": "1",
      "name": "Test item",
      "price": 3.0
    }
  ],
  "profile": {
    "user_id": "12345"
  }
}
```

{% endtab %}

{% tab title="Require customer name and id\_no" %}

```json
{
  "project_id": "1", //This field is only needed for v2.0 API
  "country": "458",
  "api_key": "test_e944d44f065eade8157737385a09",
  "order_id": "<Your OrderID>",
  "lang": "en",
  "merchant_name": "Codapay",
  "type": "1",
  "pay_type": "5",
  "pay_channel": "-77",
  "email": "test@codapayments.com",
  "msisdn": "<Your Number>",
  "items": [
    {
      "code": "1",
      "name": "Test item",
      "price": 3.0
    }
  ],
  "profile": {
        "name":"CodaUser",
        "user_id":"12345",
        "id_no":"88899988811"
  }
}
```

{% endtab %}

{% tab title="Msisdn and email not required" %}

```json
{
  "project_id": "1", //This field is only needed for v2.0 API
  "country": "458",
  "api_key": "test_e944d44f065eade8157737385a09",
  "order_id": "<Your OrderID>",
  "lang": "en",
  "merchant_name": "Codapay",
  "type": "1",
  "pay_type": "5",
  "pay_channel": "-77"
  "items": [
    {
      "code": "1",
      "name": "Test item",
      "price": 3.0
    }
  ],
  "profile": {
    "user_id": "12345"
  }
}
```

{% endtab %}

{% tab title="Require Document number and type" %}

```json
{
  "project_id": "1", //This field is only needed for v2.0 API
  "country": "458",
  "api_key": "test_e944d44f065eade8157737385a09",
  "order_id": "<Your OrderID>",
  "lang": "en",
  "merchant_name": "Codapay",
  "type": "1",
  "pay_type": "5",
  "pay_channel": "255",
  "email": "test@codapayments.com",
  "msisdn": "<Your Number>",
  "items": [
    {
      "code": "1",
      "name": "Test item",
      "price": 300.0,
      "type": "0",
    }
  ],
  "profile": {
    "document_number": "1134568011",
    "user_id": "12345",
    "document_type": "CC"
  }
}
```

{% endtab %}
{% endtabs %}

### v1.0 Sample Request

{% tabs %}
{% tab title="Require msisdn and email" %}

```json
{
    "api_key":"<YOUR API KEY>",
    "order_id":"<Your Order ID>",
    "lang":"en",
    "merchant_name":"Codapay",
    "pay_type":"5",
    "pay_channel":"20",
    "type":"1",
    "msisdn":"<phone number>",
    "email":"<email address>" ,
    "items":[{
        "code":"456789",
        "name":"Test item",
        "price":1000.00
    }],
    "profile":{"user_id":"12345"}
}
```

{% endtab %}

{% tab title="Require customer name and id\_no" %}

```json
{
    "api_key": "<YOUR API KEY>",
    "order_id": "<Your Order ID>",
    "lang": "en",
    "merchant_name": "Codapay",
    "type": "1",
    "pay_type": "5",
    "pay_channel": "98",
    "email": "test@codapayments.com",
    "msisdn": "123432",
    "items": [
        {
            "code": "1",
            "name": "Test item",
            "price": 3
        }
    ],
    "profile":{
        "name":"CodaUser",
        "user_id":"12345",
        "id_no":"88899988811"
    }
}
```

{% endtab %}

{% tab title="Msisdn and email not required" %}

```json
{
    "api_key":"<YOUR API KEY>",
    "order_id":"<Your Order ID>",
    "lang":"en",
    "merchant_name":"Codapay",
    "pay_type":"5",
    "pay_channel":"39",
    "type":"1",
    "items":[{
        "code":"456789",
        "name":"Test item",
        "price":1000.00
    }],
    "profile":{"user_id":"12345"}
}
```

{% endtab %}

{% tab title="Require Document number and type" %}

```json
{
  "api_key": "<YOUR API KEY>",
  "order_id": "<Your Order ID>",
  "lang": "en",
  "pay_type": "5",
  "pay_channel": "255",
  "email": "test@codapayments.com",
  "type": "1",
  "merchant_name": "Codapay",
  "items": [
    {
      "code": "1",
      "name": "Test item",
      "price": "1000.0",
      "type": "0",
    }
  ],
  "profile": {
    "document_number": "1134568011",
    "user_id": "12345",
    "document_type": "CC"
  }
}
```

{% endtab %}
{% endtabs %}

## Response Message

<table data-full-width="false"><thead><tr><th width="174">Parameters</th><th width="99">Type</th><th width="91.33333333333331">Length</th><th>Description</th></tr></thead><tbody><tr><td>result_code</td><td>Number</td><td>N/A</td><td><p>Success or Error code. Success = 0.</p><p><br>Error Code list please refer to <a data-mention href="/pages/Ijfanb3Eb2mtXRsbF81n">/pages/Ijfanb3Eb2mtXRsbF81n</a></p></td></tr><tr><td>result_desc</td><td>String</td><td>512</td><td>If the resultCode is an error, this value describes the error.<br><a data-mention href="/pages/Ijfanb3Eb2mtXRsbF81n">/pages/Ijfanb3Eb2mtXRsbF81n</a></td></tr><tr><td>txn_id</td><td>Number</td><td>N/A</td><td>Unique payment transaction identifier.</td></tr><tr><td>txn_timeout</td><td>Number</td><td>N/A</td><td>Transaction Timeout in Minutes.</td></tr><tr><td>total_price</td><td>Number</td><td>N/A</td><td>The total amount the user has paid for the transaction. This will always be in local currency.</td></tr><tr><td>pay_instructions</td><td>String</td><td>15</td><td>If this value is populated, partner should display the instructions provided on screen to the customer.</td></tr><tr><td>profile</td><td>Map</td><td>N/A</td><td>Refer the Profile info below for more details</td></tr></tbody></table>

## Profile Info

<table><thead><tr><th width="172">Parameters</th><th width="123">Type</th><th width="104.33333333333331">Length</th><th>Description</th></tr></thead><tbody><tr><td>extInfoByte</td><td>Number</td><td>N/A</td><td>This is for Coda internal reference , please ignore this field.</td></tr><tr><td>redirect_url</td><td>String</td><td>128</td><td><p>The payment gateway's redirect URL is returned only if the selected payment channel follows a redirect URL workflow.</p><p></p><p><strong>For example:</strong> Thailand Rabbit Line Pay.</p></td></tr><tr><td>merchantType</td><td>String</td><td>128</td><td>Please ignore this field.</td></tr><tr><td>qr_code_url</td><td>String</td><td>128</td><td><p>The payment gateway's QR code URL is returned only if the selected payment channel has a QR code workflow.<br></p><p><strong>For example</strong>: Malaysia Touch &#x26; Go e-Wallet</p></td></tr></tbody></table>

### Sample Response

{% tabs %}
{% tab title="Require msisdn and email" %}

```json
{
   "txn_id": <coda transaction ID>,
   "txn_timeout": 20,
   "result_code": 431,
   "result_desc": "Please wait a few minutes for your transaction to be completed. Need Help? Visit our <a href=“http://bit.ly/idCODAhelp” target=“_blank”>Help Center</a>.",
   "total_price": 1000.0,
   "pay_instructions": "",
   "profile": {
        "extInfoByte": "11",
        "user_id": "12345",
        "merchantType": "Codapay",
        "payment_code": ""
    }
}
```

{% endtab %}

{% tab title="Require customer name and id\_no" %}

```json
{
    "txn_id": <coda transaction ID>,
    "txn_timeout": 1445,
    "result_code": 431,
    "result_desc": null,
    "total_price": 3.03,
    "pay_instructions": "",
    "profile": {
        "extInfoByte": "0",
        "id_no": "88899988811",
        "user_id":"12345",
        "redirect_url": "https://homolog.latamgateway.com/picpay/finish/8053d22c-2e78-4c2d-bd20-da32014440f1",
        "payment_code": ""
    }
}
```

{% endtab %}

{% tab title="Msisdn and email not required" %}

```json
{
    "txn_id": <coda transaction ID>,
    "txn_timeout": 11,
    "result_code": 0,
    "result_desc": null,
    "total_price": 1000.0,
    "pay_instructions": "",
    "profile": {
        "redirect_url": "https://linkaja/checkout/payment?message=LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tClZlcnNpb246IEJDUEcgdjEu",
        "extInfoByte": "0",
        "payment_code": ""
    }
}
```

{% endtab %}

{% tab title="Require Document number and type" %}

```json
{
    "txn_id": <coda transaction ID>,
    "txn_timeout": 17,
    "result_code": 431,
    "total_price": 1000.0,
    "pay_instructions": "",
    "profile": {
        "extInfoByte": "0",
        "document_number": "1134568011",
        "user_id": "12345",
        "merchantType": "Codapay",
        "redirect_url": "https://cdn.safecharge.com/safecharge_resources/v1/validation-code-72309.html?notifyUrl=https%3A%2F%2Fapm.safecharge.com%2FApmConnector%2F8192341EAC1F4C9C3AAC718DA1F1AB22&locale=en_CO",
        "document_type": "CC",
        "payment_code": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %} <mark style="color:orange;">**Reference of USD Transactions**</mark>

Please check out this [guide ](/codapay/direct-api-integration/direct-api-integration-for-alternative-payment-methods/initiate-usd-transactions.md)to learn more about USD transactions.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.coda.co/codapay/direct-api-integration/direct-api-integration-for-alternative-payment-methods/backend-call-flow/e-wallet.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
