Using Our APIs
Information Requests
Query Contract
7 min
purpose returns information relating to any contractual term applied to the sim specified in the \<iccid> element this allows you to determine whether a contract is active the type of contract applied how many calendar months remain if no contract is associated with the sim, both response elements will be returned empty endpoint post https //api m2miportal com content type application/xml accept application/xml request (xml) \<query contract version="1" api id="123456"> \<authentication> \<username>username\</username> \<password>password\</password> \</authentication> \<iccid>1234567890123456789\</iccid> \</query contract> response (success) \<query contract response api id="123456"> \<api outcome>success\</api outcome> \<contract type>1\</contract type> \<months remaining>5\</months remaining> \</query contract response> response elements element description \<contract type> single digit integer 1 or 2 \<months remaining> integer representing the number of calendar months remaining on the contract if 0, the contract term has expired if the sim has no contract associated with it, both elements will be returned empty contract types contract type 1 — minimum term sims cannot be moved to another group or closed until the contract period has expired many groups operate with a minimum term of one month, meaning the sim must remain in the group until the calendar month has completed contract type 2 — fixed term typically includes an initial fee runs for a fixed period group moves are not permitted during the contract period at the end of the period, the sim is automatically deactivated behaviour notes contracts are evaluated against calendar months \<months remaining> is decremented at midnight utc at the start of each new calendar month a value of 0 indicates that the contract term has expired response (failure) if a request cannot be processed, the response will include api outcome indicating failure an error description explaining the reason failure responses may occur due to invalid authentication credentials invalid or unknown identifiers (for example iccid or msisdn) invalid or missing parameters values not permitted for the specified sim type or account configuration insufficient permissions integrating systems should validate input data before submission and implement appropriate error handling and logging