Service

Name Add Credit Card
Description Add credit card.
Method POST
URL /bills/card/credit
Example /api/bills/card/credit
Access OWNER, MANAGER, TRAVELER

HTTP Headers

Authorization eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXUyJ9...

Parameters

Fields Type Required Description
first_name text yes Name of the card holder.
last_name text yes Last name of the card holder.
card_number number yes Number of the card.
expiration_date number yes Date of the card expiration.
security_code number yes Code of security for use the card.
address1 text yes The address billing.
address2 text no The address billing.
country text yes Name of the country.
state text yes Name of the state of province.
city text yes Name of the city.
zip_code number yes Number of zip code.
phone_number number yes Number of phone.

Response

            
                {
                    "code": R111,
                    "message": "Success"
                }
            
            

Response Codes

Code Message Cause Possible Frontend Message [Behavior]
EC000 Internal error in API Internal error connecting the database "Oops! Looks like we hit a snag. Try closing the app and reopening it."
EC001 User not found Token user id doesn't match our records "Sorry, We couldn't find your information!"
EC034 Country not found Country doesn't match our records "Please enter a valid Country"
R000 Fail The credit card wasn't added
R111 Success The operation was successful [Show the changes]
SC006 User no authorization The token role is not valid for using the API services "You have been logged out." - [Take the user to the login screen]
SC014 Expired token The token has expired "You have been logged out." - [Take the user to the login screen]
VID105 Invalid input for phone_number Phone_number doesn't have only numbers "Phone must have only numbers"
VID106 Invalid input for first_name First name is empty or it doesn't have only letters "Please fill out this field" - "First name must have only letters"
VID107 Invalid input for last_name Last name is empty or it doesn't have only letters "Please fill out this field" - "Last name must have only letters"
VID152 Invalid input for address Address has only characters not allowed "Please enter a valid address"
VID244 Invalid input for city Last name doesn't have only letters "City must have only letters"
VID252 Invalid input for country Last name doesn't have only letters "Country must have only letters"
VID253 Invalid input for card_number Card_number doesn't have only numbers "Please enter a valid card number"
VID254 Invalid input for expiration_date Expiration_date doesn't have only numbers "Please enter a valid expiration date"
VID255 Invalid input for security_code Security_code doesn't have only numbers "Please enter a valid security code"
VID256 Invalid input for state Last name doesn't have only letters "State must have only letters"
VID257 Invalid input for zip_code Zip code doesn't have only letters and numbers "Zip code must have only numbers