Welcome to the 2C2P Developer Zone

This is the resource where developers can find all the information needed to integrate the services offered by 2C2P with their e commerce system.

123 Payments

How to send a 123 request

Configuration

For the Sandbox account the option to use of 123 Services is enabled by default so you can test the implementation.

Due to the nature of the payment method (offline) the 123 Option can not be combined with either Installments or Recurring payments.

You can find a full list of available payment channels and agents in the Reference Docs section.

Access Restrictions

In order to use the 123 Service the production environment, you first need to

  1. Select the channels to be used (country specific)
  2. Have 2C2P support configure merchant account for the 123 payments selected
  3. Complete the UAT process

Sending the 123 Request

Creating a 123 request is a combination of

  • the merchants checkout page (consumer selects payment option) and
  • a request to the 123 Service with the variables required (agent and channel details)

This will trigger a redirection to the 123 Service payment page hosted by 2C2P. The page is customized based on the parameters provided.

To send the required parameters, use the variables in the below list.

Please also check the 123 References page for references mentioned in the list.

Request Message Fields

Variable Name Mandatory Description
Version M Message Version Number, Example: 2.0
TimeStamp M Date and time of the request message,
Format : yyyy-MM-dd HH:mm:ss:fff,
yyyy = 4 numeric digits,
followed by a dash (“-“),
MM = 2 numeric digits with value 01-12,
followed by a dash (“-“),
dd = 2 numeric digits with value 01-31, followed by a space(“ “),
HH = 2 numeric digits with value 00-24,
followed by a colon (“:”),
mm = 2 numeric digits with value 00-59,
followed by a colon (“:”),
ss = 2 numeric digits with value 00-59,
followed by a colon (“:”),
fff = 3 numeric digits with value 000-999,
Example : 2014-02-28 23:59:59:999
MessageID M Unique Identifier for every message exchange.,
Format : characters or numeric (or both), Example: ABCD12345
MerchantID M Unique Identifier of merchant Merchant’s registered email address or unique id generated by 1-2-3.
Format : it can be numeric generated by 1-2-3 system or the email address registered in 1-2-3 system.
Example : 123 or merchant@merchant.com
InvoiceNo M Unique invoice/order number generated by merchants.
IMPORTANT: This number must NOT start with zero.
Example: 123456
Amount M Purchase amount,
Format : pad left ‘0’ if not filled with 12 numeric and the last 2 digits is for exponent.
Example: 000000010000 represents 100.00
CurrencyCode M ISO 4217 Currency Code,
Example: THB for Thai Baht
CountryCode M ISO 3166 Country Code,
Example : THA for Thailand
ProductDesc M The description of product,
Example: Flight Booking No. 17598
PaymentItems M The items details, nested XML, Format : text
Put one SKU (Stock-keeping unit) per item with quantity.
E.g. if there is a purchase of 100 pens and 50 books, put as the following.
Example:
<PaymentItems>
<PaymentItem id="1" name="Pen" price="000000001000" quantity="100"/>
<PaymentItem id="2" name="Book" price="000000001500" quantity="50"/>
</PaymentItems>
PayerName M Payer or Buyer Name,
Example: John Walker
PayerEmail M The email address of buyer. Format : any valid characters for email address,
Example: customer@gmail.com
MerchantUrl M The result page URL of merchant website.
1-2-3 will redirect to this URL with XML response when the payer clicked on GoBackMerchant button at 1-2-3 result page after payment is PAID or PENDING.
Format : any valid characters for the URL
APICallUrl M 1-2-3 system will send XML response back to this URL after payment is PAID or PENDING,
Format : any valid characters for the URL
AgentCode M The unique code of agent by 1-2-3 system.
See Reference Docs - 123 Agents,
Format : characters, Example: BBL
ChannelCode M The unique code of channel by 1-2-3 system.
See Reference Docs - 123 Channels,
Format : Characters, Example: ATM
PayInSlipInfo O Merchant can submit any information to show on pay-in-slip. Format : characters
-put “pipe symbol” if you need new line.
-Every single line should not exceed more than 100 characters.
-Number of lines should not exceed more than 5 lines.
PaymentExpiry O Merchant can set payment expiry by product item. If no value, it will be determined as payment expiry by Merchant Setting for all products.
Format : yyyy-MM-dd HH:mm:ss
- yyyy = 4 numeric digits,
followed by a dash (“-“)
- MM = 2 numeric digits with value 01-12,
followed by a dash (“-“)
- dd = 2 numeric digits with value 01-31, followed by a space (“ “)
- HH = 2 numeric digits with value 00-24,
followed by a colon (“:”)
- mm = 2 numeric digits with value 00-59,
followed by a colon (“:”)
- ss = 2 numeric digits with value 00-59,
Example: 2014-03-15 23:59:59
SlipLanguage O Merchant can select payment slip language. If no value, it will choose default language as Thai language.
Format : characters
EN = English language
TH = Thai
HashValue M Hash value computed by HMACSHA1 with secret key provided by 1-2-3 System.
Signature String : MerchantID+InvoiceNo+Amount
Secret Key (Test) : value of secret key
Example available in the 123 Request section.

Samples for 123 requests can be found here.

Find a full list of all variables in the 123 Variables section.

Using PKCS7 for Encryption

The merchant system connects to the 123 Service using HTTP FORM POST.
The message should be posted by using PKCS7 encryption.

The 123 Service can provide the libaries for PKCS7 usage, see section Encryption Libraries for details

Processing the 123 Response

After each 123 request message to the 123 service, 2C2P will send a response message to APICallUrl (Merchant Back-endURL) and MerchantURL (Merchant Front-end URL).

The response message will be encrypted with your Merchant public key that you need to share with 2C2P in the merchant interface, section Account - Options

There are 2 options how the response is send to the merchant system, the GET or the POST method.
Please contact our support team to configure the method required.


Response Message Fields

 Variable  Name  Mandatory Description
Version M Message Version Number, Example: 2.0
TimeStamp     M Date and time of the response message,
Format : yyyy-MM-dd HH:mm:ss:fff,
yyyy = 4 numeric digits, followed by a dash (“-“),
MM = 2 numeric digits with value 01-12,
followed by a dash (“-“),
dd = 2 numeric digits with value 01-31,
followed by a space (“ “),
HH = 2 numeric digits with value 00-24, followed by a colon (“:”),
mm = 2 numeric digits with value 00-59,
followed by a colon (“:”),
ss = 2 numeric digits with value 00-59, followed by a colon (“:”),
fff = 3 numeric digits with value 000-999,
Example : 2014-02-28 23:59:59:999
MessageID  M Unique Identifier for every message exchange.,
This message ID must be from the request message.
Format : characters or numeric(or both), Example: ABCD12345
MerchantID M Unique Identifier of merchant Merchant’s registered email address or unique id generated by 1-2-3.
Format : It can be numeric generated by 123 system or the email address registered in 1-2-3 system.
Example : 123 or merchant@merchant.com
InvoiceNo M Unique invoice/order number generated by merchants.
RefNo1 M Reference No. from the system of 1-2-3.It can be called ‘Payment Ref.Code
Amount M Transaction amount,
Format : pad left ‘0’ if not filled with 12 numeric and the last 2 digits is for exponent.
Example: 000000010000 represents 100.00
PaidAmount C Discount amount,
Format : pad left ‘0’ if not filled with 12 numeric and the last 2 digits is for exponent.
Example : 000000010000 represents 100.00
ResponseCode M Response code from 1-2-3 system,
See Reference Docs, 123 Details,
Format : numeric,
Example: 000
CompletedDateTime M The date and time of transaction completed.
Format : yyyy-MM-dd HH:mm:ss
yyyy = 4 numeric digits, followed by a dash (“-“)
MM = 2 numeric digits with value 01-12,
followed by a dash (“-“)
dd = 2 numeric digits with value 01-31, followed by a space (“ “)
HH = 2 numeric digits with value 00-24,
followed by a colon (“:”)
mm = 2 numeric digits with value 00-59,
followed by a colon (“:”)
ss = 2 numeric digits with value 00-59
Example: 2014-03-15 23:59:59
AgentCode M The unique code of an agent by 1-2-3 system.
(Can be different from request message depend on agent that customer do the payment)
See Reference Docs – 123 Agents
Format : characters,
Example: BBL
ChannelCode M The unique code of channel by 1-2-3 system.
(Can be different from request message depend on channel that customer do the payment)
See Reference Docs – 123 Channels
Format : characters,
Example : ATM
UserDefined1 O 123 system will response back to merchant whatever information include in request message of this field
Format : any characters or numeric
UserDefined2 O 123 system will response back to merchant whatever information include in request message of this field
Format : any characters or numeric
UserDefined3 O 123 system will response back to merchant whatever information include in request message of this field
Format : any characters or numeric
UserDefined4 O 123 system will response back to merchant whatever information include in request message of this field
Format : any characters or numeric
UserDefined5 O 123 system will response back to merchant whatever information include in request message of this field
Format : any characters or numeric
UserDefined6 O 123 system will response back to merchant whatever information include in request message of this field
Format : any characters or numeric,
See also Reference Doc - 123 References for User Defined Parameter
UserDefined7 O 123 system will response back to merchant whatever information include in request message of this field
Format : any characters or numeric,
See also Reference Doc - 123 References for User Defined Parameter
HashValue M Hash value computed by HMACSHA1 with secret key provided by123 System.
Signature String : MerchantID+InvoiceNo+RefNo1
Secret Key (Test) : key value
SlipUrl O 123 system will response back to merchant the URL link for the bill slip.
* The character ‘&’ will be replaced with ‘&’, Format : characters, Example:
https://uat.123.co.th/Payment/slip.aspx?p=MTA2MzcxNw==&e=bnV0dGhhcG9=

Samples for 123 responses can be found here.

Find a full list of all variables in the 123 Variables section.

Confirm Message Delivery

When the merchant receives the 123 Response message (OneTwoThreeRes) to the merchant back-end URL (APICallUrl), It needs to send a reply message (APICallUrlRes) to 2C2P to confirm the receipt of the message.

If the merchant does not reply to the response, the 2C2P will send response message again.

The following retry intervals apply: 5 min, 10 mins, 15 mins, 30 mins 1 hours, 6 hours, 12 hours and 1 day.

If there is no reply to the response message after the 1 day interval, 2C2P will send an email notification and escalate the issue.

Reply Message Fields

 Variable  Name  Mandatory Description
Version M Message Version Number, Example: 2.0
TimeStamp     M Date and time of the response message,
Format : yyyy-MM-dd HH:mm:ss:fff,
yyyy = 4 numeric digits, followed by a dash (“-“),
MM = 2 numeric digits with value 01-12,
followed by a dash (“-“),
dd = 2 numeric digits with value 01-31,
followed by a space (“ “),
HH = 2 numeric digits with value 00-24, followed by a colon(“:”),
mm = 2 numeric digits with value 00-59,
followed by a colon (“:”),
ss = 2 numeric digits with value 00-59, followed by a colon (“:”),
fff = 3 numeric digits with value 000-999,
Example : 2014-02-28 23:59:59:999
MessageID  M Unique Identifier for every message exchange.,
This message ID must be from the request message.
Format : characters or numeric(or both), Example: ABCD12345
MerchantID M Unique Identifier of merchant Merchant’s registered email address or unique id generated by 123.
Format : It can be numeric generated by 123 system or the email address registered in 1-2-3 system.
Example : 123 or merchant@merchant.com
ResponseCode M Response code from 123 system,
See Reference Docs - 123 References
Format : numeric,
Example: 000
FailReason C If the merchant fails to update, the merchant can send the failure reason, Format : any characters or numeric

APICallUrl Response Message for status update

If there is any further update to the transaction related to a payment, 2C2P will send a further response message OneTwoThreeRes to APICallUrl (Merchant Back-end URL) to inform the merchant about the change in payment status.

The message format will be the same as for the initial response, but is only send to the APICallUrl (Merchant Back-end URL)

123 Request