JSON API » cards » cards/batches/create
Creates one or more batches of new cards.
Input parameters
Requires authentication and the cards role privilege.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| cardgroup | Integer | ID of the card group to create the cards in. | Yes | |
| batch_name | String | Name of the batch. If batch_number is greater than 1, a suffix will be added to each. | Yes | |
| balance | Decimal | Balance of each new card. | No | 0.00 |
| batch_number | Integer | The number of batches to create. | No | 1 |
| card_length | Integer | Length of cards. | No | Default for group. |
| currency | String | Currency of cards. | No | Default for group. |
| lock_cards | Integer | 1 to lock cards, 0 not to. | No | 0 |
| locked | Integer | 1 to lock batches, 0 not to. | No | 0 |
| method | String | Method for allocating card numbers. "random" or "sequential". | No | Default for group. |
| number | Integer | Number of cards to create in each batch. | No | 1 |
| pin_length | Integer | Length of PIN. | No | Default for group. |
| validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
| Code | Description |
|---|---|
| 200 | Success. |
| 201 | Input passed validation. Only returned if validation=1. |
| 400 | Invalid input parameters specified. Check the key and message fields for more details. |
| 401 | The authentication details provided are invalid. |
| 402 | Your role does not allow this. |
| 404 | The card group does not exist, or you do not have permission to update it. |
| 500 | An 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
| Version | Changes |
|---|---|
| 3.13 | Function added. |
