Path: api/v1/cardfilecreate
This endpoint supports the following methods:
POST
Summary: Creates a new CardFile
Description: Use this endpoint as a simple means of creating a CardFile
Query Parameters
| Parameter | Optional | Description |
|---|---|---|
| Queue | ✓ | Set to true, 1, or t to queue the request via the Jim2 eBusiness Queue. If specified the response will be 202 Accepted and the B2B request number will be returned. Leave out, or set to false, 0, or f to process the request immediately. |
| SubmitRefId | ✓ | A unique reference ID for the request. This is used to prevent duplicate requests when the Queue parameter is also passed. If a SubmitRefId is passed via this
query parameter and within the request content (see submitRefId in JSON content) then the two values must be the same. A check for duplication due to re-processing
on the B2B queue is NOT performed unless the SubmitRefId is included in the request body (ie not passing the SubmitRefId in the message body allows an item on the
B2B queue to be reprocessed and potentially creating a duplicate object). The Queue parameter must also be specified if SubmitRefId is specified. Note that the SubmitRefId must be unique to Jim2, so if multiple systems are making calls care must be taken to avoid clashes in SubmitRefIds between systems. |
Request content
| Attribute | Type | Required | Description |
|---|---|---|---|
| ABN | string | The Australian Business Number (ABN). | |
| ACN | string | The Australian Company Number (ACN). | |
| address | object | The card file's main (postal) address. See the address section below. |
|
| branch | string | The branch code. Branches must be enabled. | |
| cardCode | string | The cardCode can be left out or set to blank in which case Jim2 will attempt to generate a suitable cardCode from the provided name. Refer to the response. | |
| contact | string | The primary contact name on the card. | |
| contacts | array of object | The contacts to add to the card file. If no contacts are supplied an empty primary contact is created. See the contacts section below. |
|
| custom | any | A free-form JSON object carrying additional data for custom processing. Used where custom processing is required and additional data must be passed to that custom processing. | |
| customer | object | The presence of this object indicates if the card file is a customer card file or not. If no values within this object are required (eg terms) but the card file is to be a customer then this object must be included even though it can be left empty. If the card file is not a customer cardfile then this object should be left out (preferred) or set to null See the customer section below. |
|
| deliveryAddress | object | The card file's delivery (ship-to) address. See the deliveryAddress section below. |
|
| glDept | string | The GL department code. GL departments must be enabled. | |
| groups | object | The reporting-level and other groups to assign to the card file. See the groups section below. |
|
| name | string | ✓ | The card file name. |
| prospect | object | The presence of this object indicates whether the card file is a prospect. If no values within this object are required but the card file is to be a prospect then this object must be included even though it can be left empty. If the card file is not a prospect then this object should be left out (preferred) or set to null. See the prospect section below. |
|
| ship | boolean | When this is set to true, the CardFile created will be ticked as a ship CardFile. | |
| subBranch | string | The sub-branch code. Sub-branches must be enabled. Note that in the UI sub-branches may be renamed. | |
| submitRefID | string | A unique reference for the create request. This reference must be unique for each object and can be used to ensure duplicate objects are not created when re-trying API calls. Note this reference must be unique in Jim2, so if multiple systems are creating objects care must be taken to avoid clashes between the different system's submit ref id. Refer also to the SubmitRefId url query parameter for relevant endpoints. |
Attributes of the address object.
| Attribute | Type | Required | Description |
|---|---|---|---|
| country | string | The country. | |
| isAddressResidential | boolean | Whether the address is residential. | |
| postCode | string | The post code. | |
| state | string | The state. | |
| streetAddress | string | The street address. | |
| suburb | string | The suburb. |
Attributes of each element in the contacts array.
| Attribute | Type | Required | Description |
|---|---|---|---|
| department | string | The contact's department. | |
| details | array of object | See the contacts.details section below. | |
| displayName | string | The contact display name. If not specified this will be generated from the firstName and secondName (refer to behaviour in Jim2 when editing a card file contact). | |
| dob | string | Must be in ISO date format (eg "1995-12-31"). | |
| firstName | string | The contact's first name. | |
| jobTitle | string | The contact's job title. | |
| lastName | string | The contact's last name. | |
| middleName | string | The contact's middle name. | |
| primary | boolean | Only one contact can be primary. If more than one contact is set as primary the last primary contact processed will be the primary contact. | |
| title | string | The contact's title (e.g. Mr, Ms). | |
| webAccount | object | Supply this if the contact is to have a web account setup - leave this out or set to null if the contact is not to have a web account. See the contacts.webAccount section below. |
Attributes of the customer object.
| Attribute | Type | Required | Description |
|---|---|---|---|
| creditLimit | number | The customer's credit limit. | |
| priceLevel | string | NOTE: if the card file being created is to be a customer and a prospect, then card file's the priceLevel can be set in the customer or the prospect objects or both. If in both the MUST be the same or the call will fail. | |
| terms | string | The customer's payment terms code. |
Attributes of the deliveryAddress object.
| Attribute | Type | Required | Description |
|---|---|---|---|
| country | string | The country. | |
| isAddressResidential | boolean | Whether the address is residential. | |
| postCode | string | The post code. | |
| state | string | The state. | |
| streetAddress | string | The street address. | |
| suburb | string | The suburb. |
Attributes of the groups object.
| Attribute | Type | Required | Description |
|---|---|---|---|
| nonRL | array of string | An array of group names that are not reporting-level groups. | |
| region | string | The region group name. | |
| rl1 | string | The group name at reporting level 1. | |
| rl2 | string | The group name at reporting level 2. | |
| rl3 | string | The group name at reporting level 3. | |
| rl4 | string | The group name at reporting level 4. | |
| rl5 | string | The group name at reporting level 5. |
Attributes of the prospect object.
| Attribute | Type | Required | Description |
|---|---|---|---|
| priceLevel | string | NOTE: if the card file being created is to be a customer and a prospect, then card file's the priceLevel can be set in the customer or the prospect objects or both. If in both the MUST be the same or the call will fail. |
Attributes of each element in the contacts.details array.
| Attribute | Type | Required | Description |
|---|---|---|---|
| comment | string | A comment for the contact detail. | |
| type | string | ✓ | The type of contact detail, for example EMail, Phone, Fax |
| value | string | ✓ | The contact detail value. |
Attributes of the contacts.webAccount object.
| Attribute | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | Flag to indicate if the web logon is enabled. If omitted on creates the account will be enabled. | |
| logonId | string | ✓ | The logon id for the contact must be unique. |
| password | string | If not provided Jim2 will automatically generate a password for the contact. |
Response content
| Attribute | Type | Description |
|---|---|---|
| cardCode | string | The cardCode - this can be useful if a cardCode was not included in the request in which case this will be the generated code, otherwise this will be the cardCode provided in the request. |
| cardNo | integer | The number of the created card file. |
Request: Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example POST
{
"submitRefID": "CARD-REQ-0001",
"cardCode": "ACME",
"name": "Acme Corporation Pty Ltd",
"contact": "Jane Smith",
"customer": {
"terms": "30 Days",
"priceLevel": "Retail",
"creditLimit": 50000.00
},
"prospect": {
"priceLevel": "Retail"
},
"ship": false,
"address": {
"isAddressResidential": false,
"streetAddress": "12 Industrial Ave",
"suburb": "Chatswood",
"state": "NSW",
"postCode": "2067",
"country": "Australia"
},
"deliveryAddress": {
"isAddressResidential": false,
"streetAddress": "14 Industrial Ave",
"suburb": "Chatswood",
"state": "NSW",
"postCode": "2067",
"country": "Australia"
},
"ACN": "004 085 616",
"ABN": "53 004 085 616",
"contacts": [
{
"primary": true,
"title": "Ms",
"firstName": "Jane",
"middleName": "A",
"lastName": "Smith",
"displayName": "Jane Smith",
"jobTitle": "Procurement Manager",
"department": "Purchasing",
"dob": "1985-06-15",
"details": [
{
"type": "EMail",
"value": "jane.smith@acme.example",
"comment": "Work email"
}
],
"webAccount": {
"enabled": true,
"logonId": "jane.smith",
"password": "ChangeMe123!"
}
}
],
"groups": {
"rl1": "East Coast",
"rl2": "Manufacturing",
"rl3": "Tier 1",
"rl4": "Direct",
"rl5": "Key Account",
"nonRL": [
"Newsletter",
"VIP"
],
"region": "NSW"
},
"branch": "SYD",
"subBranch": "SYD-NORTH",
"glDept": "SALES",
"custom": {
"externalRef": "EXT-12345"
}
}
{
"cardNo": 1234,
"cardCode": "EXAMPLE1"
}