Payment page

When registred, you will be given credentials that you would need for making payments:

TerminalIDStore Identification
ClientIDClient Identificator
ClientSecretSecret Keys

Receiving a token for payment processing

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: 			"payment"
client_id: 		"test"
client_secret: 	"yF587AV9Ms94qN2QShFzVR3vFnWkhjbAK3sG"
invoiceID: 		"000000001"
secret_hash: "JDKCNDDGGDTPSKJD"
amount: 		100
currency: 		"KZT"
terminal: 		"67e34d63-102f-4bd1-898e-370781d0074d"
postLink:       ""
failurePostLink: ""

FieldDescription
grant_typeauthorization type. client_credentials are used for payment processing
scoperesource
client_idMerchant id (can be obtained on the account page, first given when registered)
client_secretMerchant's access key (can be obtained on the account page, first given when registered)
invoiceIDOrder number (generated by merchant, must be unique for every new order)
secret_hashadditional secret value(string) generated by the online store system which will be returned to Postlink
amountOrder Amount
currencyCurrency
terminalSale point's id (can be obtained on the account page, first given when registered)
postLinkOptional parameter. Sends postlink in case of success.
failurePostLinkOptional parameter. Sends postlink in case of failure.

Response

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

FieldDescription
access_tokenToken for payment processing
expires_inExpiry time
refresh_tokenNot used in current type of request
scopeResource. In order to process a payment "payment" resouce is used. Ресурс, для проведения платежа используется ресурс payment
token_typeType of the token

Redirection on payment page

You must connect JS-library to the page and call a halyk.pay() method.

Production version

URL: https://test-epay.homebank.kz/payform/payment-api.js

You must specify these paramteres in halyk.pay() method

var createPaymentObject = function(auth, invoiceId, amount) {
            var paymentObject = {
					invoiceId: "000000001",
          invoiceIdAlt:"8564546",
					backLink: "https://example.kz/success.html",
					failureBackLink: "https://example.kz/failure.html",
					postLink: "https://example.kz/",
					failurePostLink: "https://example.kz/order/1123/fail",
					language: "RU",
					description: "Оплата в интернет магазине",
					accountId: "testuser1",
					terminal: "67e34d63-102f-4bd1-898e-370781d0074d",
					amount: 100,
          data: "{\"statement\":{\"name\":\"Tester Petrov\",\"invoiceID\":\"80000016\"}}",
					currency: "KZT",
                    phone: "77777777777",
                    name:"Tester Petrov",
                    email: "example@example.com"
                   };
            paymentObject.auth = auth;
            return paymentObject;
        };

halyk.pay(createPaymentObject(auth, invoiceId, amount));

FieldDescriptionMandatory
invoiceIdOrder number. Generated by a merchant, must be unique for every new orderMandatory
invoiceIdAltAdditional order number, assigned by the merchant, must be unique for each new order, from 6 to 15 digits.Optional
backLinkA link to get back on a shop page when payment is successfulMandatory
failureBackLinkA link to get back on a shop page when payment failedOptional
postLinkNotification of a paymentMandatory
failurePostLinkA notification of an unsuccessfull payment. Information will be sent to the address in postLink if no information is presentOptional
languageLanguage eng/kaz/rusOptional
description125 byte. Order descriptionMandatory
accountIdOptional field. Used when a merchant has a unique id assigned to the clientOptional
terminalId of a sale pointMandatory
amountOrder amountMandatory
currencyTransaction currencyMandatory
phoneClient's phone numberOptional
emailClient's email addressOptional
authAuthorization tokenMandatory
dataadditional field is transmitted in the report when filled inOptional

Post link

URL in postLink will be used to send a message.

Response in an event of success:

{
"acountId":"9398101000014416472",
"amount":800,
"approvalCode":"178644",
"cardId":"4cd44b44-4445-14a6-e063-1b01040a44c4",
"cardMask":"440043...0128",
"cardType":"VISA",
"code":"ok",
"currency":"KZT",
"dateTime":"2025-02-12T09:42:51.960781107+05:00",
"description":"ONAY!",
"email":"",
"id":"a1bd0589-3ac9-4a2e-a31d-67a33f453a2b",
"invoiceId":"33456850",
"ip":"91.215.96.94",
"ipCity":"",
"ipCountry":"",
"ipDistrict":"",
"ipLatitude":0,
"ipLongitude":0,
"ipRegion":"",
"issuer":"JSC KASPI BANK",
"language":"RUS",
"name":"",
"phone":"77775903128",
"reason":"success",
"reasonCode":0,
"reference":"504355533594",
"secret_hash":"ZitLN1VLd21hUnFOSTJKbmg0UVdYVm8z",
"secure":"yes",
"secureDetails":"F",
"terminal":"67e34d63-102f-4bd1-898e-370781d0074d"
}


Error codes

Response in an event of a failure:

{
"accountId":"9398101000006384023",
"amount":200,
"approvalCode":"",
"cardId":"",
"cardMask":"",
"cardType":"",
"code":"error",
"currency":"KZT",
"dateTime":"2025-02-12T09:42:53.036675+05:00",
"description":"ONAY!",
"email":"",
"id":"03c6de6e-0028-42fa-9199-561d78e59789",
"invoiceId":"33456910",
"ip":"95.82.119.153",
"ipCity":"Almaty",
"ipCountry":"Kazakhstan",
"ipDistrict":"",
"ipLatitude":43.2638,
"ipLongitude":76.9293,
"ipRegion":"",
"issuer":"JSC KASPI BANK",
"language":"RUS",
"name":"",
"phone":"77777777777",
"reason":"Authentication failed",
"reasonCode":473,
"reference":"",
"secret_hash":"T1hDaWhlay9NUysxRTA2djFFZnpTVDNU",
"secure":"no",
"secureDetails":"",
"terminal":"67e34d63-102f-4bd1-898e-370781d0074d"
}