P2P BY API

PCI DSS certification is required to work with the company via API

Upon registration, you will be provided with data that will need to be used when making transfers:

TerminalIDStore identifier
ClientIDClient identifier
ClientSecretSecret key

Test merchant

URLhttps://test-epay.homebank.kz/login
emailepay@halykbank.kz
passwordXZG1E@Mm
ClientIDtest
ClientSecretyF587AV9Ms94qN2QShFzVR3vFnWkhjbAK3sG
TerminalID3ad0f5bd-88a8-464c-a9a4-cdb16d1dd31

Test cards

PANExpire DateCVCStatus
440563970401509601/25815unlock
552204270506673601/25525unlock
37751450000482001/254169unlock
400303270454759709/20170lock
557834271075056009/20254lock

Receiving a token for implementation a transfer

TEST URL POST https://testoauth.homebank.kz/epay2/oauth2/token
PROD URL POST https://epay-oauth.homebank.kz/oauth2/token

Request Body: form-data

grant_type: "client_credentials"
scope: "transfer"
invoiceID: "12321312312"
secret_hash: "JDKCNDDGGDTPSKJD"
amount: "100"
currency: "KZT"
client_id: "test"
client_secret: "yF587AV9Ms94qN2QShFzVR3vFnWkhjbAK3sG"
terminal:       "c36b282f-6819-4d4f-85df-a4bdc8a8f703"


ПолеОписание
grant_typeAuthorization type, for conducting a payment, the authorization type used is: client_credentials
invoiceIDOrder number generated by the merchant, must be unique for each new order, from 6 to 15 digits. If your order number contains more than 6 characters, uniqueness must also be maintained for the last 6 characters
secret_hashadditional secret value(string) generated by the online store system which will be returned to Postlink
amountAmount
currencyCurrency
scopeResource
client_idMerchant ID, can be receiving in the merchant's account, issued upon registration
client_secretClient identifier, issued upon registration
terminalStore identifier, issued upon registration

Response

   {
     "access_token":"DCEB8O_ZM5U7SO_T_U5EJQ",
     "expires_in": 7200,
     "refresh_token":"",
     "scope":"transfer",
     "token_type":"Bearer"
   }


ПолеОписание
access_tokenToken for implementation the operation
expires_inToken expiration time
refresh_tokenNot used for this type of authorization
scopeResource, for conducting a payment, the resource used is transfer
token_typeAuthorization type

After receiving the token, it must be passed in

Headers Bearer DCEB8O_ZM5U7SO_T_U5EJQ

to the endpoint:

TEST URL https://testepay.homebank.kz/api/p2p/transfer
PROD URL https://epay-api.homebank.kz/p2p/transfer

POST method, in the JSON format, should specify the following structure:

Body: raw

{
  "order": {
    "amount": 100,
    "currency": "KZT",
    "description": "TEST p2p",
    "merchantIdForSavingCards": "",
    "id": "123456787538",
    "senderIP": "",
    "senderEmail": "armanali@epay.kz",
    "foreign": false,
    "terminalId": "c36b282f-6819-4d4f-85df-a4bdc8a8f703",
    "backLink": "https://epay.homebank.kz/demo/success.html",
    "failureBackLink": "https://epay.homebank.kz/demo/failure.html",
    "postLink": "https://epay.homebank.kz/payform",
    "failurePostLink": "https://testmerchant/order/1123/fail"
  },
  "card": {
    "sender": {
      "save": false,
      "transferType": "TYPEPAN",
      "address": "",
      "cvc": "951",
      "cardCred": "4003039802969821",
      "expire": {
        "month": "09",
        "year": "23"
      },
      "name": "Sergey Frolov",
      "number": ""
    },
    "receiver": {
      "save": false,
      "id": "",
      "transferType": "TYPEPAN",
      "cardCred": "5578342728230613",

    }
  }
}


Sender fields description:

FieldDescription
AmountOrder amount
currencyCurrency
descriptionOrder description
merchantIdForSavingCardsЕmpty
IdOrder number generated by the merchant, must be unique for each new order, from 6 to 15 digits. If your order number contains more than 6 characters, uniqueness should also be maintained for the last 6 characters
senderIPSender IP (optional)
senderEmailClient email (optional)
foreignFalse
terminalIdStore identifier
backLinkLink to return to the store on successful payment
failureBackLinkLink to return to the store on unsuccessful payment
postLinkLink Payment notification
failurePostLinkNotification of unsuccessful payment, if not filled in, the information will be sent to the address specified in postLink
saveSave the card - true, don't save - false
transferTypeType of transfer, "TYPEPAN" - by card number, "TYPECARDID" - by saved epay card
AddressAddress
CVCCVV
IdEmpty field
MonthMonth
YearYear
NameName
cardCredSender's card number/ card ID

Receiver fields description:

FieldDescription
saveSave the card - true, don't save - false
idcardid
cardCredReceiver's card number
firstNameFirst name - only for international transfers
lastNameLast name - only for international transfers
countryCodeCountry code - only for international transfers

Success response:


{
    "id": "a9e1b986-be01-4763-9216-610cc63b963c",
    "amount": 200,
    "currency": "KZT",
    "email": "epay@halykbank.kz",
    "description": "TEST p2p",
    "reference": "204978430339",
    "orderID": "1234567893774576",
    "senderCardID": "88481433-595e-4c01-941f-34569db2426e",
    "senderCardPAN": "4003********9821",
    "receiverCardID": "86496cb0-bb5d-4791-bb49-cc27a0f660ce",
    "receiverCardPAN": "5578********0613",
    "intReference": "6BD1808D0FF129B0",
    "terminalID": "95555555",
     "code": 0,
     "status": "AUTH"
}


Failure response:

{
    "code": 487,
    "message": "Not permitted to merchant",
    "invoiceId": "8161284658525",
    "id": "",
    "reference": "",
    "accountId": "uuid000001"
}



After receiving the payment result with 3DSecure, the client needs to be redirected to the password input form.

To do this, the received parameters paReq, md, action are used.

In the TermUrl parameter, the address on which the merchant system will receive the 3DSecure password verification result needs to be used.

Example of building a form for redirecting the client:


Дождитесь ответа!

Жауабын күтіңіз!

Wait for an answer!

PaRes: eJzNWVnT4jiy/SsdPY9Et3ewO6gvQt53bPD+5g3vNmCDjX/9FXxV1TXVPXHnzsONIYJATqcyU0rlOZLYO+Utz/lTnt5v+cfeyMcxLvJfquzLrxY45tc/Qp0HJ6UBIXZEC3EqspDgx/nXj/3r9fhWfKv8dpgvVMRu/efRq2VFBVDlkd/Gaug/sN/R3/E98u0RermlZdxPH/s4vbKK+UGSKLWl9sjXx32X3xT+w1QcXbcEhsYIFKewPfIp3iN/9rfur9YII1+q7MM9CLyv42mIMwEpTXPmM13cLamyob/skZfGPoun/ANHcQylcPoXDP0DJf+gtnvkLd9fXuZAN9yhbYyBbtE98qNsD2fplvfp84Ng6D3y/WmfL5ehz6EGHOb39h75M7xL3H+gP3wwCmOgbSjdO8HHfqq6n8Ki/sChrbd8P07xdB8/H+vOG631x//574XXT/OPfDv8D83MUpA== MD: 270469967-9CA5EC5779A3358E


Payment confirmation (sending the result of the 3DSecure password check)


URL POST /payment/confirm

Body { "ID": "7943816b-58a8-47f6-a11e-67b63c4228c7", "PaRes": "/ZUo742DgULQ4CotpdByEwF6eQvOAFEggSRUtE+rfsh+A9pV1Uq7VX/B/aPaKfTyYOucmfHx8YzhaLOYa7cYJ34UVvWcYeoahjzy/HBa1YeD+kFZP2IwmMWINQf5OkYGbUwSd4qa71X1nt3HVeXqPK1PHHpCg1l+dHs84rlyszPVGWRpBrsLmNQ3KJA9lUoxn7lhysDlq+NmhxUKZvGwCGRHYYFxs8acRrd32rctWrQKZl4KfIQhdBfIGt32qSowLm6AZBHg0TpM4zuWt8pA9gTW8ZzN0nRZIQSX7p0RBGMjuAei4kC+rPTWCiVSZ+N7DEm/1LpqrobjktO6HNdaw/GNV+f2ZNCuAlEV4LkpMmrmLOmtpJlWpUArNAcki4O7UAZk3pTP+sCwVFfY3xLfAyC7HMsh7P3vGeBmGYWojgD5xOBhwpn4LV7FP7F9exBbTfzRxLN4kfjx7Zd4kfuDJv6Lrfgr15NKiUfpTp0D8vXak4YaA09lZ+3Lnj09871waEX3tU5wPUKPu5PuxJlTNZ", "MD": "271710719-E54F6D8F865285D4", }


Response

Redirect Http code 200

Success <https://epay.homebank.kz/payform/success.html> Params amount currency invoiceID accountID description reference language cardid

Error <https://epay.homebank.kz/payform/> invoiceID code message