Index

api/v1/cardfilecreate

Path: api/v1/cardfilecreate

Method:POST

Summary:Creates a new CardFile

Description:Use this endpoint as a simple means of creating a CardFile

Query Parameters:

QueueOptionalSet 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.
SubmitRefIdOptionalA 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:

{
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.
optional
"cardCode":string
"name":string
optional
"contact":string
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
optional
"customer":{
"terms":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.
optional
"priceLevel":string
optional
"creditLimit":number
}
"prospect":{
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.
optional
"priceLevel":string
}
When this is set to true, the CardFile created will be ticked as a ship CardFile.
optional
"ship":boolean
"address":{
optional
"isAddressResidential":boolean
"streetAddress":string
"suburb":string
"state":string
"postCode":string
"country":string
}
"deliveryAddress":{
optional
"isAddressResidential":boolean
"streetAddress":string
"suburb":string
"state":string
"postCode":string
"country":string
}
"ACN":string
"ABN":string
"contacts": [{
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.
optional
"primary":boolean
"title":string
"firstName":string
"middleName":string
"lastName":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).
optional
"displayName":string
"jobTitle":string
optional
"department":string
Must be in ISO date format (eg "1995-12-31").
optional
"dob":string
"details": [{
The type of contact detail, for example EMail, Phone, Fax
"type":string
"value":string
optional
"comment":string
}]
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.
optional
"webAccount":{
Flag to indicate if the web logon is enabled. If omitted on creates the account will be enabled.
optional
"enabled":boolean
The logon id for the contact must be unique.
"logonId":string
If not provided Jim2 will automatically generate a password for the contact.
optional
"password":string
}
}]
"groups":{
"region":string
"rl1":string
"rl2":string
"rl3":string
"rl4":string
"rl5":string
"nonRL": [string]
}
The branch code. Branches must be enabled.
optional
"branch":string
The sub-branch code. Sub-branches must be enabled. Note that in the UI sub-branches may be renamed.
optional
"subBranch":string
The GL department code. GL departments must be enabled.
optional
"glDept":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.
optional
"submitRefID":string
Used where custom processing is required and additional data must be passed to that custom processing.
optional
"custom":any
}

Response content:

{
"cardNo":integer
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.
"cardCode":string
}

Example POST

Request:

{
  "cardCode": "EXAMPLE1",
  "name": "Example card file",
  "customer": {

  },

  "ship": true,

  "address": {
    "streetAddress": "street address line 1
street address line 2",
    "suburb": "theBurbs",
    "state": "nsw",
    "postcode": "1234",
    "country":  "Australia"
  },
  "deliveryAddress": {
    "streetAddress": "del street address line 1
del street address line 2",
    "suburb": "delBurbs",
    "state": "qld",
    "postcode": "4321",
    "country":  "Australia"
  },

  "ACN": "ACN here",
  "ABN": "Put ABN here",

  "contacts": [
    {
      "tile": "Dr",
      "firstName": "firstname1",
      "middleName": "middlename1",
      "lastName": "lastname1",
      "displayName": "Disp. Name 1",
      "jobTitle": "Guru!",
      "department": "theDept",
      "dob": "2001-12-31",
      "details": [
        {
          "type": "EMail",
          "value": "someone@nowehere.local",
          "comment": "some comment"
        },
        {
          "type": "phonE",
          "value": "99999999",
          "comment": "some comment"
        }
      ]
    },
    {
      "primary": true,

      "tile": "Mr",
      "firstName": "fname2",
      "middleName": "mname2",
      "lastName": "lname3",
      "displayName": "Primary Contact",
      "jobTitle": "Boss",
      "department": "Dept2",
      "dob": "2002-11-30",
      "details": [
        {
          "type": "EMail",
          "value": "someone2@nowehere.local",
          "comment": "some comment"
        },
        {
          "type": "phonE",
          "value": "99999998",
          "comment": "some comment"
        }
      ]
    },
    {
      "displayName": "A third contact"
    }
  ],

  "groups": {
    "rl1": "cf-1-1",
    "rl2": "cf-2-1",
    "rl3": "cf-3-1",
    "rl4": "cf-4-1",
    "rl5": "cf-5-1",
    "nonRL": [
      "cf-nr1", "cf-nr2"
    ],
    "region": "cf-region2"
  }
}

Response:

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