equipment_purchase Navigate to XML API

This REST API is used to purchase Equipment.

End Point https://www.vcareapi.com:8080/equipment
Field (Short Description) Value/Tag Name Format Field Example Type Notes Validation rules
action String equipment_purchase Required This needs to be passed as equipment_purchase. Expected value : equipment_purchase
enrollment_id String WSN2487 Required The enrollment id is returned in the CheckServiceAvailability call and you are required to pass the same enrollment id for the enrollment you are attempting. Alphanumeric.
calculate_tax String Optional
amount String Optional
card_type String Visa Required Here you should pass the type of the card(VISA , MASTER) that you will use to make payment. Expected values : Visa, Master, Discover, Amex.
card_number String 4111111111111111 Required Here you should pass your card number that you are using to make payment. Valid card number.
cvv String *** Required Here you should pass the Card Verification Value (CVV) of the card that you are using to make payment. Valid CVV.
expiration_month String 09 Required Here you should pass the expiration month of the card that you are using to make payment. Valid expiration month.
expiration_year String 2030 Required Here you pass the expiration year of the year card that you are using to make payment. Valid Expiration year.
name_on_card String John Doe Required Here you should pass the name on the card. Card owner name.
billing_state String MD Required Here you pass the billing state of the customer. State should be standard abbreviated form. Maximum two characters are allowed.
billing_city String BALTIMORE Required Here you pass the billing city of the customer. Should allow only letters, hyphen and space.
billing_zip String 21218 Required Here you should pass the billing ZIP of the customer. Should not allow letters and special characters, only numbers. Should be exactly 5 digits.
billing_address1 String 123 FGFD Required This is the billing address 1 of the customer. Here you should pass the Street and House number of the customer. Accepts these special characters: space, forward slash (/), hash (#), hyphen (-).
billing_address2 String Apt 1 Optional This is the billing address 2 of the customer. Here you should pass the apartment number of the customer. Accepts these special characters: space, forward slash (/), hash (#), hyphen (-).
shipping_address1 String 123 FGFD Optional Here you should pass the Street and House number of the customer. Accepts these special characters: space, forward slash (/), hash (#), hyphen (-).
shipping_address2 String Apt 1 Optional Here you should pass the apartment number of the customer. Accepts these special characters: space, forward slash (/), hash (#), hyphen (-).
shipping_state String MD Optional Here you pass the shipping state of the customer. State should be standard abbreviated form. Maximum two characters are allowed.
shipping_city String BALTIMORE Optional Here you pass the shipping city of the customer. Should allow only letters, hyphen and space.
shipping_zip String 21218 Optional Here you should pass the shipping ZIP of the customer. Should not allow letters and special characters, only numbers. Should be exactly 5 digits.
payment_method String CREDIT_CARD Required Here you should pass the method that you will use to make the payment. Expected values : CREDIT_CARD , WALLET , COURTESY.
wallet_owner_id String Optional
equipment_type String Charger Optional Here you should pass the type of the equipment that you are going to give to the customer. Valid equipment type.
change_reason String Damaged Optional Here
model_id String 48 Required Here you should pass the model id of the equipment that you are going to give to the customer. Only numeric.
overnight_shipping_fee String Y Optional This field is used to charge the overnight shipping fee . If you want to charge the overnight shipping than you should pass Y in this field. Expected values : Y / N.
shipping_address_same_as_billing String Y Optional This field defines whether the shipping address and billing address of the customer is same or not. If the shipping address and the billing address is same than pass Y else pass N. Expected values : Y / N.
is_payment_completed String Y Optional If the payment is already done than pass Y in this field. If here you are passing Y than you have to pass the transaction id in the payment_transaction_id field and do not need to pass payment_method. Expected values : Y / N.
payment_transaction_id String B20P2F430EF4 Optional Here you should pass the valid payment transaction id. If you have passed Y in the is_payment_completed field than payment_transaction_id field is mandatory. Valid payment transaction id.
source String API Required Source of the order. Expected Value:API , WEBSITE.
agent_id String JohnDoe Required This is the Telgoo5 user or the Agent/Employee id who is sending the API request. This is the user login id which will be created in Telgoo5 for the API user.
agent_password String ********* Optional This is the password for the Agent Id mentioned above. This is configuration level field. If you have set the permissions for the Agent Id for the requirement of the password in API transactions then you will need to pass the Agent Password in all the REST API transaction, else if you have set the permissions to password not required then you don’t need to pass the Agent Password in the REST API.
model_child_id array Optional must be an array
skip_transaction String Y Optional if Y then don't make transaction Y/N
is_tax_required String Y Optional if Y then add tax Y/N
byod_esn array Optional to add esn data must be an array
invoice_number String Optional To add custom invoice number
shipping_charges array Optional to add shipping charges must be an array
tax_calculation_zip String 21218 Optional This field defines the tax on the equipment acc to the zip that you are passing here. Should not allow letters and special characters, only numbers. Should be exactly 5 digits.
Sample Request REST
{
    "action": "equipment_purchase",
    "zip_code": "85002",
    "payment_method": "WALLET",
    "is_payment_completed": "",
    "payment_transaction_id": "",
    "skip_transaction": "Y",
    "is_tax_required": "Y",
    "calculate_tax": "",
    "model_id": "2",
    "shipping_charges": "",
    "tax_calculation_zip": "",
    "model_child_id": "",
    "no_of_lines": "1",
    "enrollment_id": "WPRO4838",
    "overnight_shipping": "Y",
    "source": "WEBSITE",
    "request_name": "payment",
    "agent_id": "ewebsiteapi"
}
List of status code, description and resolution.
Status Code Description How to Resolve?
RESTAPI000 SUCCESS SUCCESS
RESTAPI001 FAIL Multiple errors like Invalid Token, Token already used, Token expire & Invalid Access!!
RESTAPI101 FAIL Module required.
RESTAPI102 FAIL Action required.
RESTAPI103 FAIL Source Not Allowed.
RESTAPI104 FAIL Invalid Agent ID or Password.
RESTAPI105 FAIL Module does not exist.
RESTAPI106 FAIL Action does not exist.
RESTAPI107 FAIL Invalid company.
RESTAPI108 FAIL Invalid method.
RESTAPI109 FAIL Unauthorized Access.
RESTAPI010 FAIL Multiple errors come in an array.
Sample Response
{
    "data": {
        "msg": "Equipment Successfully purchased!!",
        "msg_code": 0
    },
    "msg": "Success",
    "msg_code": "RESTAPI000",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGVtby1Qcm9zcGVyV2lyZWxlc3NVc2VyIiwicGFzc3dvcmQiOiJEZW1vLVByb3NwZXJXbnIyc2Z3Mmp6eTZwIiwicGluIjoiRGVtby02NDY5MzA5MTM3NDMiLCJ2ZW5kb3JfaWQiOiJEZW1vLVByb3NwZXJXaXJlbGVzcyIsImxvZ19pZCI6MTE2MDk5OCwidXJsIjoiaHR0cHM6Ly9kZW1vLXByb3NwZXIudGVsZ29vNS5jb20vdmNhcmVPc3NBcGkvIn0sImV4cCI6MTcwNDM5NjM3N30.Wuwc5P0r6hKWpvdptcXef98lP7iurSbz2KkFXyiIOUc"
}
SUCCESS
Sample Fail Response: 1
{
    
    "msg": "Invalid Token",
    "msg_code": "RESTAPI001",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Invalid Token
How to Resolve?: Provide valid token in header
Sample Fail Response: 2
{
    
    "msg": "Invalid Access!!",
    "msg_code": "RESTAPI001",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Invalid Access!!
How to Resolve?: Request method will be POST
Sample Fail Response: 3
{
    "errors":["Source Not Allowed"]
    "msg": "Source Not Allowed",
    "msg_code": "RESTAPI103",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Source Not Allowed
How to Resolve?: Provide valid Source
Sample Fail Response: 4
{
    "errors":["Agent Id should not be blank"]
    "msg": "Agent Id should not be blank",
    "msg_code": "RESTAPI104",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Agent Id should not be blank
How to Resolve?: Provide valid Agent Id
Sample Fail Response: 5
{
    "errors":["Invalid Agent Id"]
    "msg": "Invalid Agent Id",
    "msg_code": "RESTAPI104",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Invalid Agent Id
How to Resolve?: Provide valid Agent Id
Sample Fail Response: 6
{
    
    "msg": "Token already used",
    "msg_code": "RESTAPI001",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Token already used
How to Resolve?: You can use token once per request
Sample Fail Response: 7
{
    
    "msg": "Token expire",
    "msg_code": "RESTAPI001",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Token expire
How to Resolve?: Create token again
Sample Fail Response: 8
{
    "errors":["Please enter Enrollment Id"]
    "msg": "Error occurred",
    "msg_code": "RESTAPI110",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InVzZXJuYW1lIjoiRGV2LVR4TW9iaWxlVXNlciIsInBhc3N3b3JkIjoiRGV2LVR4TW9iaWxlUFdEIiwicGluIjoiRGV2LVR4UGluMjAxNyIsInZlbmRvcl9pZCI6IkRldi1UeE1vYmlsZSIsImxvZ19pZCI6ODA0ODMxLCJ1cmwiOiJodHRwczovL2Rldi10eG1vYmlsZS52Y2FyZWNvcnBvcmF0aW9uLmNvbS92Y2FyZU9zc0FwaS8ifSwiZXhwIjoxNTYxNDY4NjI0fQ.9iDehEddu46AKDCVWwl26ZSTTaiKt4GWKn7dUIcIspQ"
}
Error Description: Error occurred
How to Resolve?: Provide Enrollment Id