Generate a New Customer Card Number
Creates a random card number of a given length and checks that this number is unique and not in use already in the account.
The data to be submitted to the API is composed of the following fields:
|
|
field |
|
Example |
|
Note |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_password |
|
1959caadac9b13dcb3 |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
type |
|
generate_card_number |
|
Required |
|
|
|
how_many_digits |
|
(# of digits) |
|
Optional |
|
|
|
card_number_prefix |
|
(any digits) |
|
Optional |
|
|
|
card_number_suffix |
|
(any digits) |
|
Optional |
|
|
|
|
|
|
|
|
|
|
|
Output Format: |
|
|
|
output |
|
JSON or XML |
|
Optional. If not provided, defaults to XML |
|
|
|
callback |
|
someFunctionName |
|
Optional: JSONP format |
|
|
|
condensed |
|
yes |
|
Optional (No white space) Applies only to JSON(P) output |
|
|
|
|
|
|
|
|
|
Notes:
- The how_many_digits parameter is optional: if it is not given, it will default to 16 digits.
Example PHP Request:
If you are using PHP, the $data array would look like this:
- $data['user_id'] = 'john1970';
- $data['user_password'] = '1959caadac9b13dcb3';
- $data['account_id'] = 'greatwidgets';
- $data['type'] = 'generate_card_number';
- or: $data['how_many_digits'] = 10; // for 10-digit number.
Success XML Response:
- <response status="success">
- <customer>
- <card_number>1234567890</card_number>
- </customer>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|