Index | Conventions

api/v1/cardfilecreate

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

ParameterOptionalDescription
QueueSet 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.
SubmitRefIdA 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

AttributeTypeRequiredDescription
ABNstringThe Australian Business Number (ABN).
ACNstringThe Australian Company Number (ACN).
addressobjectThe card file's main (postal) address.
See the address section below.
branchstringThe branch code. Branches must be enabled.
cardCodestringThe 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.
contactstringThe primary contact name on the card.
contactsarray of objectThe contacts to add to the card file. If no contacts are supplied an empty primary contact is created.
See the contacts section below.
customanyA 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.
customerobjectThe 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.
deliveryAddressobjectThe card file's delivery (ship-to) address.
See the deliveryAddress section below.
glDeptstringThe GL department code. GL departments must be enabled.
groupsobjectThe reporting-level and other groups to assign to the card file.
See the groups section below.
namestringThe card file name.
prospectobjectThe 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.
shipbooleanWhen this is set to true, the CardFile created will be ticked as a ship CardFile.
subBranchstringThe sub-branch code. Sub-branches must be enabled. Note that in the UI sub-branches may be renamed.
submitRefIDstringA 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.

address

Attributes of the address object.

AttributeTypeRequiredDescription
countrystringThe country.
isAddressResidentialbooleanWhether the address is residential.
postCodestringThe post code.
statestringThe state.
streetAddressstringThe street address.
suburbstringThe suburb.

contacts

Attributes of each element in the contacts array.

AttributeTypeRequiredDescription
departmentstringThe contact's department.
detailsarray of objectSee the contacts.details section below.
displayNamestringThe 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).
dobstringMust be in ISO date format (eg "1995-12-31").
firstNamestringThe contact's first name.
jobTitlestringThe contact's job title.
lastNamestringThe contact's last name.
middleNamestringThe contact's middle name.
primarybooleanOnly one contact can be primary. If more than one contact is set as primary the last primary contact processed will be the primary contact.
titlestringThe contact's title (e.g. Mr, Ms).
webAccountobjectSupply 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.

customer

Attributes of the customer object.

AttributeTypeRequiredDescription
creditLimitnumberThe customer's credit limit.
priceLevelstringNOTE: 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.
termsstringThe customer's payment terms code.

deliveryAddress

Attributes of the deliveryAddress object.

AttributeTypeRequiredDescription
countrystringThe country.
isAddressResidentialbooleanWhether the address is residential.
postCodestringThe post code.
statestringThe state.
streetAddressstringThe street address.
suburbstringThe suburb.

groups

Attributes of the groups object.

AttributeTypeRequiredDescription
nonRLarray of stringAn array of group names that are not reporting-level groups.
regionstringThe region group name.
rl1stringThe group name at reporting level 1.
rl2stringThe group name at reporting level 2.
rl3stringThe group name at reporting level 3.
rl4stringThe group name at reporting level 4.
rl5stringThe group name at reporting level 5.

prospect

Attributes of the prospect object.

AttributeTypeRequiredDescription
priceLevelstringNOTE: 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.

contacts.details

Attributes of each element in the contacts.details array.

AttributeTypeRequiredDescription
commentstringA comment for the contact detail.
typestringThe type of contact detail, for example EMail, Phone, Fax
valuestringThe contact detail value.

contacts.webAccount

Attributes of the contacts.webAccount object.

AttributeTypeRequiredDescription
enabledbooleanFlag to indicate if the web logon is enabled. If omitted on creates the account will be enabled.
logonIdstringThe logon id for the contact must be unique.
passwordstringIf not provided Jim2 will automatically generate a password for the contact.

Response content

AttributeTypeDescription
cardCodestringThe 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.
cardNointegerThe number of the created card file.

Example POST

Request:

{
    "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"
    }
}

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.

{
  "cardNo":  1234,
  "cardCode": "EXAMPLE1"
}