Cycle Logo

Direct API Guide

The Cycle REST API is a robust platform that empowers you to seamlessly integrate and customize paywall and billing support tools tailored to your specific needs. These methods are for payment verification, charge/credit processing, and retrieving charge/credit history.

Charges & Credits

Search Charges/Credits

This method retrieves a list of charges or credits based on the filter criteria.

GET /api/v3/charges

Query Parameters

FieldDescription
idThe id of a specific charge / credit. <= 255 characters
customerIdThe merchant provided ID of the customer this charge / credit belong to. <= 255 characters
customerEmailThe Customer Email of charge / credit. <= 255 characters
lgIdThe lgId is the internal system generated long integer id of the charge / credit entity. <= 255 characters
numberOfInstallmentsReturns charges that have installments included. 'all' indicates any number of installments. Examples include "3", "3,4". <= 255 characters
orderStatesReturn only with one of the specified order states. Enum: "SUBMITTED" "CHARGED" "AUTHORIZED" "FUNDS_AUTHORIZED" "REFUNDED" "CHARGED_BACK" "CHARGEBACK_REVERSED" "CREDITED" "CREATED"
createdAfterReturn only created after this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
createdBeforeReturn only created before this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
modifiedAfterReturn only modified after this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
modifiedBeforeReturn only modified before this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
paymentMethodReturn only for the specified payment method. Enum: "VISA" "MASTERCARD" "AMERICAN_EXPRESS" "DISCOVER" "BOLETTO" "IDEAL"
paymentTypeReturn only for the specified payment type. Enum: "CREDIT_CARD" "DEBIT_CARD" "PREPAID_CARD" "BANK_TRANSFER" "VIRTUAL_ACCOUNT" "DIRECT_DEBIT" "CASH" "CHECK" "OFFER" "WALLET" "CARRIER_BILLING"
currencySearch by the currency. Must be a 3-character ISO 4217 currency code e.g. USD.
gatewayProvidedIdSearch by gateway provided ID.
propertiesProperties of the charges / credits to filter. A comma separated list of name/value pairs in the form of "name1=value1,name2=value2".
sortSort result by parameters. A comma separated parameter name and sort direction e.g. lastModified,desc or status,asc
pageStarting index of results to fetch. Default: 0
sizeSize of the block to fetch. Default: 10
includeCountReturn total result set count. Default: false

Example Response

{
  "charges": [],
  "total": 0,
  "size": 10,
  "page": 0,
  "includeCount": true
}

Submit a Charge

This method attempts to charge a customer the specified amount. If the customer does not already exist, a new customer will be created.

POST /api/v3/charges

Request Parameters

FieldRequiredDescription
commandYes“CHARGE”, “AUTHORIZE”, or “VERIFY”
idNoUnique transaction ID specified by the merchant (<= 63 chars). If not provided, one will be generated.
memoNoMerchant-specific metadata for reporting and notifications (<= 255 chars).
propertiesNoJSON object of custom name/value pairs.
lineItemPropertiesNoArray of JSON objects for line-specific properties.
recurrenceNoObject with recurrence details for recurring transactions.
idempotencyIdNoUnique key to prevent duplicate processing on retries (<= 63 chars).
lineItemYesObject containing details of the item being purchased.
customerYesObject containing customer details. A new customer is created if the ID doesn’t exist.
paymentYesObject containing payment method details.
metadataNoObject for optional merchant and processor-specific information.

Example Request

{
 "command": "CHARGE",
 "id": "txn_cycle_demo_001",
 "customer": {
   "id": "customer_123"
 },
 "lineItem": {
   "currency": "ZAR",
   "amount": 25.50,
   "description": "Demo Product"
 },
 "payment": {
   "paymentMethod": "VISA",
   "countryCode": "ZA",
   "accountHolder": "John Doe",
   "cardNumber": "4111111111111111",
   "expirationDate": "2025-12",
   "securityCode": "123",
   "emailAddress": "john.doe@example.com",
   "firstName": "John",
   "lastName": "Doe"
 },
 "metadata": {
     "callbackURL": "https://your-domain.com/notifications",
     "returnURL": "https://your-domain.com/success",
     "failureURL": "https://your-domain.com/failure"
 }
}

Example Response

A 201 status indicates the charge was successfully created; however, it might not have been successfully charged yet. Check the \`status\` field for final confirmation.

{
   "type": "v3_2",
   "id": "txn_cycle_demo_001",
   "LGID": 8722,
   "status": "CHARGED",
   "merchantAccount": "CycleDemo",
   "customer": {
     "id": "customer_123",
     "ipAddress": "103.220.40.188",
     "name": "customer_123",
     "country": "ZA"
   },
   "lineItem": {
     "amount": 25.50,
     "currency": "ZAR",
     "description": "Demo Product"
   },
   "payment": {
     "paymentType": "CREDIT_CARD",
     "paymentMethod": "VISA",
     "firstName": "John",
     "lastName": "Doe",
     "countryCode": "ZA",
     "emailAddress": "john.doe@example.com",
     "cardNumber": "XXXXXXXXXXXX1111",
     "expirationDate": "2025-12"
   },
   "transactions": [],
   "created": "2023-10-27T09:59:58Z",
   "lastModified": "2023-10-27T10:00:00Z"
}

Submit a Credit

This method attempts to credit a customer the specified amount. If the customer does not already exist, a new customer will be created.

POST /api/v3/credits

Request Parameters

FieldRequiredDescription
commandYesFixed as “CREDIT”
idNoUnique transaction ID specified by the merchant (<= 63 chars).
memoNoMerchant-specific metadata (<= 255 chars).
propertiesNoJSON object of custom name/value pairs.
lineItemPropertiesNoArray of JSON objects for line-specific properties.
lineItemYesObject containing details of the item being credited.
customerYesObject containing customer details.
paymentYesObject containing payment method details for the credit.
metadataNoObject for optional merchant and processor-specific information.

Get Charge Details

This API helps to retrieve a charge or credit transaction detail by its merchant-provided ID.

GET /api/v3/charges/{id}

Example Response

{
   "type": "v3_2",
   "id": "txn_cycle_demo_001",
   "LGID": 8722,
   "status": "CHARGED",
   "merchantAccount": "CycleDemo",
   "customer": {
     "id": "customer_123",
     "ipAddress": "103.220.40.188",
     "name": "customer_123",
     "country": "ZA"
   },
   "lineItem": {
     "amount": 25.50,
     "currency": "ZAR",
     "description": "Demo Product"
   },
   "payment": {
     "paymentType": "CREDIT_CARD",
     "paymentMethod": "VISA",
     "firstName": "John",
     "lastName": "Doe",
     "countryCode": "ZA",
     "emailAddress": "john.doe@example.com",
     "cardNumber": "XXXXXXXXXXXX1111",
     "expirationDate": "2025-12"
   },
   "transactions": [],
   "created": "2023-10-27T09:59:58Z",
   "lastModified": "2023-10-27T10:00:00Z"
}

Update a Charge

This method updates an existing Charge by issuing a new command to it, such as settling a previous authorization or issuing a refund.

POST /api/v3/charges/{id}

Request Parameters

FieldRequiredDescription
commandYes“SETTLE”, “AUTH_REVERSAL”, "CANCEL", "REFUND", "CHARGEBACK", "REVERSE_CHARGEBACK"
memoNoOptionally overwrites the memo associated with the charge.
amountNoSpecify the amount to refund for partial refunds.
taxIncludedInPriceNoIndicates if tax is included in the refund amount (default: true).
statusNoForce a specific status (requires special permissions).
propertiesNoAdd, edit, or remove custom properties.
idempotencyIdNoUnique key to prevent duplicate updates on retries (<= 63 chars).
chargebackDetailsNoObject with chargeback reason and code.

Example Response

{
   "type": "v3_2",
   "id": "txn_cycle_demo_001",
   "LGID": 8722,
   "status": "CHARGED",
   "merchantAccount": "CycleDemo",
   "customer": {
     "id": "customer_123",
     "ipAddress": "103.220.40.188",
     "name": "customer_123",
     "country": "ZA"
   },
   "lineItem": {
     "amount": 25.50,
     "currency": "ZAR",
     "description": "Demo Product"
   },
   "payment": {
     "paymentType": "CREDIT_CARD",
     "paymentMethod": "VISA",
     "firstName": "John",
     "lastName": "Doe",
     "countryCode": "ZA",
     "emailAddress": "john.doe@example.com",
     "cardNumber": "XXXXXXXXXXXX1111",
     "expirationDate": "2025-12"
   },
   "transactions": [],
   "created": "2023-10-27T09:59:58Z",
   "lastModified": "2023-10-27T10:00:00Z"
}

Search Tax Invoices

This method retrieves a list of tax invoices stored as part of a specific charge.

GET /api/v3/charges/{id}/taxinvoice

Get Tax Invoice

This method downloads a specific tax invoice for an existing transaction.

GET /api/v3/charges/{id}/taxinvoice/{taxInvoiceId}

Get Refundable Amount

This method retrieves the refundable amount, refundable base line item amount, and refundable tax for a charge.

GET /api/v3/charges/{chargeId}/refundAvailable

Example Response

{
  "chargeId": "cyc_af775a25-fc49-47b3-9287-27b83efff622",
  "refundableAmount": 13.57,
  "refuntableBasLineItemAmount": 12.34,
  "refundableTaxAmount": 1.23,
  "refundable": true
}

Bulk Payments

Get Bulk Payment Records

Returns all bulk payment records that match the specified search criteria.

GET /api/v3/bulkpayment

Query Parameters

FieldDescription
merchantAccountIdMerchant's id.
merchantAccountNameMerchant's name.
createdAfterReturn only created after this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
createdBeforeReturn only created before this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
modifiedAfterReturn only modified after this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
modifiedBeforeReturn only modified before this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
batchIdBatch id.
statusEnum: "SUBMITTED" "ACCEPTED" "ERROR". A status represent the result of processing request file.
pageStarting index of results to fetch. Default: 0
sizeSize of the block to fetch. Default: 10
includeCountReturn total result set count. Default: false

Example Response

{
  "bulkPaymentRecords": [],
  "size": 0,
  "page": 0,
  "includeCount": true,
  "total": 0
}

Get Bulk Payment Details

Returns all bulk payment details that match the specified search criteria.

GET /api/v3/bulkpayment/detail

Query Parameters

FieldDescription
merchantAccountIdMerchant's id.
merchantAccountNameMerchant's name.
createdAfterReturn only created after this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
createdBeforeReturn only created before this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
modifiedAfterReturn only modified after this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
modifiedBeforeReturn only modified before this date. ISO-8601 format YYYY-MM-DDThh:mm:ssZ
batchIdBatch id.
requestIdRequest id.
purchaseRecordIdPurchase record Id
statusEnum: "ACCEPTED" "ERROR". A status represent the result of processing request file.
pageStarting index of results to fetch. Default: 0
sizeSize of the block to fetch. Default: 10
includeCountReturn total result set count. Default: false

Example Response

{
  "bulkPaymentDetails": [],
  "size": 0,
  "page": 0,
  "includeCount": true,
  "total": 0
}

Configuration

Get Configuration

Returns the merchant's account configuration settings.

GET /api/v3/configuration

Example Response

{
  "value": {
    "defaultCountry": "US",
    "defaultLanguage": "en",
    "requireStateOrProvince": false,
    "requireCountry": false,
    "requireEmail": false,
    "requirePostalCode": false,
    "rapidCheckoutEnabled": true,
    "chargeNotificationURLs": [],
    "properties": {},
    "readOnly": {},
    "defaultTaxModel": "TAX_INCLUDED",
    "defaultTaxCode": "DG",
    "disableMailSending": true,
    "allowTransactionWithFailedTaxQuote": true
  }
}

Get Country List

Returns a list of all countries (in ISO-2 format) that have at least one active payment method.

GET /api/v3/countries

Example Response

{
  "countries": [{}, {}, {}]
}

Get Exchange Rates

This API finds the exchange rate between two currencies. Rates are cached for 8 hours.

GET /api/v3/exchangerates

Example Response

{
  "fromCurrency": "USD",
  "toCurrency": "EUR",
  "exchangeRate": 0.8047965168952942
}

Get Payment Methods

Retrieves data about all payment methods that meet the search criteria.

GET /api/v3/paymentmethods

Example Response

{
  "paymentMethods": [{}]
}

Get Payment Methods and Profiles

Retrieves payment methods and stored payment profiles matching the criteria.

GET /api/v3/paymentmethodsspp

Example Response

{
  "paymentMethods": [{}, {}, {}, {}],
  "paymentProfiles": [{}, {}]
}

Customer Management

Add Customer

Adds a new customer record in the database. The API returns HTTP Status 201 on success.

POST /api/v3/customers

Example Request

{
 "id": "customer_123456",
 "personalInfo": {
   "email": "foo@bar.com",
   "address": {}
 }
}

Example Response

{
 "id": "customer_123456",
 "status": "ENABLED",
 "createdTime": "2014-11-12T04:22:53Z",
 "lastActivityTime": "2014-11-12T04:22:53Z",
 "customerType": "B2B",
 "personalInfo": {
   "firstName": "Jane",
   "lastName": "Doe",
   "dob": "1991-10-29",
   "email": "foo@bar.com",
   "document": "XXXXXXXXXXX8912",
   "documentType": "GSTID",
   "address": {}
 },
 "fraud": {
   "blocked": false,
   "trustLevel": "NEW_CUSTOMER"
 },
 "properties": {
   "Name": "value",
   "Name2": "Value2"
 },
 "paymentProfiles": []
}

Search Customers

Finds all customers matching the specified search criteria.

GET /api/v3/customers

Query Parameters

FieldDescription
idCustomer ID (3-64 characters).
statusFilter by customer status. Enum: "ENABLED", "DISABLED", "DELETED".
nameFilter by customer's full name (3-64 characters).
firstNameFilter by customer's first name (3-64 characters).
lastNameFilter by customer's last name (3-64 characters).
emailFilter by email address.
cityFilter by city.
stateProvinceFilter by state or province.
postalCodeFilter by postal code.
countryFilter by 2-letter ISO 3166 country code.
propertiesEncoded, comma-separated list of name-value pairs (e.g., "name1=value1%2Cname2=value2").
trustLevelFilter by trust level. Enum: "UNTRUSTED_CUSTOMER", "RESTRICTED_CUSTOMER", "NEW_CUSTOMER", "STANDARD_CUSTOMER", "TRUSTED_CUSTOMER", "UNRESTRICTED_CUSTOMER".
blockFilter by whether the customer has a fraud block or not.
lgIdInternal system generated long integer id of the customer entity (<= 255 characters).
pageStarting index of results to fetch. Default: 0.
sizeSize of the block to fetch. Default: 10.
includeCountReturn total result set count. Default: false.

Example Response

{
 "customers": [
    {
 "id": "customer_123456",
 "status": "ENABLED",
 "createdTime": "2014-11-12T04:22:53Z",
 "lastActivityTime": "2014-11-12T04:22:53Z",
 "customerType": "B2B",
 "personalInfo": {
   "firstName": "Jane",
   "lastName": "Doe",
   "dob": "1991-10-29",
   "email": "foo@bar.com",
   "document": "XXXXXXXXXXX8912",
   "documentType": "GSTID",
   "address": {}
 },
 "fraud": {
   "blocked": false,
   "trustLevel": "NEW_CUSTOMER"
 },
 "properties": {
   "Name": "value",
   "Name2": "Value2"
 },
 "paymentProfiles": []
}
  ]
}

Update Customer

Updates an existing customer record. This is a partial update; only included fields will be modified.

POST /api/v3/customers/{id}

Customer Block

To block a customer, populate the \`fraud\` object. Set \`blocked\` to false to unblock.

{
  "fraud": {
    "blocked": "true",
    "blockExpireDate": "2024-12-31T23:59:59Z",
    "comments": "Suspicious activity"
  }
}

Example Request

{
 "personalInfo": {
   "email": "foo@bar.com",
   "address": {}
 }
}

Example Response

{
 "id": "customer_123456",
 "status": "ENABLED",
 "createdTime": "2014-11-12T04:22:53Z",
 "lastActivityTime": "2014-11-12T04:22:53Z",
 "customerType": "B2B",
 "personalInfo": {
   "firstName": "Jane",
   "lastName": "Doe",
   "dob": "1991-10-29",
   "email": "foo@bar.com",
   "document": "XXXXXXXXXXX8912",
   "documentType": "GSTID",
   "address": {}
 },
 "fraud": {
   "blocked": false,
   "trustLevel": "NEW_CUSTOMER"
 },
 "properties": {
   "Name": "value",
   "Name2": "Value2"
 },
 "paymentProfiles": []
}

Get Customer

Returns information about an individual customer by their ID.

GET /api/v3/customers/{id}

Example Response

{
 "id": "customer_123456",
 "status": "ENABLED",
 "createdTime": "2014-11-12T04:22:53Z",
 "lastActivityTime": "2014-11-12T04:22:53Z",
 "customerType": "B2B",
 "personalInfo": {
   "firstName": "Jane",
   "lastName": "Doe",
   "dob": "1991-10-29",
   "email": "foo@bar.com",
   "document": "XXXXXXXXXXX8912",
   "documentType": "GSTID",
   "address": {}
 },
 "fraud": {
   "blocked": false,
   "trustLevel": "NEW_CUSTOMER"
 },
 "properties": {
   "Name": "value",
   "Name2": "Value2"
 },
 "paymentProfiles": []
}

Payment Profiles

Add Payment Profile

Adds a new payment profile, or updates an existing one based on payment information.

POST /api/v3/paymentprofiles

Request Parameters

FieldRequiredDescription
idNoMerchant provided id to uniquely identify the transaction (<= 63 chars).
nameNoThe customer facing name of the payment profile.
memoNoNon-customer facing merchant metadata about this payment profile.
customerIdYesUnique id to identify the customer of merchant (<= 63 chars). A customer record with this ID must already exist.
supportsCashInNoIndicates if the stored payment profile supports cash in.
supportsCashOutNoIndicates if the stored payment profile supports cash out.
defaultCurrencyNoISO 4217 three-letter currency code (e.g., USD).
paymentYesThe payment object with details for the new profile.
metadataNoOptional merchant and processor specific information.
propertiesNoCustom name/value pairs.

Search Payment Profiles

Returns all payment profiles that match the specified search criteria.

GET /api/v3/paymentprofiles

Query Parameters

FieldDescription
nameThe exact name of payment profile. (<= 255 characters)
customerIdA single customer id. (<= 255 characters)
expirationDateExpiration Date of credit card in MMYY, MMYYYY or YYYY-MM format. (4-6 characters)
memoThe merchant defined memo field. (<= 255 characters)
methodTypeEnum: "CREDIT_CARD", "DEBIT_CARD", "PREPAID_CARD", "BANK_TRANSFER", etc.
pageStarting index of results to fetch. Default: 0.
sizeSize of the block to fetch. Default: 10.
includeCountReturn total result set count. Default: false.

Get Payment Profile

Retrieves a payment profile by its ID.

GET /api/v3/paymentprofiles/{id}

Get Temporary Payment Profile

Retrieves a payment profile using a random, expiring ID assigned at creation.

GET /api/v3/paymentprofiles/temp/{id}

Update Payment Profile

Updates an existing payment profile. This is a partial update.

POST /api/v3/paymentprofiles/{id}

Request Parameters

FieldRequiredDescription
nameNoThe customer facing name of the payment profile.
memoNoNon-customer facing merchant metadata about this payment profile.
propertiesNoJSON object of custom name/value pairs.
paymentYesThe payment object with details to update.

Delete Payment Profile

Deletes a payment profile by its ID.

DELETE /api/v3/paymentprofiles/{id}

Request KYC Validation

Requests KYC validation for a payment profile.

POST /api/v3/paymentprofiles/{id}/kycverification

Complete KYC Validation

Completes the KYC validation process with the micro-deposit amounts.

POST /api/v3/paymentprofiles/{id}/kyccompletion

Request Body

FieldRequiredDescription
kycAmount1YesThis value is inputted by customer for kyc validation.
kycAmount2YesThis value is inputted by customer for kyc validation.

Installments

Search Installments

Looks up installment information for a BIN and returns `BinInfoDto`.

GET /bin/installmentinfo

Query Parameters

FieldDescription
binNumberSelect BIN installment data matching the binNumber. (e.g. 411111)
countryCodeSelect installment data matching the country. (e.g. BR)
amountThe transaction amount used to calculate installment amounts. (e.g. 123.45)

Example Response

{
  "bin": "411111",
  "country": "BR",
  "methods": [{}],
  "installmentPlans": [{}]
}

Validation History

Search KYC Validations

Fetches KYC validation details associated with stored payment profiles.

GET /kycverifications

Query Parameters

FieldDescription
storedPaymentProfileIdThe ID of payment profile.
customerIdA single customer id.
statusA status represent the result of handling kyc completion. (Enum: "APPROVED", "DECLINED")
pageStarting index of results to fetch. Default: 0
sizeSize of the block to fetch. Default: 10
includeCountReturn total result set count. Default: false

Example Response

{
  "kycValidations": [],
  "total": 0,
  "size": 0,
  "page": 0,
  "includeCount": false
}

Monitoring

API Monitoring

You can monitor whether Cycle is running in a healthy state and whether notifications to your servers are succeeding using the monitoring APIs.

Get Health Check

Returns service health status information. Any return value other than a HTTP Status 200 OK should be investigated.

GET /healthcheck

Example 503 Response

{
  "code": "SERVICE_UNAVAILABLE"
}

Get Notification Queue

Returns the number of notifications that have failed within the last 10 minutes. Any value other than 0 can indicate a problem.

GET /healthcheck/notificationqueue

Example Response

{
  "abortedTransactions": 3
}

Price Points

Search Price Points

For fixed-priced payment methods like mobile payment providers, this API allows fetching the available price points. This method retrieves the available price points for the specified fixed-price payment method, country and currency.

GET /pricepoints

Query Parameters

FieldRequiredDescription
methodYesThe fixed-price payment method (e.g., BOKU or ZONG)
countryYesThe ISO country code
currencyYesThe ISO currency code

Example Response

{
  "method": "BOKU",
  "country": "FR",
  "currency": "EUR",
  "pricePoints": [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]
}