Back to Website
Product Documentation Developers Developer Documents Sync - Sending Payloads to Kodaris

Sync - Sending Payloads to Kodaris

Syncing changes from the ERP to Kodaris plays a vital role when using Kodaris ERP Integrations. When data is added, updated, or deleted, it is important that Kodaris is also updated with the same information. There are numerous ways to update Kodaris with this important information including but not limited to:

  • Data lake integrations with the ERP
  • Direct access from Kodaris to a read replica SQL databases
  • Calling ODATA endpoints from Kodaris
  • Pushing data directly to the Kodaris sync endpoints in whatever fashion you prefer
    • Create scripts reading your ERP updates and then sending the payloads
    • Create ERP plug-ins to push updates via payloads
    • Other methods of pulling updates from the ERP and sending those to Kodaris as payloads

Payload Information

Payloads are just table records from the ERP that can be formatted in multiple different ways. Each payload can hold 1 or more table update records. We suggest keeping payloads under 200 records each. The payload is stored in our system and then processed with Kodaris processors and mapping scripts you define (See JSON Mappings and JS Processors).

We accept payloads in the following formats:

  • TSV (Tab-Separated Values)
  • CSV (Comma-Separated Values)
  • JSON (JavaScript Object Notation)
  • NDJSON (Newline-delimited JavaScript Object Notation)

Example Payload with 2 Records

  • This payload will be stored and each record will run through the mapping processors
  • You can view the payload in the Events section of Kodaris
  • Events will be tried multiple times if there are errors triggering retries. For example, an order item payload may be tried multiple times if the order header payload has not yet been pushed to the system.
[
{
"user11": "",
"user10": "2025-01-02",
"cono": 7200,
"user15": "",
"user14": "",
"user13": "",
"msdschgdt": "?",
"user12": "",
"'' as spacer10": "",
"'' as spacer12": "",
"'' as spacer11": "",
"'' as spacer14": "",
"'' as spacer13": "",
"prrowid": 885187587,
"'' as spacer16": "",
"lifocat": "",
"'' as spacer15": "",
"kittype": "",
"vendcoregrcfl": "no",
"implyqty": 1,
"xxc14": "",
"corecharge": 0,
"user19": "",
"user18": "",
"user17": "",
"webpage": "",
"user16": "",
"warrlength": 0,
"height": 0,
"bodtransferty": "",
"warrtype": "M",
"icspecrecno": 3,
"exponinvfl": "no",
"webpageext": "",
"randommixfl": "no",
"priceonty": "B",
"edicd": "",
"kitrollty": "",
"custgraceper": 0,
"prodtype": "S",
"transproc": "icacp",
"volinfofl": "no",
"reqbundleidfl": "no",
"transtm": "0957",
"unitsell": "",
"nospecrecno": 0,
"tallyunit": "",
"transdt": "01/02/25",
"slgroup": "",
"termsdiscfl": "yes",
"user1": "",
"user22": "GMSGR0V3",
"user2": "",
"user21": "",
"user20": "",
"prod": "MTTI-CISPT",
"termspct": 0,
"user24": "",
"user23": "",
"user9": "?",
"'' as spacer21": "",
"'' as spacer20": "",
"user7": 0,
"'' as spacer23": "",
"user8": "?",
"'' as spacer22": "",
"user5": "",
"'' as spacer25": "",
"user6": 0,
"'' as spacer24": "",
"user3": "",
"user4": "",
"'' as spacer18": "",
"GMS_modifieddate": "2025-01-22 22:30:21.000",
"'' as spacer17": "",
"operinit": "apip",
"'' as spacer19": "",
"enterdt": "01/02/25",
"impliedcoreprod": "",
"cubes": 0,
"width": 0,
"certifiedtype": "",
"unitcnt": "",
"prodcat": "ON01",
"unitconvfl": "no",
"slchgdt": "?",
"vendgraceper": 0,
"weight": 0,
"GMS_deleted": "",
"notesfl": "",
"tiedcompprt": "n",
"'' as spacer1": "",
"memomixfl": "no",
"msdsfl": "no",
"'' as spacer6": "",
"'' as spacer7": "",
"'' as spacer8": "",
"'' as spacer9": "",
"autoupcd": "",
"keyindex": "?",
"'' as spacer2": "",
"'' as spacer3": "",
"'' as spacer4": "",
"'' as spacer5": "",
"kitnsreqfl": "no",
"custcoregrcfl": "no",
"pbseqno": 0,
"unitstock": "EACH",
"seqno": 0,
"length": 0,
"lookupnm": "METALTECH",
"bolclass": "",
"msdssheetno": "",
"sellmult": 0,
"statustype": "A",
"descrip3": "METALTECH 6' JOBSITE BAKER PLATFORM WITH TRAP DOOR I-CISTP",
"descrip_1": "6' JOBSITE BAKER",
"descrip_2": "PLATFORM WITH TRAP DOOR",
"oespecrecno": 0,
"dirtycoreprod": ""
},
{
"user11": "",
"user10": "2025-01-22",
"cono": 7200,
"user15": "",
"user14": "",
"user13": "",
"msdschgdt": "?",
"user12": "",
"'' as spacer10": "",
"'' as spacer12": "",
"'' as spacer11": "",
"'' as spacer14": "",
"'' as spacer13": "",
"prrowid": 893509135,
"'' as spacer16": "",
"lifocat": "",
"'' as spacer15": "",
"kittype": "",
"vendcoregrcfl": "no",
"implyqty": 1,
"xxc14": "",
"corecharge": 0,
"user19": "",
"user18": "",
"user17": "",
"webpage": "",
"user16": "",
"warrlength": 0,
"height": 0,
"bodtransferty": "",
"warrtype": "M",
"icspecrecno": 1,
"exponinvfl": "no",
"webpageext": "",
"randommixfl": "no",
"priceonty": "B",
"edicd": "",
"kitrollty": "",
"custgraceper": 0,
"prodtype": "S",
"transproc": "icacp",
"volinfofl": "no",
"reqbundleidfl": "no",
"transtm": 1300,
"unitsell": "",
"nospecrecno": 0,
"tallyunit": "",
"transdt": "01/22/25",
"slgroup": "",
"termsdiscfl": "yes",
"user1": "",
"user22": "GMSJ2J4R",
"user2": "",
"user21": "",
"user20": "",
"prod": "ZZZFRYDRM-SNAP-IN-50-CF",
"termspct": 0,
"user24": "",
"user23": "",
"user9": "?",
"'' as spacer21": "",
"'' as spacer20": "",
"user7": 0,
"'' as spacer23": "",
"user8": "?",
"'' as spacer22": "",
"user5": "",
"'' as spacer25": "",
"user6": 0,
"'' as spacer24": "",
"user3": "",
"user4": "",
"'' as spacer18": "",
"GMS_modifieddate": "2025-01-22 22:30:21.000",
"'' as spacer17": "",
"operinit": "KMP1",
"'' as spacer19": "",
"enterdt": "01/22/25",
"impliedcoreprod": "",
"cubes": 0,
"width": 0,
"certifiedtype": "",
"unitcnt": "",
"prodcat": "FE01",
"unitconvfl": "no",
"slchgdt": "?",
"vendgraceper": 0,
"weight": 30,
"GMS_deleted": "",
"notesfl": "",
"tiedcompprt": "n",
"'' as spacer1": "",
"memomixfl": "no",
"msdsfl": "no",
"'' as spacer6": "",
"'' as spacer7": "",
"'' as spacer8": "",
"'' as spacer9": "",
"autoupcd": "",
"keyindex": "?",
"'' as spacer2": "",
"'' as spacer3": "",
"'' as spacer4": "",
"'' as spacer5": "",
"kitnsreqfl": "no",
"custcoregrcfl": "no",
"pbseqno": 0,
"unitstock": "PCS",
"seqno": 0,
"length": 0,
"lookupnm": "FRY REGLET",
"bolclass": "",
"msdssheetno": "",
"sellmult": 0,
"statustype": "I",
"descrip3": "FRY REGLET 1/2\" X 10' SNAP IN REVEAL CHEM FILM 30 PER BOX DRM-SNAP-IN-50-CF",
"descrip_1": "FRY 1/2\"X 10' SNAP IN",
"descrip_2": "REVEAL CF",
"oespecrecno": 0,
"dirtycoreprod": ""
}
]

Viewable on the Events Screen

.jpg

Event Details Page

Pushing Payloads Via Kodaris API

Create an Operations API User

Create an API user from the Operations Portal under Employees. This will be used when making API calls to Kodaris to save your payloads.

Save the API Key before you close the window

Assign Proper Roles to the API User

  • At the minimum, the user must have mappedSyncUser role to save payloads
  • If you will be using this user to make other API calls, assign proper roles to the user

Calling the Kodaris API Endpoint

The base URL for all API requests is

https://{yourkodarisurl}.com

The Endpoint to Call

POST

/api/system/mapped/any/file/{mappingCode}/{importType}/{fileType}

URL Parameters

  • fileType (required): The type of record being sent
    • Supported values:
      • TSV (Tab-Separated Values)
      • CSV (Comma-Separated Values)
      • JSON (JavaScript Object Notation)
      • NDJSON (Newline-delimited JavaScript Object Notation)
  • importType (required): Import via batch or direct. The default is batch
  • mappingCode (required): Mapping file code used to map the file being uploaded with its respective mapping file in Kodaris. For example, if the mappingCode is icsp, the system will look for the mapping named mapping-icsp.json under Scripts in Kodaris.

Request Parameters

  • file (required): File with the header(if csv or tsv) to upload into the system
  • email (optional): Email to send sync report - do not use in integrations
  • isUserUpload (optional): Used to indicate if the file was uploaded directly by the user - do not use in integrations

Headers

  • The header must contain the Authorization header with your API key created above
  • Authorization: Bearer

Endpoint Viewed in Swagger

Response Information

The normal response will be similar to what you see on the events screen. Because jobs run this payload later, the results and errors will not be filled in for the payload itself. Those can be seen on the Events screen after Kodaris runs the payload.

{
"success": true,
"errors": [],
"messages": [],
"jsonResult": {},
"errorLineNumbers": [],
"data": {
"date": "Mon Oct 23 03:48:55 UTC 2023",
"path": "payloads/syncOrders_2023-10-23-03-48-55_6835316c-1546-44fa-a1d3-c7492cab78cb.json",
"fileName": "syncOrders_2023-10-23-03-48-55_6835316c-1546-44fa-a1d3-c7492cab78cb.json",
"importType": "batch",
"mappingCode": "oeeh",
"email": null
}
}

This API uses the following error codes:

  • 400 Bad Request: The request was malformed or missing required parameters.
  • 401 Unauthorized: The API key provided was invalid or missing.
  • 404 Not Found: The requested resource was not found.
  • 500 Internal Server Error: An unexpected error occurred on the server.
In this article