BillingUnversioned

Cancel Plan


Note: This Requires SSL.

Description: Cancels the active invoice for a plan and returns the cancellation date and confirmation ID.

Required Parameters:


Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')
  • comments : Any comments the user would like to add.
  • x_uploading : Problems uploading files (1 to select).
  • x_downloading : Problems downloading files (1 to select).
  • x_switching : Switching to another file hosting service (1 to select).
  • x_speed : Download speeds were not fast enough (1 to select).
  • x_money_problems : Can't afford the monthly fee (1 to select).
  • x_too_expensive : The service was too expensive (1 to select).
  • x_technophobe : No longer need the service (1 to select).
  • x_lacking_features : The service is missing a feature I need (1 to select).
  • x_lacking_service : The service is not what I was expecting (1 to select).
  • x_other : Expiration year of credit card.

Error Codes: 100, 224


GET SSL Required https://www.mediafire.com/api/unversioned/billing/cancel_plan.php
POST SSL Required https://www.mediafire.com/api/unversioned/billing/cancel_plan.php

Example 1 (success):

Request

https://www.mediafire.com/api/unversioned/billing/cancel_plan.php?session_token=&comments=The%20service%20was%20too%20expensive&x_too_expensive=yes&x_lacking_features=yes
                    
Response
<response>
  <action>billing/cancel_plan</action>
  <cancel_date>11/11/2013</cancel_date>
  <confirmation>FO02O</confirmation>
  <last_invoice>82033</last_invoice>
  <result>Success</result>
  <current_api_version>2.14</current_api_version>
</response>
 
Failure:
<response>   <action>billing/cancel_plan</action>   <message>There is no active invoice to cancel</message>   <error>224</error>   <result>Error</result>   <current_api_version>2.14</current_api_version> </response>

Change Plan


Note: This call requires SSL

Description : Returns a new billing date for a changed plan. If desired, creates a new invoice and updates parameters for a new plan.

Required Parameters

  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
  • product_id : The ID of the product being changed.
  • info_only : Whether or not to perform the change or just return meta data. If "yes" only information will be retrieved. If "no" the change plan process will be completed.
  • subdomain : Only for upgrades to business. The subdomain should have no characters and cannot begin with a number. Example is 'subdomain=companyacmebrick1'.
  • company : Only for upgrades to business. Example would be 'company=Acme Brick Company'.

Optional Parameters
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')

Error Codes: 100, 168, 170, 172, 173, 176, 178, 179, 180, 181, 182, 183


GET SSL Required https://www.mediafire.com/api/unversioned/billing/change_plan.php
POST SSL Required https://www.mediafire.com/api/unversioned/billing/change_plan.php

Example 1 (info_only = "yes"):

Request
https://www.mediafire.com/api/unversioned/billing/change_plan.php?session_token=eb69c17146&product_id=70&info_only=yes
Response:
<response>
  <action>billing/change_plan</action>
  <nextbilling>June 3, 2013</nextbilling>
  <info_only>yes</info_only>
  <newpid>70</newpid>
  <amount>99.99</amount>
  <interval>12</interval>
  <result>Success</result>
  <current_api_version>2.14</current_api_version>
</response>

Example 2 (info_only = "no" - upgrade plan to business):

Request
https://www.mediafire.com/api/unversioned/billing/change_plan.php?session_token=eb69c17146&product_id=67&info_only=no
Response:
<response>
  <action>billing/change_plan</action>
  <nextbilling>July 5, 2013</nextbilling>
  <info_only>no</info_only>
  <uid>7109019961</uid>
  <plan1>70</plan1>
  <plan2>67</plan2>
  <freedays>80.28741860457</freedays>
  <bandwidth_adjust>-1073170632573</bandwidth_adjust>
  <lastpremium1>2013-05-04 07:05:37</lastpremium1>
  <lastpremium2>2013-06-05 12:02:59</lastpremium2>
  <premium1>4</premium1>
  <premium2>4</premium2>
  <next_bw>2013-05-06 02:18:35</next_bw>
  <invoice1>81281</invoice1>
  <invoice2>81282</invoice2>
  <invoice_created>2013-04-16 14:45:49</invoice_created>
  <bandwidth1>1761445678998</bandwidth1>
  <bandwidth2>688275046425</bandwidth2>
  <result>Success</result>
  <current_api_version>2.14</current_api_version>
</response>

Example 3 (info_only = "no" - change plan not to business, or business to business):

Request
https://www.mediafire.com/api/unversioned/billing/change_plan.php?session_token=eb69c17146&product_id=67&info_only=no
Response:
<response>
  <action>billing/change_plan</action>
  <nextbilling>April 24, 2013</nextbilling>
  <info_only>no</info_only>
  <plan1>67</plan1>
  <plan2>73</plan2>
  <freedays>8.0128766216206</freedays>
  <bandwidth_adjust>9659190234407</bandwidth_adjust>
  <lastpremium1>2013-06-05 12:02:59</lastpremium1>
  <lastpremium2>2013-03-25 05:47:59</lastpremium2>
  <premium1>4</premium1>
  <premium2>2</premium2>
  <next_bw>2013-05-06 02:18:35</next_bw>
  <invoice1>81282</invoice1>
  <invoice2>81283</invoice2>
  <invoice_created>2013-04-16 15:09:07</invoice_created>
  <bandwidth1>688275046425</bandwidth1>
  <bandwidth2>10347465280832</bandwidth2>
  <subdomain>biztestjk16</subdomain>
  <company>Exxon</company>
  <result>Success</result>
  <current_api_version>2.14</current_api_version>
</response>

Get Invoice


Note: This Requires SSL.

Description Returns the contents of the most recent/active invoice.

Required Parameters:


Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')


GET SSL Required https://www.mediafire.com/api/unversioned/billing/get_invoice.php
POST SSL Required https://www.mediafire.com/api/unversioned/billing/get_invoice.php

Example:

Request
https://www.mediafire.com/api/unversioned/billing/get_invoice.php?session_token=eb69c17146
Response
<response>
  <action>billing/get_invoice</action>
  <invoice>
    <invoice_id>80931</invoice_id>
    <invoice_num>222BF74</invoice_num>
    <payment_method>authnet</payment_method>
    <recurring_status>Active</recurring_status>
    <recurring_profile_id>1832</recurring_profile_id>
    <date_created>2013-03-04 15:32:38</date_created>
    <user_id>7109018751</user_id>
    <company_id>0</company_id>
    <product_id>63</product_id>
    <product_description>MediaFire Professional $27 for 6 months with 250 GB of cloud storage.</product_description>
    <country>US</country>
    <initial_amount>27.00</initial_amount>
    <initial_tax>0.00</initial_tax>
    <initial_total>27.00</initial_total>
    <recurring_amount>27.00</recurring_amount>
    <recurring_tax>0.00</recurring_tax>
    <recurring_total>27.00</recurring_total>
    <recurring_startdate>2013-09-04 00:00:00</recurring_startdate>
    <recurring_enddate>0000-00-00 00:00:00</recurring_enddate>
    <next_bandwidth>2013-02-10 03:05:55</next_bandwidth>
    <previous_invoice>80837</previous_invoice>
  </invoice>
  <count>1</count>
  <result>Success</result>
  <current_api_version>2.14</current_api_version>
</response>

Get Plans


Description : Returns a list of the current active plans together with their important attributes.

Required Parameters

  • None

Optional Parameters
  • product_id : ID of the Product (plan) that the user wants to retrieve information. If there is no product_id, API will return information about all the active products (plans).
  • family : If given, returns only products within this product family. Otherwise all product families.
  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
  • response_format : "xml" or "json" (default: "xml").

Error Codes: 100, 168, 170, 172, 173, 176, 178, 179, 180, 181, 182, 183


GET https://www.mediafire.com/api/unversioned/billing/get_plans.php
POST https://www.mediafire.com/api/unversioned/billing/get_plans.php

Example 1:

Request
http://www.mediafire.com/api/unversioned/billing/get_plans.php?session_token=eb69c171461c34&family=4
Response:
<response>
  <action>billing/get_plans</action>
  <products>
    <product>
      <product_id>10</product_id>
      <description>$9 One time for 500 GB bandwidth</description>
      <short_description>500GB bandwidth</short_description>
      <initial_amount>9.00</initial_amount>
      <initial_units>536870912000</initial_units>
      <is_recurring>0</is_recurring>
      <recurring_amount>0.00</recurring_amount>
      <recurring_units>0</recurring_units>
      <frequency_text>One time fee</frequency_text>
      <product_class>2</product_class>
    </product>
    <product>
      <product_id>11</product_id>
      <description>$19 One time for 1250 GB bandwidth</description>
      <short_description>1250GB bandwidth</short_description>
      <initial_amount>19.00</initial_amount>
      <initial_units>1342177280000</initial_units>
      <is_recurring>0</is_recurring>
      <recurring_amount>0.00</recurring_amount>
      <recurring_units>0</recurring_units>
      <frequency_text>One time fee</frequency_text>
      <product_class>2</product_class>
    </product>
    <product>
      <product_id>12</product_id>
      <description>$69 One time for 5000 GB bandwidth</description>
      <short_description>5000 GB bandwidth</short_description>
      <initial_amount>69.00</initial_amount>
      <initial_units>5497558138880</initial_units>
      <is_recurring>0</is_recurring>
      <recurring_amount>0.00</recurring_amount>
      <recurring_units>0</recurring_units>
      <frequency_text>One time fee</frequency_text>
      <product_class>2</product_class>
    </product>
    <product>
      <product_id>14</product_id>
      <description>$#CREDITS# Reseller Credits</description>
      <short_description>Reseller Credits</short_description>
      <initial_amount>0.00</initial_amount>
      <initial_units>0</initial_units>
      <is_recurring>0</is_recurring>
      <recurring_amount>0.00</recurring_amount>
      <recurring_units>0</recurring_units>
      <frequency_text>One time fee</frequency_text>
      <product_class>0</product_class>
    </product>
  </products>
  <result>Success</result>
  <current_api_version>2.14</current_api_version>
</response>

Example 2:

Request
http://www.mediafire.com/api/unversioned/billing/get_plans.php?session_token=eb69c171461&product_id=60
Response:
<response>
  <action>billing/get_plans</action>
  <products>
    <product>
      <product_id>10</product_id>
      <description>$9 One time for 500 GB bandwidth</description>
      <short_description>500GB bandwidth</short_description>
      <initial_amount>9.00</initial_amount>
      <initial_units>536870912000</initial_units>
      <is_recurring>0</is_recurring>
      <recurring_amount>0.00</recurring_amount>
      <recurring_units>0</recurring_units>
      <frequency_text>One time fee</frequency_text>
      <product_class>2</product_class>
    </product>
    <product>
      <product_id>11</product_id>
      <description>$19 One time for 1250 GB bandwidth</description>
      <short_description>1250GB bandwidth</short_description>
      <initial_amount>19.00</initial_amount>
      <initial_units>1342177280000</initial_units>
      <is_recurring>0</is_recurring>
      <recurring_amount>0.00</recurring_amount>
      <recurring_units>0</recurring_units>
      <frequency_text>One time fee</frequency_text>
      <product_class>2</product_class>
    </product>
    <product>
      <product_id>12</product_id>
      <description>$69 One time for 5000 GB bandwidth</description>
      <short_description>5000 GB bandwidth</short_description>
      <initial_amount>69.00</initial_amount>
      <initial_units>5497558138880</initial_units>
      <is_recurring>0</is_recurring>
      <recurring_amount>0.00</recurring_amount>
      <recurring_units>0</recurring_units>
      <frequency_text>One time fee</frequency_text>
      <product_class>2</product_class>
    </product>
    <product>
      <product_id>14</product_id>
      <description>$#CREDITS# Reseller Credits</description>
      <short_description>Reseller Credits</short_description>
      <initial_amount>0.00</initial_amount>
      <initial_units>0</initial_units>
      <is_recurring>0</is_recurring>
      <recurring_amount>0.00</recurring_amount>
      <recurring_units>0</recurring_units>
      <frequency_text>One time fee</frequency_text>
      <product_class>0</product_class>
    </product>
  </products>
  <result>Success</result>
  <current_api_version>2.14</current_api_version>
</response>

Get Products


Description: Returns a resource of plan information that meets the input parameters.

Optional Parameters:

  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')
  • active : 0 or 1
  • legacy : 0 or 1 (always 0 when accessed externally)
  • interval : 0 through 12
  • is_recurring : 0 or 1
  • product_class : 1 through 10
  • product_family : 0 through 10
  • product_id : less than 1000


GET https://www.mediafire.com/api/unversioned/billing/get_products.php
POST https://www.mediafire.com/api/unversioned/billing/get_products.php

Example:

Request
http://www.mediafire.com/api/unversioned/billing/get_products.php?session_token=eb69c17146&active=1&product_family=4&product_class=1
Response
<response>
  <action>billing/get_products</action>
  <products>
    <product>
      <product_id>60</product_id>
      <description>MediaFire Personal $18 yearly with 50 GB of cloud storage.</description>
      <short_description>MediaFire Personal Base (1 Year)</short_description>
      <initial_amount>18.00</initial_amount>
      <initial_units>536870912000</initial_units>
      <is_recurring>1</is_recurring>
      <recurring_amount>18.00</recurring_amount>
      <recurring_units>536870912000</recurring_units>
      <free_months>12</free_months>
      <trial>0</trial>
      <active>1</active>
      <frequency_text>Yearly</frequency_text>
      <uses_credits>0</uses_credits>
      <reseller_entitlement>0</reseller_entitlement>
      <payment_methods>0</payment_methods>
      <yearly_only>1</yearly_only>
      <interval>12</interval>
      <legacy>0</legacy>
      <product_class>1</product_class>
      <product_family>4</product_family>
      <base_storage>53687091200</base_storage>
    </product>
  </products>
  <result>Success</result>
  <current_api_version>2.14</current_api_version>
</response>

Purchase Plan


Note: This Requires SSL.

Description: Purchases a plan for the user with given payment information.

Required Parameters:

  • session_token : A type 1 or type 2 session token. (Type 2 will require a call signature).
  • pid : The ID of the product being purchased.
  • payment_method : The type of payment (new credit card, or previous credit card). Allowed values: newcredit, prevcredit.

Required Parameters for New Credit Cards:
  • first_name_info : First name of purchaser.
  • last_name_info : Last name of purchaser.
  • address1_info : Address of purchaser.
  • city_info : City of purchaser (US only).
  • state_info : State of purchaser (US only.)
  • zip_info : Zip of purchaser (US only).
  • country_info : Country of purchaser.
  • region_info : Billing region of purchaser (foreign only).
  • postal_code_info : Billing postal code of purchaser (foreign only.)
  • card_number : Credit card number of purchaser.
  • card_code : Card CCV code of purchaser.
  • exp_month : Expiration month of credit card (with leading zero, e.g. '01').
  • exp_year : Expiration year of credit card.

Required Parameters for Previous Credit Cards:
  • prev_card_code : Card CCV code of purchaser.

Required Parameters for Business Account Purchases:
  • subdomain : Subdomain for business account.
  • company : Company name for business account.

Optional Parameters:
  • signature : This is the call signature that is required to authenticate a type 2 session token transaction.
  • response_format : 'xml' or 'json' (default 'xml')

Error Codes: 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206


GET https://www.mediafire.com/api/unversioned/billing/purchase_plan.php
POST https://www.mediafire.com/api/unversioned/billing/purchase_plan.php

Example 1 (Success):

Request
https://www.mediafire.com/api/unversioned/billing/purchase_plan.php?session_token=eb69c17146 &payment_method=newcredit&pid=68&first_name_info=Ben&last_name_info=Gates&address1_info=123%20Main%20St.&city_info=Latrobe&zip_info=15650&state_info=PA&country_info=US&
                    card_number=1234567890123456&card_code=902&exp_month=01&exp_year=2014
                    
Response
<response>
  <action>billing/purchase_plan</action>
  <invoice>81378</invoice>
  <created>2013-04-30 10:36:09</created>
  <total>20.25</total>
  <product>11</product>
  <premium>4</premium>
  <lastpremium>2013-04-29 17:48:01</lastpremium>
  <result>Success</result>
  <current_api_version>2.14</current_api_version>
</response>

Example 2 (Front-End Failure):

Request
https://www.mediafire.com/api/unversioned/billing/cancel_plan.php?session_token=&comments=The%20service%20was%20too%20expensive&x_too_expensive=1&x_lacking_features=1
                    
Response
<response>
  <action>billing/purchase_plan</action>
  <errors>
    <error>
      <code>4</code>
      <message>Invalid first_name value</message>
    </error>
    <error>
      <code>4</code>
      <message>Invalid last_name value</message>
    </error>
    <error>
      <code>4</code>
      <message>Invalid address value</message>
    </error>
    <error>
      <code>4</code>
      <message>Invalid city value</message>
    </error>
    <error>
      <code>4</code>
      <message>Invalid country value</message>
    </error>
    <error>
      <code>4</code>
      <message>Invalid cardnumber value</message>
    </error>
    <error>
      <code>4</code>
      <message>Invalid cardcode value</message>
    </error>
    <error>
      <code>4</code>
      <message>Invalid expmonth value</message>
    </error>
    <error>
      <code>4</code>
      <message>Invalid expyear value</message>
    </error>
  </errors>
  <message>One or more parameters for this request are invalid</message>
  <error>129</error>
  <result>Error</result>
  <current_api_version>2.14</current_api_version>
</response>

Example 3 (Back-End Failure):

Response
<response>
  <action>billing/purchase_plan</action>
  <message>The credit card you have entered is invalid</message>
  <error>196</error>
  <result>Error</result>
  <current_api_version>2.14</current_api_version>
</response>