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
Name | Type | Mandatory | Description |
---|---|---|---|
auth | object | Yes | Authorization data |
auth.point | integer | Yes | This is your point_id from the credentials you received earlier |
auth.key | integer | Yes | Session key generated on the merchant's side. You can use unixtime as a key value |
auth.hash | string | Yes | md5 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
Name | Type | Mandatory | Max. length | Description |
---|---|---|---|---|
locale | string | Yes | 2 | Language of the payment page. Allowed values: en , ua , ru , pt , fr , es |
service_id | integer | Yes | Payment gateway service ID. Provided by the Payonhost manager | |
account_id | integer | Yes | Merchant account ID in the payment gateway. Provided by the Payonhost manager | |
wallet_id | integer | Yes | Merchant wallet ID in the payment gateway. Provided by the Payonhost manager | |
customer_ip_address | string | Yes | 45 | Client'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_id | string | No | 48 | Order ID in the merchant system. It is allowed to create multiple transactions with the same external_order_id |
external_customer_id | string | Yes | 99 | Client 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 |
amount | integer | Yes | Payment amount, in the minimum currency units (kopecks, cents, etc.). For example, for 3.2 USD, you need to pass the 320 value | |
amount_currency | string | Yes | 6 | Payment currency (3-letter ISO 4217 code). For example: UAH, USD, EUR |
point | object | No | A set of point parameters for payment creation. The parameters, that could possibly be passed inside of the point object are presented below | |
point.callback_url | string | No | 1000 | URL 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
Name | Type | Mandatory | Max. length | Description |
---|---|---|---|---|
fields | object | Yes | Set of parameters for transaction creation | |
fields.name | string | Yes | 40 | Payer's name |
fields.phone | string | Yes | 12 | Payer'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).
Name | Type | Description |
---|---|---|
id | integer | Identifier of the created transaction in the payment gateway |
is_test | boolean | Flag indicating whether the transaction is a test one. Automatically affixed to all transactions created using a merchant's test account |
status | integer | Transaction status (see Status reference) |
status_description | string | Description of payment status |
Response example
Response: /transaction/pay
{
"error": {
"code": 0,
"title": "Success"
},
"response": {
"id": 1234567890,
"is_test": false,
"status": 1,
"status_description": ""
}
}