Manage stored cards
These methods manage the debit and credit cards stored for an account or a customer, the same list as Debit/Credit Cards in the panel. A stored card is used by makePayment and by automatic charges on low balance. Every method takes either i_account or i_customer to name the card owner.
The card number is returned only as its last four digits, and the CVV is not returned at all. Still, send card data only over HTTPS and never log the requests.
Card structure
Section titled “Card structure”| Name | Type | Description |
|---|---|---|
i_debit_credit_card |
int | ID of the card |
alias |
string | Alias, a name the payer gives the card |
primary |
boolean | Primary Card: True for the card used when no card is named |
i_card_type |
int | Card Type |
card_name |
string | Readable card type, for example Visa or MasterCard. Returned by listDebitCreditCards |
holder |
string | Card Holder |
number |
string | Card Number. Full number when you add a card; only the last four digits in results |
exp_mm |
int | Expiry month, 1 to 12 |
exp_yy |
int | Expiry year, four digits, for example 2028 |
cvv |
string | CVV/CVC. Accepted when you add or update a card, never returned |
street_addr1, street_addr2 |
string | Billing address lines, Address 1 and Address 2 |
city |
string | City |
state |
string | Province/State |
postal_code |
string | ZIP/Postal Code |
country |
string | Country, as an ISO 3166 country code |
phone |
string | Phone |
addDebitCreditCard
Section titled “addDebitCreditCard”Stores a new card.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | one of | ID of the account that owns the card |
i_customer |
int | one of | ID of the customer that owns the card |
| … | The fields of the card structure except i_debit_credit_card and card_name. Send the full number |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
i_debit_credit_card |
int | ID of the new card |
Example
Section titled “Example”call("addDebitCreditCard", { "i_account": 3092, "alias": "Company Visa", "primary": True, "i_card_type": 1, "holder": "Jane Doe", "number": "4111111111111111", "exp_mm": 9, "exp_yy": 2028, "cvv": "123", "street_addr1": "1 Example Street", "street_addr2": "", "city": "Springfield", "state": "IL", "postal_code": "62701", "country": "US", "phone": "+12175550100",}){"result": "OK", "i_debit_credit_card": 41}updateDebitCreditCard
Section titled “updateDebitCreditCard”Changes a stored card. The panel does not let you change the card number or the card type: to replace them, delete the card and add it again.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | one of | ID of the account that owns the card |
i_customer |
int | one of | ID of the customer that owns the card |
i_debit_credit_card |
int | yes | ID of the card |
primary |
boolean | no | Send True to make this the primary card |
cvv |
string | no | New CVV. Leave it out to keep the stored one |
| … | alias, holder, exp_mm, exp_yy and the billing address fields of the card structure |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
Example
Section titled “Example”call("updateDebitCreditCard", { "i_account": 3092, "i_debit_credit_card": 41, "alias": "Company Visa", "holder": "Jane Doe", "exp_mm": 9, "exp_yy": 2030, "street_addr1": "1 Example Street", "street_addr2": "", "city": "Springfield", "state": "IL", "postal_code": "62701", "country": "US", "phone": "+12175550100",}){"result": "OK"}deleteDebitCreditCard
Section titled “deleteDebitCreditCard”Deletes a stored card.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | one of | ID of the account that owns the card |
i_customer |
int | one of | ID of the customer that owns the card |
i_debit_credit_card |
int | yes | ID of the card |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
Example
Section titled “Example”call("deleteDebitCreditCard", {"i_account": 3092, "i_debit_credit_card": 41}){"result": "OK"}getDebitCreditCardInfo
Section titled “getDebitCreditCardInfo”Returns one stored card.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | one of | ID of the account that owns the card |
i_customer |
int | one of | ID of the customer that owns the card |
i_debit_credit_card |
int | yes | ID of the card |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
| … | The fields of the card structure except cvv and card_name |
Example
Section titled “Example”call("getDebitCreditCardInfo", {"i_account": 3092, "i_debit_credit_card": 41}){ "result": "OK", "i_debit_credit_card": 41, "alias": "Company Visa", "primary": True, "i_card_type": 1, "holder": "Jane Doe", "number": "1111", "exp_mm": 9, "exp_yy": 2028, "street_addr1": "1 Example Street", "street_addr2": "", "city": "Springfield", "state": "IL", "postal_code": "62701", "country": "US", "phone": "+12175550100",}listDebitCreditCards
Section titled “listDebitCreditCards”Lists the stored cards of an account or customer.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | one of | ID of the account |
i_customer |
int | one of | ID of the customer |
offset |
int | no | Skip this many cards |
limit |
int | no | Return at most this many cards |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
debit_credit_cards |
array | The cards, each with i_debit_credit_card, primary, alias, i_card_type, card_name, number (last four digits), exp_mm and exp_yy |
Example
Section titled “Example”call("listDebitCreditCards", {"i_account": 3092}){ "result": "OK", "debit_credit_cards": [ { "i_debit_credit_card": 41, "primary": True, "alias": "Company Visa", "i_card_type": 1, "card_name": "Visa", "number": "1111", "exp_mm": 9, "exp_yy": 2028, }, ],}Related
Section titled “Related”- Payments: Debit/Credit Cards in the panel
- Make a card payment
- Manage low balance settings