MSD

Developer Hub

Next-Gen
Payments
Commerce
integration

We are here 24/7, keeping an eye on things and making sure everything runs smoothly.

Subscriptions API

Sandbox endpoint URL:

https://gateway2-stg.merchantservicedepot.com/apis/{method}

Example:

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

Production endpoint URL:

https://portal.merchantservicedepot.com/apis/{method}

Add Plan API

This API is responsible for creating new plan.

Method of form submission

POST

URL to call

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

The table describes the request parameters for Add Plan API.

Variable NameDescriptionRequiredExpected Values
usernameMSD Gateway UsernameYMSD Gateway Username
api_keyMSD Gateway API KeyYMSD Gateway API Key
plan_nameThe Plan NameYPlan Name
period_typePeriod TypeYWEEKLY, FORTNIGHTLY, MONTHLY, QUARTERLY, YEARLY
amountAmount to be chargedY115.45
currencyCurrency of Transaction (allowed currencies will be determined during the time of merchant onboarding).YUSD, EUR, GBP, CAD, AUD, NZD, AED, DKK, MXN, SEK, CHF
no_of_chargeNo of times to chargeYNo of charge should be greater than 0

Example

<form name="" action="https://portal.merchantservicedepot.com/apis/add_plan.php" method="post" >
  <input type="text" name="username" value="msdusername"/>
  <input type="text" name="api_key" value="msdapikey"/>
  <input type="text" name="plan_name" value="planname"/>
  <input type="text" name="period_type" value="WEEKLY"/>
  <input type="text" name="amount" value="115.45"/>
  <input type="text" name="currency" value="USD"/>
  <input type="text" name="no_of_charge" value="2"/>

  <input type="submit" value="submit" />
</form>   

Response

{"response":{ "description": "Plan is successfully created", "code": "00" }

Subscriptions API

Sandbox endpoint URL:

https://gateway2-stg.merchantservicedepot.com/apis/{method}

Example:

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

Production endpoint URL:

https://portal.merchantservicedepot.com/apis/{method}

Update Plan

Update Plan API

This API is responsible to update existing subscription plan.

URL to call

https://gateway2-stg.merchantservicedepot.com/apis/update_plan.php

Method of form submission

POST

The table describes the request parameters for Update Plan API.

Variable NameDescriptionRequiredExpected Values
usernameMSD Gateway UsernameYMSD Gateway Username
api_keyMSD Gateway API KeyYMSD Gateway API Key
plan_idPlan IDYExisting Plan ID
plan_namePlan NameYPlan Name
amountAmount to be chargedY115.45
currencyCurrency of Transaction (allowed currencies will be determined during the time of merchant onboarding).YUSD, EUR, GBP, CAD, AUD, NZD, AED, DKK, MXN, SEK, CHF
no_of_chargeNo of times to chargeYNo of charge should be greater than 0

Example

<form name="" action="https://portal.merchantservicedepot.com/apis/update_plan.php" method="post" >
  <input type="text" name="username" value="msdusername"/>
  <input type="text" name="api_key" value="msdapikey"/>
  <input type="text" name="plan_id" value="existingplanid"/>
  <input type="text" name="plan_name" value="plan name"/>
  <input type="text" name="amount" value="115.45"/>
  <input type="text" name="currency" value="USD"/>
  <input type="text" name="no_of_charge" value="2"/>

  <input type="submit" value="submit" />
</form>   

Response

The response of the API Call is a JSON array. For Error, two elements are returned, code and description. For Successful transactions, three elements are returned, code, description, and transaction_id. The response code for a successful API call is always 00.

 
Sample Response

{"response":{ "description": "Plan is successfully Updated", "code": "00" }

Subscriptions API

Sandbox endpoint URL:

https://gateway2-stg.merchantservicedepot.com/apis/{method}

Example:

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

Production endpoint URL:

https://portal.merchantservicedepot.com/apis/{method}

Plan List

Plan List API

This API is responsible for creating new payment transactions, and this API is compatible with both encrypted and plain credit card methods of transactions.

 

URL to call

https://gateway2-stg.merchantservicedepot.com/apis/list_plan.php

Method of form submission

POST

The table describes the request parameters for List Plan API.

Variable NameDescriptionRequiredExpected Values
usernameMSD Gateway UsernameYMSD Gateway Username
api_keyMSD Gateway API KeyYMSD Gateway API Key
plan_idPlan IDNSpecify an existing plan id, to view specific plan details

Example

<form name="" action="https://portal.merchantservicedepot.com/apis/list_plan.php" method="post" >
  <input type="text" name="username" value="msdusername"/>
  <input type="text" name="api_key" value="msdapikey"/>
  <input type="text" name="plan_id" value=""/>

  <input type="submit" value="submit" />
</form>   

Response

Sample Response

{"response":{"code":"00","description":"Success","list":[{"plan_id":47,"plan_name":"SMTEST12","period_type":"FORTNIGHTLY","amount":"6.18","currency":"USD","no_of_charge":0}]}} 

Subscriptions API

Sandbox endpoint URL:

https://gateway2-stg.merchantservicedepot.com/apis/{method}

Example:

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

Production endpoint URL:

https://portal.merchantservicedepot.com/apis/{method}

Delete Plan

Delete Plan API

This API is responsible for adding a subscription using Apple Pay.

 

URL to call

https://gateway2-stg.merchantservicedepot.com/apis/delete_plan.php

Method of form submission

POST

The table describes the request parameters for Delete Plan API.

Variable NameDescriptionRequiredExpected Values
usernameMSD Gateway UsernameYMSD Gateway Username
api_keyMSD Gateway API KeyYMSD Gateway API Key
plan_idPlan IDYExisting plan id

Example

<form name="" id="formID" action="https://portal.merchantservicedepot.com/apis/delete_plan.php" method="post" >
  <input type="text" name="username" value="msdusername"/>
  <input type="text" name="api_key" value="msdapikey"/>
  <input type="text" name="plan_id" value="existingplanid"/>

  <input type="submit" value="submit" />
</form>

Response

The response of the API Call is a JSON array. For Error, two elements are returned, code and description. For Successful transactions, three elements are returned, code, description, and transaction_id. The response code for a successful API call is always 00.

 
Sample Response

{"response":{ "description": "Plan is successfully deleted", "code": "00" } 

Subscriptions API

Sandbox endpoint URL:

https://gateway2-stg.merchantservicedepot.com/apis/{method}

Example:

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

Production endpoint URL:

https://portal.merchantservicedepot.com/apis/{method}

Add Subscription

Add Subscription API

This API is responsible for adding a subscription.

 

URL to call

https://gateway2-stg.merchantservicedepot.com/apis/add_subscription.php

Method of form submission

POST

The table describes the request parameters for Add Subscription API.

Variable NameDescriptionRequiredExpected Values
usernameMSD Gateway UsernameYMSD Gateway Username
api_keyMSD Gateway API KeyYMSD Gateway API Key
plan_idPlan IDYExisting Plan ID
creditcard_numberCredit Card number that will be used to complete the transaction.Y4111111111111111
expire_monthExpiry Month of the Credit Card.Y06
expire_yearExpiry Year of the Credit Card.Y2025
first_nameFirst name of the cardholderYRoberto
last_nameLast name of the cardholderYDiaz
addressAddress of the cardholderN4446 Green Avenue, Suite 56
cityCity of the cardholderNLos Angeles

Example

<form name="" action="https://portal.merchantservicedepot.com/apis/add_subscription.php" method="post" >
  <input type="text" name="username" value="msdusername"/>
  <input type="text" name="api_key" value="msdapikey"/>
  <input type="text" name="plan_id" value="existingplanid"/>
  <input type="text" name="creditcard_number" value="4111111111111111"/>
  <input type="text" name="expire_month" value="06"/>
  <input type="text" name="expire_year" value="2025"/>
  <input type="text" name="first_name" value="Roberto"/>
  <input type="text" name="last_name" value="Diaz"/>
  <input type="text" name="address" value="4446 Green Avenue, Suite 56"/>
  <input type="text" name="city" value="Los Angeles"/>
  <input type="text" name="state" value="CA"/>
  <input type="text" name="zip_code" value="94085"/>
  <input type="text" name="country_code" value="US, CN"/>
  <input type="text" name="email" value="[email protected]"/>
  <input type="text" name="start_date" value="Subscription Start Date"/>
  <input type="text" name="memo" value="memoofthetransaction"/>

  <input type="submit" value="submit" />
</form>   

Response

The response of the API Call is a JSON array. For Error, two elements are returned, code and description. For Successful transactions, three elements are returned, code, description, and transaction_id. The response code for a successful API call is always 00.

 
Sample Response

{"response":{ "description": "Subscription is successfully created", "code": "00" }

Subscriptions API

Sandbox endpoint URL:

https://gateway2-stg.merchantservicedepot.com/apis/{method}

Example:

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

Production endpoint URL:

https://portal.merchantservicedepot.com/apis/{method}

Apple Pay Subscription

Apple Pay Subscription API

This API is responsible to add subscription using Apple Pay.

URL to call

https://gateway2-stg.merchantservicedepot.com/apis/apple_subscription.php

Method of form submission

POST

Integrating Apple Pay to your application is a three step process, first call the javascript, display the Apple Pay button and finally send the reponse to processing API. All the steps are described below.

Apple Pay Proxynization APIs

Sandbox

https://gateway2-stg.merchantservicedepot.com/services/applePaySandbox.js

Production

https://portal.merchantservicedepot.com/services/applePay.js

MSD will provide apple-developer-merchantid-domain-association.txt file. This file must be uploaded to a folder called /.well-known/ at the document root of the web server.This is required to verify the domain.

 
  1.  Include applePay.js script file. Please copy the following lines and paste them to your HTML page to enable the Apple Pay functionality within your application.

Example

<script type="text/javascript" src="https://[server-name]/services/applePay.js"></script>

2. Display an Apple Pay button: The example code below is to display Apple Pay button. Set the style and locale where you add the button.

Example

/* CSS */
#applePay {  
  width: 150px;  
  height: 50px;  
  display: none;   
  border-radius: 5px;    
  margin-left: auto;
  margin-right: auto;
  margin-top: 20px;
  background-image: -webkit-named-image(apple-pay-logo-white); 
  background-position: 50% 50%;
  background-color: black;
  background-size: 60%; 
  background-repeat: no-repeat;  
}

/* HTML */
<button type="button" id="applePay" onclick="callPayment()"></button>
  

3. Implement the request and response function. The msdApplePay.paymentRequestRecurring function will be called when click on Apple Pay Button. This function accepts 4 parameters (app_key,business_name,plan_details,start_date). The msdApplePay.paymentResponse function will be invoked once the Apple Pay response is returned from our system. This function has 2 parameters (responseStatus,responseText). Parameter responseText is used as an input parameter to apple_subscription.php API. Value of responseStatus is S for success.

 

This table describes the request parameters for Apple pay js.

Parameter NameDescriptionRequiredExpected Values
app_keyThis is MD5 of MSD Gateway Username and 16 digit Secret keyYIf Username is test and Secret key is abcdefgh12345678
business_nameDisplay this name in Apple Pay windowYTest shop
plan_detailsGet paln details using list_plan.php APIY{"plan_id":XX,"plan_name":"Test plan","period_type":"WEEKLY","amount":"1.30","currency":"USD","no_of_charge":2}
start_dateSubscription Start DateYYYYY-MM-DD

Example

<script type="text/javascript" >
			function callPayment()
			{
				var app_key="b0cf87c7e314af8638ce34732f1f7d24";
				var business_name="Test shop";
				var plan_details='{"plan_id":XX,"plan_name":"Test plan","period_type":"WEEKLY","amount":"1.30","currency":"USD","no_of_charge":2}';

				msdApplePay.paymentRequestRecurring(app_key,business_name,plan_details,start_date);
			}

			msdApplePay.paymentResponse=function(responseStatus,responseText){
				if(responseStatus=="S")
				{
					document.getElementById('signature_token').value = responseText;
					document.getElementById("formID").submit();
				}else{
					alert(responseText);
				}
			}

			</script>

The table describes the request parameters for Apple Pay Subscription API.

Variable NameDescriptionRequiredExpected Values
usernameMSD Gateway UsernameYMSD Gateway Username
api_keyMSD Gateway API KeyYMSD Gateway API Key
signature_tokenGet a token from msdApplePay.paymentResponseY{"identifyKey":"test","data":"test",
ephemeralPublicKey":"test","publicKeyHash":"test",
transactionId":"test","signature":"test",
version":"EC_v1","displayName":"MasterCard 1111",
network":"MasterCard","type":"credit"}
first_nameFirst name of the cardholderYRoberto
last_nameLast name of the cardholderYDiaz
addressAddress of the cardholderN4446 Green Avenue, Suite 56
cityCity of the cardholderNLos Angeles
stateState of the cardholderNCA
zip_codeZip code of the cardholderY94085
country_codeCountry of the cardholder(ISO alpha-2)YUS, CN

Example

<form name="" id="formID" action="https://portal.merchantservicedepot.com/apis/apple_subscription.php" method="post">
    <input type="text" name="username" value="msdusername"/>
    <input type="text" name="api_key" value="msdapikey"/>
    <input type="text" name="signature_token" value="{"identifyKey":"test","data":"test","ephemeralPublicKey":"test","publicKeyHash":"test","transactionId":"test","signature":"test","version":"EC_v1","displayName":"MasterCard 1111","network":"MasterCard","type":"credit"}"/>
    <input type="text" name="first_name" value="Roberto"/>
    <input type="text" name="last_name" value="Diaz"/>
    <input type="text" name="address" value="4446 Green Avenue, Suite 56"/>
    <input type="text" name="city" value="Los Angeles"/>
    <input type="text" name="state" value="CA"/>
    <input type="text" name="zip_code" value="94085"/>
    <input type="text" name="country_code" value="US, CN"/>
    <input type="text" name="email" value="[email protected]"/>
    <input type="text" name="memo" value="memoofthetransaction"/>
  <br/>
  <button type="button" id="applePay" onclick="callPayment()"></button> 
</form>
<script type="text/javascript" >
  function callPayment()
  {
    var app_key="b0cf87c7e314af8638ce34732f1f7d24";
    var business_name="Test shop";
    var plan_details='{"plan_id":XX,"plan_name":"Test plan","period_type":"WEEKLY","amount":"1.30","currency":"USD","no_of_charge":2}';

    msdApplePay.paymentRequestRecurring(app_key,business_name,plan_details,start_date);
  }

  msdApplePay.paymentResponse=function(responseStatus,responseText){
    if(responseStatus=="S")
    {
      document.getElementById('signature_token').value = responseText;
      document.getElementById("formID").submit();
    }else{
      alert(responseText);
    }
  }
</script>

Response

The response of the API Call is a JSON array. For Error, two elements are returned, code and description. For Successful transactions, three elements are returned, code, description, and transaction_id. The response code for a successful API call is always 00.

 

Example

{"response":{ "description": "Subscription is successfully created", "code": "00" } 

Subscriptions API

Sandbox endpoint URL:

https://gateway2-stg.merchantservicedepot.com/apis/{method}

Example:

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

Production endpoint URL:

https://portal.merchantservicedepot.com/apis/{method}

Subscription List

Subscription List API

This API is responsible for fetching details of subscriptions.

 

URL to call

https://gateway2-stg.merchantservicedepot.com/apis/list_subscription.php

Method of form submission

POST

The table describes the request parameters for Subscription List API.

Variable NameDescriptionRequiredExpected Values
usernameMSD Gateway UsernameYMSD Gateway Username
api_keyMSD Gateway API KeyYMSD Gateway API Key
plan_idPlan IDNExisting Plan ID
card_typeCard TypeNAMEX, DISCOVER, MASTERCARD, VISA
start_dateStart DateNStart Date
end_dateEnd DateNEnd Date

Example

<form name="" action="https://portal.merchantservicedepot.com/apis/list_subscription.php" method="post" >
  <input type="text" name="username" value="msdusername"/>
  <input type="text" name="api_key" value="msdapikey"/>
  <input type="text" name="plan_id" value="existingplanid"/>
  <input type="text" name="card_type" value="VISA"/>
  <input type="text" name="start_date" value="startdate"/>
  <input type="text" name="end_date" value="enddate"/>

  <input type="submit" value="submit" />
</form>   

Response

Sample Response

{"response":{"code":"00","description":"Success","list":[{"subscription_id":59,"plan_id":30,"plan_name":"Plan test fortnightly","credit_card_number":"**** **** **** 0007 ","amount":7,"currency":"USD","period_type":"FORTNIGHTLY","first_name":"Tanmoy","last_name":"Mondal","address":"802 E Frierson Ave","address_cont":"","city":"TAMPA","state":"FL","zip":"33606","country_id":209,"country_name":"United States","bill_email":"[email protected]","start_date":"2023-05-25"},{"subscription_id":56,"plan_id":30,"plan_name":"Plan test fortnightly","credit_card_number":"**** **** **** 0007 ","amount":7,"currency":"USD","period_type":"FORTNIGHTLY","first_name":"Tanmoy","last_name":"Mondal","address":"802 E Frierson Ave","address_cont":"","city":"TAMPA","state":"FL","zip":"33606","country_id":209,"country_name":"United States","bill_email":"[email protected]","start_date":"2023-05-22"}]}} 

Subscriptions API

Sandbox endpoint URL:

https://gateway2-stg.merchantservicedepot.com/apis/{method}

Example:

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

Production endpoint URL:

https://portal.merchantservicedepot.com/apis/{method}

Delete Subscription

Delete Subscription API

This API is responsible for removing existing subscription.

 

URL to call

https://gateway2-stg.merchantservicedepot.com/apis/delete_subscription.php

Method of form submission

POST

The table describes the request parameters for Delete Subscription API.

Variable NameDescriptionRequiredExpected Values
usernameMSD Gateway UsernameYMSD Gateway Username
api_keyMSD Gateway API KeyYMSD Gateway API Key
subscription_idSubscription IDYExisting Subscription ID

Example

<form name="" action="https://portal.merchantservicedepot.com/apis/delete_subscription.php" method="post" >
  <input type="text" name="username" value="msdusername"/>
  <input type="text" name="api_key" value="msdapikey"/>
  <input type="text" name="subscription_id" value="existingsubscriptionid"/>

  <input type="submit" value="submit" />
</form>

Response

The response of the API Call is a JSON array. For Error, two elements are returned, code and description. For Successful transactions, three elements are returned, code, description, and transaction_id. The response code for a successful API call is always 00.

 

Sample Response

{"response":{ "description": "Subscription is successfully deleted", "code": "00" } 

Subscriptions API

Sandbox endpoint URL:

https://gateway2-stg.merchantservicedepot.com/apis/{method}

Example:

https://gateway2-stg.merchantservicedepot.com/apis/add_plan.php

Production endpoint URL:

https://portal.merchantservicedepot.com/apis/{method}

Response Codes

Response Codes API

CodeDescription
01Username is missing or invalid
02Credit Card is missing or invalid
03Expire month is missing or invalid
04First name is missing or invalid
05Country code is missing or invalid
06Email is missing or invalid
07Address is missing
08City is missing
09API Key is missing or invalid
10Zipcode is missing
11Start date is missing
12Plan id is missing or invalid
13State is missing
14Plan Name is missing
15Period Type is missing or invalid
16No of Charge is missing
17Amount is missing or invalid
18Currency is missing
19Same Plan already exists
20Currency is not assigned to this account
21Message contains words that have been identified as profanity and this message has been blocked due to company policy. Please try again.
22No of charge should be greater than 0
23CVV is missing or invalid
24Invalid card
UNUnknown error, Please contact Administrator