MOR API card payment add

From Kolmisoft Wiki

Jump to: navigation, search


[edit] Description

MOR API adds payment to the Calling Card.

[edit] Usage

  • From MOR X4 call: /api/card_payment_add.
  • Methods: POST, GET (if allowed, not recomended).

[edit] Parameters

Parameters which are included into hash:

  • description - description of the payment that is visible in Payments list.
  • number - Calling Card number. Required.
  • amount - default 0.
  • currency - if not specified - system's default.

Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key

Parameters which are not included into hash:

  • hash - SHA1 hash constructed using parameters above and API_Secret_Key ( More described in Constructing hash). Required (if setting Disable hash checking is not checked).
  • u - username for authentication. Required.

[edit] Request

We have card number 1111111001, API Secret Key = 456789 and want to add 5 EUR to the card.

We send:

HTML POST: http://<SERVER_IP>/billing/api/card_payment_add?u=username&number=1111111001&amount=5&currency=EUR&description=text&hash=d6ce58f8a1ea56ff075c16c45b3e1714298a14d7

NOTE that username is not included in hash

[edit] Returns


<?xml version="1.0" encoding="UTF-8"?>
    <success>Calling Card balance successfully updated</success>


  • <error>Access Denied</error> - such user was not found.
  • <error>Incorrect hash</error> - hash is incorrect.
  • <error>Calling Card was not found</error> - such Calling Card does not exist or user is not authorised to use this API or specific card belongs to another user.
  • <error>Currency disabled</error> - you can not use disabled/not enabled currencies.
  • <error>Feature Disabled</error> - you need to enable API payments in API settings.

[edit] See also

Personal tools


Try M2