getCart
getCart has 6 parameters (string $session_id, ArrayOfArray $cart_records, ArrayOfArray $registration_data, string $debit_account, string $commit, string $coupon).
It's response is a CartObj object with 4 attributes.
Parameters
| Parameter | Notes |
| (string) $session_id | A valid session ID which can be obtained from login() |
| (ArrayOfArray) $cart_records | A list of items in the cart with the first row being field names. See below for a list of field names. |
| (ArrayOfArray) $registration_data | The data for a new registration (required for new domain purchases only). |
| (string) $debit_account | The id of the debit account being used. |
| (string) $commit | This field must equal 'commit' in order for this trasaction to be commited. Any other input will result in the cart being validated but not committed. |
| (string) $coupon | A coupon code for an item |
Cart Records
| Column | Description |
| id | This is used to keep the cart item in order. |
| domain_name | The domain name of this item |
| start_date | Not expected as an input. It is assumed to be today on new accounts or the day of expiration of renewal. It is always returned but its input is ignored. |
| expire_date | Not expected as an input. It is calculated by the term of the product or expiration of the domain. The expiration will always be on the same day of the month as the domain expiration and can never go beyond. It is always returned but its input is ignored. |
| qty | The quantity of items. This number will be switched to 0 if the product cannot be purchased. |
| price | Not expected as an input. It is calculated and returned. |
| offer_id | (Requirted) The id of the offer being purchased. |
| category_name | Not expected as an input. |
| subscription_id | The id of the subscription being renewed. This is required for renewals or add ons. |
| total_month | Not expected as an input. This is determined by the offer and billing period. It will always be returned. |
| billing_period | 'Y' or 'M' based on wether the product is being billed yearly or monthly. |
| comment_code | A user should input an 'n', 'r', or 'a' based on the item being a 'new purchase', 'renewal', or 'add on'. A three digit code will be returned with the first letter being unchanged. The second and third letters detail any price or duration changes (see below) |
| coupon_code | (optional) Place any coupon codes in this spot to recieve discounts. |
| message_text | Any notes regarding this item. |
| is_valid | Not expected as an input. It is returned as confirmation of the validity of the item. |
Registration Fields
| Column | Description |
| org_name | |
| org_address | |
| org_city | |
| org_postal_code | |
| org_state_code | |
| org_country | |
| adm_first_name | |
| adm_last_name | |
| adm_address | |
| adm_city | |
| adm_postal_code | |
| adm_state_code | |
| adm_country | |
| adm_phone | |
| adm_fax | |
| adm_e_mail | |
| tech_first_name | |
| tech_last_name | |
| tech_address | |
| tech_city | |
| tech_postal_code | |
| tech_state_code | |
| tech_country | |
| tech_e_mail | |
| tech_phone | |
| tech_fax | |
| bill_first_name | |
| bill_last_name | |
| bill_address | |
| bill_city | |
| bill_postal_code | |
| bill_state_code | |
| bill_country | |
| bill_phone | |
| bill_fax | |
| bill_e_mail | |
| ns_prim_hostname | |
| ns_prim_netaddress | |
| ns_sec1_hostname | |
| ns_sec1_netaddress | |
| created_user | |
Response
Object type: CartObj
CartObj attributes
Response Object Attributes
| Attribute | Notes |
| (string) code | |
| (string) message | |
| (ArrayOfArray) cartRecords | |
| (ArrayOfArray) registrationData | |
Codes
| Codes | Message |
| 000 | Success |
| This is a partial list of codes which may not be clear by their message. |
Cart Records
| Column | Description |
| id | This is used to keep the cart item in order. |
| domain_name | The domain name of this item |
| start_date | Not expected as an input. It is assumed to be today on new accounts or the day of expiration of renewal. It is always returned but its input is ignored. |
| expire_date | Not expected as an input. It is calculated by the term of the product or expiration of the domain. The expiration will always be on the same day of the month as the domain expiration and can never go beyond. It is always returned but its input is ignored. |
| qty | The quantity of items. This number will be switched to 0 if the product cannot be purchased. |
| price | Not expected as an input. It is calculated and returned. |
| offer_id | (Requirted) The id of the offer being purchased. |
| category_name | Not expected as an input. |
| subscription_id | The id of the subscription being renewed. This is required for renewals or add ons. |
| total_month | Not expected as an input. This is determined by the offer and billing period. It will always be returned. |
| billing_period | 'Y' or 'M' based on wether the product is being billed yearly or monthly. |
| comment_code | A user should input an 'n', 'r', or 'a' based on the item being a 'new purchase', 'renewal', or 'add on'. A three digit code will be returned with the first letter being unchanged. The second and third letters detail any price or duration changes (see below) |
| coupon_code | (optional) Place any coupon codes in this spot to recieve discounts. |
| message_text | Any notes regarding this item. |
| is_valid | Not expected as an input. It is returned as confirmation of the validity of the item. |
Sample Code (using NuSoap)
$soap = new soapclient("https://api.max.md/getCart.php?wsdl",array( 'trace' => true, 'exceptions' => true, ));
$response= $soap->getCart($username, $password);
if ($response->code == '000') {
$session_id = $response->values[0];
}else{
echo $response->message;
}
The nuSoap configuration can be found here
The xml for the WSDL can be found here