Skip to main content

Cash PayIn

Cash is a payment method for transferring funds to the company's branches. In Payonhost, the Cash In method allows you to make a payout using cash through a company representative.

Create transaction

To create a transaction, use the /transaction/pay method.

Request parameters

Authorization parameters

NameTypeMandatoryDescription
authobjectYesAuthorization data
auth.pointintegerYesThis is your point_id from the credentials you received earlier
auth.keyintegerYesSession key generated on the merchant's side. You can use unixtime as a key value
auth.hashstringYesmd5 hash of a string obtained by concatenating point_id, api_token and key: md5(point + api_token + key)
An example of a correctly calculated hash (the data in the example is random):
point_id = 111
key = 1234
api_token = aiGha$et0ainah4%*eu9Vish8oo
Correct hash: fda3ff2903690ed6795ea997a8cc1773

Request parameters - general

NameTypeMandatoryMax. lengthDescription
localestringYes2Language of the payment page. Allowed values: en, ua, ru, pt, fr, es
service_idintegerYesPayment gateway service ID. Provided by the Payonhost manager
account_idintegerYesMerchant account ID in the payment gateway. Provided by the Payonhost manager
wallet_idintegerYesMerchant wallet ID in the payment gateway. Provided by the Payonhost manager
customer_ip_addressstringYes45Client's IP address. Both IPv4 and IPv6 addresses are allowed. It is important to send the client's real ip to avoid false positives of the anti-fraud system
external_order_idstringNo48Order ID in the merchant system. It is allowed to create multiple transactions with the same external_order_id
external_customer_idstringYes99Client ID in the merchant's system. Used for improvement of the transaction's search during incidents analysis, as well as for improvement of operation of the anti-fraud system
If such a parameter is absent in the system, it is necessary to send an alternative value for payer's identification, for example: mobile phone number or email
amountintegerYesPayment amount, in the minimum currency units (kopecks, cents, etc.). For example, for 3.2 USD, you need to pass the 320 value
amount_currencystringYes6Payment currency (3-letter ISO 4217 code). For example: UAH, USD, EUR
pointobjectNoA set of point parameters for payment creation. The parameters, that could possibly be passed inside of the point object are presented below
point.callback_urlstringNo1000URL for the callbacks transmission to the merchant. See the Callbacks section for details. The parameter may be absent in the request. Although, if it was passed, then its value cannot be empty. Parameter's value should also be valid, and lead not to an IP from the local network. The same condition applies to other URLs

Request parameters - fields for creating a transaction

NameTypeMandatoryMax. lengthDescription
fieldsobjectYesSet of parameters for transaction creation
fields.namestringYes40Payer's name
fields.phonestringYes12Payer's phone number

Below is an example of the application of this method.

Request example

Request: /transaction/pay
{
"auth": {
"point": 111,
"key": 1234,
"hash": "fda3ff2903690ed6795ea997a8cc1773"
},
"locale": "en",
"external_order_id": "100",
"external_customer_id": "123",
"customer_ip_address": "0.0.0.0",
"account_id": 123,
"wallet_id": 123,
"service_id": 123,
"amount": 150,
"amount_currency": "UAH",
"point": {
"callback_url": "https://your.server.callback.url"
},
"fields": {
"name": "John Doe",
"phone": "+380123456789"
}
}

Response parameters

The table contains a description of the parameters that are returned inside the response object (see Response structure).

NameTypeDescription
idintegerIdentifier of the created transaction in the payment gateway
is_testbooleanFlag indicating whether the transaction is a test one. Automatically affixed to all transactions created using a merchant's test account
statusintegerTransaction status (see Status reference)
status_descriptionstringDescription of payment status

Response example

Response: /transaction/pay
{
"error": {
"code": 0,
"title": "Success"
},
"response": {
"id": 1234567890,
"is_test": false,
"status": 1,
"status_description": ""
}
}