Skip to content



This function allows you to add a Credit Card to a customer’s account. It accepts the full card number and will respond back with a token.

Request Body Parameters#

Type Description
The customer id
The customer login
The customer login
CardType String Card Type. Default Values include: Visa, MasterCard, American Express, Discover
CardNumber Number Full 16 or 15 digit credit card number. Dashes will automatically be stripped.
ExpirationMonth Number 2 Digit Numeric Month, ex: 04 for March
ExpirationYear Number 4 Digit Numeric Year, ex: 2021
Address1 String Address Line 1
Address2 String Address Line 2
City String City
State String 2 Digit State Code, ex: CA
Zip String Zip Code
Country String 2 Digit Country Code, ex: US

Response Parameters#

Type Description
success Boolean Value of 1 or 0 if the insert was successful
id Number Newly created saved card id
cust_id Number id of customer account, new card was added
fname String First Name on Card
lname String Last Name on Card
exp_month Number Expiration Month
exp_year Number Expiration Year
lastfour Number Last 4 Card Digits
addr1 String Address Line 1
addr2 String Address Line 2
city String City
state String State
zip String Zip Code
cntry String Country
lastused Unix Timestamp Unix Timestamp for last used or 0 = never used
token String MivaPay Token Representing Card
type_id Number Card Type ID. Defaults: 1 = Visa, 2 = MasterCard, 3 = American Express, 4 = Discover
refcount Number Number of Subscriptions this card is linked to
type String Card Type
mod_code String Payment Gateway Module Code being used by MivaPay
meth_code String Payment Gateway Method Code Linked to the Miva Pay Payment Card Type

Example Request#

    "Store_code": "beta",
    "Function": "CustomerPaymentCard_Register",
    "Customer_Login": "bheyde",
    "CardType": "Visa",
    "CardNumber": "4111111111111111",
    "ExpirationMonth": "04",
    "ExpirationYear": "2022",
    "Address1": "123 Main St",
    "Address2": "Apt 203",
    "City": "San Diego",
    "State": "CA",
    "Zip": "92009",
    "Country": "US"

Example Response#

    "success": 1,
    "data": {
        "id": 5,
        "cust_id": 1,
        "fname": "Brennan",
        "lname": "Heyde",
        "exp_month": 4,
        "exp_year": 2022,
        "lastfour": "1111",
        "addr1": "123 Main St",
        "addr2": "Apt 203",
        "city": "San Diego",
        "state": "CA",
        "zip": "92009",
        "cntry": "US",
        "lastused": "0",
        "token": "b10242129df679a455a45a1fc3154c0845afc0078ea25d1147ee706c1036af70",
        "type_id": 1,
        "refcount": 0,
        "type": "Visa",
        "mod_code": "authnet",
        "meth_code": "Visa"