Prepare Payment
Use the Prepare method to automatically populate payment fields by retrieving required data from partner services.
Endpoint
POST /api/v1/payment/prepareThe response will return a JSON object containing all necessary field values to proceed with payment. All requests must be authorised.
Request Body Definitions
| Field Name | Type | Description |
|---|---|---|
Location | JsonObject | Location object |
Latitude | Integer | Latitude |
Longitude | Integer | Longitude |
Country | String | Country |
CountryCode | String | ISO country code |
DeviceInfo | JsonObject | Device object |
PhoneManufacturer | String | Device manufacturer |
PhoneModel | String | Device model |
DeviceID | String | Unique device ID |
DeviceType | String | Device type |
AppFramework | String | Application framework |
OS | String | Operating system |
OSVersion | String | OS version |
AppID | String | Application ID |
BuildNumber | String | App build number |
GMT | Integer | Time zone offset (GMT) |
AppFramework | String | Application framework |
Lang | String | Language code (e.g. "en") |
PrepareFields | Object Array | Product fields for preparation |
Name | String | Product field code |
Value | String | Product field value |
ProductDescCode | String | Product description code |
ClientProductCode | String | Client application product code |
CurrentAccountID | Integer | Agent account ID |
IP | String | IP address of the request |
Example Request
{
"Location": {
"Latitude": -29,
"Longitude": 24
},
"Country": "South Africa",
"CountryCode": "ZA",
"DeviceInfo": {
"PhoneManufacturer": "Company",
"PhoneModel": "Windows_RestAPI",
"DeviceID": "",
"DeviceType": "1",
"AppFramework": "java",
"OS": "Windows",
"OSVersion": "10",
"AppID": "RestAPI",
"BuildNumber": "2.4.390248"
},
"GMT": 2,
"AppFramework": "java",
"IP": "102.165.45.120",
"Lang": "en",
"ProductDescCode": "Insurance",
"PrepareFields": [
{
"Name": "AmountClient",
"Value": "1"
},
{
"Name": "OrderId",
"Value": "7954"
}
]
}Response Body Definitions
| Field Name | Type | Description |
|---|---|---|
TransactionID | String | Unique transaction ID assigned by the Cycle system |
EMVOnlineProcessingResult | String | Result of the EMV processing returned in TLV format |
AdditionalAcquiringFields | Json Object | Extra fields required for acquiring |
AdditionalAcquiringFieldsTitle | String | Title or label for additional acquiring fields |
TerminalName | String | Name or identifier of the terminal used |
EMVData | Json Object | Object containing EMV transaction data |
RequireSignature | Boolean | Indicates whether a signature is required |
Transaction | Json Object | Complete transaction object (as returned by transaction creation) |
ErrorCode | Integer | Result code indicating execution status |
ErrorMessage | String | Message explaining the result or error (if any) |
Validations | Array | Array of progress or validation checks |
Type | Integer | Type of validation performed |
Property | String | Name of the field or property being validated |
Code | Integer | Result code for the specific validation |
Message | String | Message describing the outcome of the validation |
PreparedFields | Array | List of fields returned after preparation |
Code | Integer | Field code representing the product field |
Value | String | Corresponding value to be used for that field |
Example Response
{
"PreparedFields": [
{
"Code": "ProductName",
"Value": "1.00"
},
{
"Code": "Amount",
"Value": "1.00"
},
{
"Code": "AgreementNumber",
"Value": "36829187"
},
{
"Code": "StartDate",
"Value": "29-08-2018"
}
],
"TransactionID": null,
"EMVOnlineProcessingResult": null,
"AdditionalAcquiringFields": null,
"AdditionalAcquiringFieldsTitle": null,
"TerminalName": null,
"EMVData": null,
"RequireSignature": false,
"Transaction": null,
"ErrorCode": 0,
"ErrorMessage": null,
"Validations": null
}