> For the complete documentation index, see [llms.txt](https://docs.ottpay.com/payment-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ottpay.com/payment-api/api-for-global-payments-portico-ecomm-payment/payment-request-api.md).

# Payment Request API

## :white\_check\_mark: **Process Flow Diagramimama**

<figure><img src="/files/Bpmi2WPFK4VIl6lyRdjq" alt=""><figcaption></figcaption></figure>

## :white\_check\_mark: API Request Parameter&#x73;**(HTTP-Request-Body )**

|                                               Params Name                                               |          Description         | Required |          Notes         |
| :-----------------------------------------------------------------------------------------------------: | :--------------------------: | :------: | :--------------------: |
|                                                  action                                                 | Action name (Constant Value) |     Y    |           <p>          |
| <br> “<strong>CC\_PURCHASE</strong>” /</p><p>“<strong>CC\_PREAUTH</strong>” (for pre-authorization)</p> |                              |          |                        |
|                                                 version                                                 |        Version number        |     Y    |          "2.0"         |
|                                               merchant\_id                                              |          Merchant ID         |     Y    |   Provided by OTT Pay  |
|                                                   data                                                  |  Encrypted Transaction Data  |     Y    | See "Data" table below |
|                                                   md5                                                   |        Message Digest        |     Y    |                        |

:ballot\_box\_with\_check: **Request Example(JSON Data):**

```php
{
    "action":"CC_PURCHASE",
    "version":"2.0",
    "merchant_id":"QC00005496",
    "data": "zTadPG0YM4gD1WOFqxg7wn3vmU20NjCnCUOOnE9mTTkxYraQDflljA8W3azYG9MuOvOyl3cZhafH+io6PiWdZCwRmi3HGa19BvT215IIxRy2HvYe0Sqs2lxshm9E4y5F1gJ7HHMTqpY0wIA4DsuWA97UC55adB2G86VbanI7B5a3kErApr5mbAoE7wcNbDJfGh4CBbSoRxQyiGZ48SvYuIW/sclT4yu6okjo6CY3xL4=",
    "md5":"6AFB2E94A70D9A208F101723700EB287"
}
```

#### :ballot\_box\_with\_check: Dat&#x61;**(JSON Data, to be encrypted):**

|   Params Name   |            Description            | Required |                                                                      Notes                                                                     |
| :-------------: | :-------------------------------: | :------: | :--------------------------------------------------------------------------------------------------------------------------------------------: |
|     orderId     |              Order ID             |     N    | String, Order ID should be unique, it could be generated by OTTPAY or generated by client’s code with no more than of 20 numbers and alphabets |
|       <p>       |                                   |          |                                                                                                                                                |
|  <br> merId</p> |            Merchant ID            |     N    |                                                           String, Provided by OTTPAY                                                           |
|      shopId     |              Store Id             |     Y    |                                                           String, provided by OTTPay                                                           |
|      termId     |            Terminal no            |     N    |                                             String, “CNP\_ECOM”, i.e., card not present E-commerce                                             |
|   operator\_id  |            Operator ID            |     Y    |                                                           String, provided by OTTPay                                                           |
|     txnTime     |          Transaction Time         |     Y    |                                                         String, format “yyyyMMddHHmmss”                                                        |
|      txnAmt     |         Transaction Amount        |     Y    |                                                          String, "100" for 1.00 dollar                                                         |
|    cc\_number   |        Encrypted card data        |     Y    |           String, see detail in the “Description for request encryption for cc\_number, and cc\_sha in data of request” in appendix A          |
|     cc\_sha     |        SHA 256 of card data       |     Y    |           String, see detail in the “Description for request encryption for cc\_number, and cc\_sha in data of request” in appendix A          |
|     cc\_type    |             Card type             |     N    |                                                               String, “VISA”/”MC”                                                              |
|   channelType   | UnionPay Payment Channel identity |     Y    |                                                                  "PORTICOECOM"                                                                 |
|    biz\_type    |           Message Digest          |     Y    |                                                              "&#xD;portico\_card"                                                              |
| cc\_channelType |          Payment Channel          |     N    |                                                                      "web"                                                                     |
|     currency    |           Currency type           |     Y    |                                                               String, “CAD”/”USD”                                                              |
|  cc\_maskednum  |         Masked card number        |     Y    |                                                      String, last 4 digits of card number                                                      |

:ballot\_box\_with\_check: **Encrypted cc\_number field contains the following fields:**

|    Params Name    | Description | Required |            Notes           |
| :---------------: | :---------: | :------: | :------------------------: |
|     cc\_number    |     Pan     |     Y    |         Card number        |
|      cc\_name     | Card holder |     Y    |         Card holder        |
|     cc\_expiry    | Expire date |     Y    |      Card expire date      |
|        cvn2       |     Cvv2    |     Y    |      Verification code     |
| ssl\_avs\_address |   address   |     Y    |     Card holder address    |
|     ssl\_city     |     city    |     Y    |      Card holder city      |
|   ssl\_province   |   province  |     Y    | Card holder province/state |
|   ssl\_avs\_zip   | Postal code |     Y    |   Card holder postal code  |
|    ssl\_country   |   country   |     Y    |     Card holder country    |

## :white\_check\_mark: API Response Parameter&#x73;**(HTTP-Response-Body)**

| Params Name |    Description   | Required |          Notes         |
| :---------: | :--------------: | :------: | :--------------------: |
|  rsp\_code  |   Response code  |     Y    |   refer to Appendix B  |
|   rsp\_msg  | Response message |     Y    |                        |
|     data    |  Encrypted Data  |     Y    | See "Data" table below |
|     md5     |  Message Digest  |     Y    |                        |

:ballot\_box\_with\_check: **Response Example(JSON Data):**

```
{
"rsp_code":"SUCCESS",
"rsp_msg":"success",
"data":"RqlbPF0gZ0VnGnpQPnO/v1FSeVY81iMrJd0ejTx+g8Bj8y3XImosyzBF75PW LxyHffCAidLCVxW7lfr60lHVK9FtsEP+V0F1Wp6xDW0ZnJyCpC6inmC9i4NV iEqo50yGS4vtaf+mHz6ZtoWtn9ihYNAOEr1grr/F684cJ+f0D4ZaAkdkI5HV H4BTUPG78lAiJqv1hNmYZIIDucxxyghKFAEdgrfkM13f6Jig9CIHhXW8Xkfl nVSEoVz6v63jX2NS1Ls0bAZTeJC9YFS/hkTjbloaR7hvKU+zx5SZrhGNpjTX OjpKopp57IzWMd4LF4TgXsV8Eqib/ygz6n6wJ5zR6HtcWexC0DnxVoE0DMAz FW3cIIsCDLVkw++eZAZohk6e+Zpbke82apdigJm8xtLam5Esn2N3khpBFpfu oQ3LTPqKnj9mxjUtm/slblJ+ve3hOQ6ZA01QJHBEOxx4UJgm+pTxdyIQuRAH 7Df8XIfP0NE=",
"md5":"3D3B2F0000EFBF3427A5A67E656E838B"
}
```

#### :ballot\_box\_with\_check: Transaction Data(JSON format, After decrypted)

|    Params Name    |        Description       | Required |                           Notes                           |
| :---------------: | :----------------------: | :------: | :-------------------------------------------------------: |
|      rspCode      |   Payment response code  |     Y    |            The response code by payment gateway           |
|       rspMsg      | Payment response message |     Y    |          The response message by payment gateway          |
|    trade\_time    |        Finish time       |     Y    |                        Payment time                       |
|      orderId      |         Order id         |     Y    |                          Order ID                         |
|    trackorderId   |    Order Id for track    |     N    |            Track order Id, used for split bill            |
| bizpay\_order\_id |    Gate way payment Id   |     Y    |            Payment transaction id from gateway            |
|       amount      |        Pay amount        |     Y    |                     Transaction amount                    |
|        tip        |            tip           |     N    |                        Tips amount                        |
|   order\_status   |    Status of the order   |     N    | Status of order, “success”, “processing”, ”error”, ”fail” |
|   exchange\_rate  |           rate           |     N    |                       Exchange rate                       |
|  convenience\_fee |            fee           |     N    |                  Possible additional fee                  |
|    refundAmount   |                          |     Y    |                                                           |
