Cycle Logo

Prepare Payment

Use the Prepare method to automatically populate payment fields by retrieving required data from partner services.

Endpoint

POST /api/v1/payment/prepare

The response will return a JSON object containing all necessary field values to proceed with payment. All requests must be authorised.

Request Body Definitions

Field NameTypeDescription
LocationJsonObjectLocation object
LatitudeIntegerLatitude
LongitudeIntegerLongitude
CountryStringCountry
CountryCodeStringISO country code
DeviceInfoJsonObjectDevice object
PhoneManufacturerStringDevice manufacturer
PhoneModelStringDevice model
DeviceIDStringUnique device ID
DeviceTypeStringDevice type
AppFrameworkStringApplication framework
OSStringOperating system
OSVersionStringOS version
AppIDStringApplication ID
BuildNumberStringApp build number
GMTIntegerTime zone offset (GMT)
AppFrameworkStringApplication framework
LangStringLanguage code (e.g. "en")
PrepareFieldsObject ArrayProduct fields for preparation
NameStringProduct field code
ValueStringProduct field value
ProductDescCodeStringProduct description code
ClientProductCodeStringClient application product code
CurrentAccountIDIntegerAgent account ID
IPStringIP 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 NameTypeDescription
TransactionIDStringUnique transaction ID assigned by the Cycle system
EMVOnlineProcessingResultStringResult of the EMV processing returned in TLV format
AdditionalAcquiringFieldsJson ObjectExtra fields required for acquiring
AdditionalAcquiringFieldsTitleStringTitle or label for additional acquiring fields
TerminalNameStringName or identifier of the terminal used
EMVDataJson ObjectObject containing EMV transaction data
RequireSignatureBooleanIndicates whether a signature is required
TransactionJson ObjectComplete transaction object (as returned by transaction creation)
ErrorCodeIntegerResult code indicating execution status
ErrorMessageStringMessage explaining the result or error (if any)
ValidationsArrayArray of progress or validation checks
TypeIntegerType of validation performed
PropertyStringName of the field or property being validated
CodeIntegerResult code for the specific validation
MessageStringMessage describing the outcome of the validation
PreparedFieldsArrayList of fields returned after preparation
CodeIntegerField code representing the product field
ValueStringCorresponding 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
}