JSON API » cards » cards/batches/create

Creates one or more batches of new cards.

Input parameters

Requires authentication and the cards role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
cardgroupIntegerID of the card group to create the cards in.Yes
batch_nameStringName of the batch. If batch_number is greater than 1, a suffix will be added to each.Yes
balanceDecimalBalance of each new card.No0.00
batch_numberIntegerThe number of batches to create.No1
card_lengthIntegerLength of cards.NoDefault for group.
currencyStringCurrency of cards.NoDefault for group.
lock_cardsInteger1 to lock cards, 0 not to.No0
lockedInteger1 to lock batches, 0 not to.No0
methodStringMethod for allocating card numbers. "random" or "sequential".NoDefault for group.
numberIntegerNumber of cards to create in each batch.No1
pin_lengthIntegerLength of PIN.NoDefault for group.
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
404The card group does not exist, or you do not have permission to update it.
500An internal error occurred. Check the key and message fields for more details.

Data returned

The IDs of the created batches.

Example: With required parameters

http://enswitch.example.com/api/json/cards/batches/create/?auth_username=user;auth_password=password;batch_name=example

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }

Change history

VersionChanges
3.13Function added.