ModularMerchant
Knowledge Base
Shopping Cart Software Online Manual
"Encrypt Text" API
"Get Customers" API "Edit Customer" API
Location Home > Developer's Guide > APIs

"Encrypt Text" API

this article last updated: March 9, 2015
Due to inevitable changes that will be made to the shopping cart software over time, the cart's variable and database structure may change from time to time without advanced notice. We will attempt to keep the information in this article up-to-date, but Modular Merchant makes no guarantee as to the accuracy of the information provided in this article. Use this information at your own risk.

Modular Merchant Gold (and higher) account plans have access to a "Encrypt Text" API that allows a remotely-hosted website to submit a string of text, and receive an encrypted version of it back.

All requests to retrieve order data should be submitted to the "Encrypt Text" API URL, located in your online store. An example of the URL for this API would look something like this: http://www.mystore.com/api/encrypt_text.php

tip
To learn more about the cart's APIs (how requests should be structured, a sample query using PHP, etc.) we recommend looking over the Introduction to APIs article.
 
Request and Response Structure

The "Encrypt Text" API expects to receive several variables. The requests sent to it should not be in XML format. The variables posted to the API include:

search options
admin_sid: The SID number of the admin submitting the query.

admin_key: The personal API Key of the admin submitting the query. (Found on the Admin Account Editor page.)

api_key: The account-wide API Key. (Found on the System Settings page.)

text: The text string to be encrypted.

The API will reply with a response containing either the encrypted text, or any error message that was encountered.

request example
Following is an example of a script that could be used to submit an encryption request to a store's "Encrypt Text" API:

<?php
$store_url = 'http://www.mystore.com/api/encrypt_text.php';
$admin_sid = '123';
$admin_key = 'B8lk9AkTANfH4bbGHvOG3HBF9NnbQH';
$api_key = '9c1bc41x15423a1c9be51d621a74b2fd';
$text = 'Hello World!';

$curl_data = '
admin_sid='.$admin_sid.
             '&admin_key='.$admin_key.
             '&api_key='.$api_key.
             '&text='.$text;

$ch = curl_init();
if($ch) {
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_HEADER, false);
     curl_setopt($ch, CURLOPT_URL, $store_url);
     curl_setopt($ch, CURLOPT_POST, true);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_data);
     $response = curl_exec($ch);
     if($response === false) {
         //error
     }
     curl_close($ch);
}
echo($response);
?>

 

response example
If no errors are encountered, then the API would respond with the encrypted version of the submitted text, which would look something like this:

0955570k23hdd2b243b8df19849f8a5c48014718


— Last Edited - 03/9/2015 8:36am PDT
Related Articles
"Decrypt Text" API

Category: Developer's Guide
Rank and add a comment to this article
Only logged in users may leave comments and rank articles. Log in to have your say!
  Knowledge Base Home

  QuickCode™ Tag Glossary

  Modular Merchant.com Homepage

Not Logged in.
Either Log in or create a User Account.

Other articles in this category...

Introduction to APIs

"Remote Membership Validation (RMV)" API

"Get Orders" API

"Get Customers" API

"Encrypt Text" API

"Edit Customer" API

"Decrypt Text" API

"Check Customer" API