P2P – transfers
Receiving a token for payment (for each operation you must receive and use the original token)
URL of the request to receive a token
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" client_id: "test" client_secret: "yF587AV9Ms94qN2QShFzVR3vFnWkhjbAK3sG" invoiceID: "000000001" amount: 100 currency: "KZT" terminal: "c36b282f-6819-4d4f-85df-a4bdc8a8f703" postLink: "" failurePostLink: ""
Field | Description |
---|---|
grant_type | Аuthorization type, client_credentials are used for payment processing |
scope | Resource |
client_id | Merchant id, can be obtained on the account page, first given when registered |
client_secret | Merchant's access key, can be obtained on the account page, first given when registered |
invoiceID | The order 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, then additional uniqueness must be maintained in the last 6 characters |
amount | Order Amount |
currency | Currency |
terminal | Sale point's id (can be obtained on the account page, first given when registered) |
postLink | Optional parameter, sends postlink in case of success |
failurePostLink | Optional parameter, sends postlink in case of failure |
Response
{
"access_token":"DCEB8O_ZM5U7SO_T_U5EJQ",
"expires_in": 7200,
"refresh_token":"",
"scope":"transfer",
"token_type":"Bearer"
}
Field | Description |
---|---|
access_token | Token for payment processing |
expires_in | Expiry time |
refresh_token | Not used in current type of request |
scope | Resource, in order to process a payment "payment" resouce is used |
token_type | Type of the token |
After receiving the token, you need to transfer it to the Headers Bearer at the endpoint:
TEST URL POST https://testepay.homebank.kz/api/payments/cards/auth PROD URL POST https://epay-api.homebank.kz/payments/cards/auth
Making a transfer using saved cards
The card is saved if earlier, when making payments or transfers, you passed the card save: true parameter, the payment was successful and you received the CardID in the response.
Transfer to a saved card with the sender's card saved
{
"order": {
"amount": 100,
"currency": "KZT",
"description": "Test p2p payment",
"id": "8161284658529816",
"accountID": "testUser1",
"senderEmail": "dosbols@halykbank.kz",
"terminalId": "40a348cb-68a3-45d5-9002-a4836d79c3b5",
"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": true,
"transferType": "TYPEPAN",
"cvc": "815",
"expire": {
"month": "01",
"year": "25"
},
"name": "Arman Ali",
"cardCred": "4405639704015096"
},
"receiver": {
"cardCred": "fcf69516-f7e8-9b14-e053-1d1a000aef2f",
"transferType": "TYPECARDID",
}
}
}
Field | Description |
---|---|
order | A set of transaction parameters |
amount | Transfer amount |
currency | Currency |
description | Additional information about the transaction |
accountId | A field for specifying the store's customer ID, required when saving the card |
Id | Order number |
senderEmail | Sender's email |
terminalId | The identifier of the point of sale (terminal ID), which can be obtained in the cabinet, is issued during registration |
backLink | Link to return to the store upon successful payment |
failureBackLink | Link to return to the store in case of a failed payment |
postLink | URL to which the callback will be sent upon successful payment |
failurePostLink | URL to which the callback will be sent in case of unsuccessful payment |
sender | A set of sender parameters |
save | Saving the map |
transferType | The type of transfer, when TYPEPAN is passed empty |
cardCred | card number with TYPECARD, card id with TYPECARDID |
CVC | CVC card, with TYPEPAN is passed empty |
expire | Card expiration date |
receiver | The set of parameters of the recipient |
cardCred | PAN card (the type of data specified depends on the transferType parameter) |
Response in an event of success:
{ "id": "84d22915-f77f-491a-801c-aeb1b3b3bb36", "amount": 100, "fee": 95, "accountID": "testUser1", "currency": "KZT", "email": "dosbols@halykbank.kz", "description": "TEST p2p", "reference": "403752583641", "orderID": "8161284658529816", "senderCardID": "10606a85-ffca-b6b3-e063-1d1a000a2f3d", "senderCardPAN": "440563...5096", "senderCardType": "VISA", "senderTransferType": "TYPEPAN", "receiverCardID": "fcf69516-f7e8-9b14-e053-1d1a000aef2f", "receiverCardPAN": "440563...7622", "receiverCardType": "VISA", "receiverTransferType": "TYPECARDID", "intReference": "C2679A7844D3A007", "terminalID": "40a348cb-68a3-45d5-9002-a4836d79c3b5", "status": "CHARGE" }
Field | Description |
---|---|
Id | Transaction ID |
amount | Transfer amount |
fee | The amount of the commission (not used) |
account ID | Field for specifying the store's customer ID, required when saving the card |
currency | Currency |
The email address specified during the data transfer | |
description | Additional information about the transaction |
reference | Unique transaction ID |
orderId | The order number transmitted earlier |
senderCardID | Sender's card ID |
senderCardPAN | Sender's bank card |
senderTransferType | Type of transfer using the sender's card |
receiver Card ID | Recipient's card ID |
receiver Card PAN | Recipient's card PAN |
receiver Card Type | Type of transfer using the recipient's card |
receiver Transfer Type | Payment system of the recipient's card |
int Reference | Additional unique transaction identifier |
terminal Id | Point of sale Identifier (Terminal ID) |
status | Transfer status |
Response in case of error:
{
"code": 487,
"message": " Not permitted to merchant",
"invoiceId": "8161284658529816",
"id": "",
"reference": "",
"accountId": "uuid000001"
}
Field | Description |
---|---|
code | Error code |
message | A message describing the cause of the error |
invoice Id | Order number transmitted earlier |
id | Transaction ID |
reference | Unique transaction ID |
account Id | Field for specifying the store's customer ID |