Back to Website
Product Documentation Developers Integration Hub Employee API - List Payments

Employee API - List Payments

In this guide, we're going to take you through how you can list payments via the Kodaris API.

Video overview:

https://youtu.be/LoFoFDfhAnE?si=ikejtKZtGxhvrG3A
  1. Sign In
    • First, you will want to sign in to an account through the API.
    • Call the endpoint: POST / api/user/employee/apiKeyLogin
      • Headers
        • Accept - application/json
        • Content-Type - application/json
      • Body
        • apiKey - the api key of your api user.
      • Response
        • A response will be returned indicating whether the login was successful or not. The response will also contain your userSessionApiKey that you will need to use on future requests to get responses back as a authenticated user.
  2. Fetch an Auth Token
    • Next, you'll need an authorization token for any API requests you make to the Kodaris API.
    • Fetch one using the endpoint: GET / api/user/employee/authToken
      • Headers
        • Accept - application/json
        • Content-Type - application/json
        • userSessionApiKey - the userSessionApiKey from the /apiKeyLogin endpoint response
      • Response
        • The returned response will contain your auth token that you will need to use on future requests.
  3. List Payments
    • Now you can list payments.
    • Send an API request to endpoint: POST / api/system/payment/list
      • Headers
        • Accept - application/json
        • Content-Type - application/json
        • userSessionApiKey - the userSessionApiKey from the /apiKeyLogin endpoint response
        • X-CSRF-TOKEN - the auth token from the /authToken endpoint response
      • Body
        • filterFields - this holds an array of the filters you want to send to the API
          • externalOrderNumber - if you want to get the payments for a specific order, you can send in a filter on an externalOrderNumber, e.g. 1143-00. See the code example below for how to send in filterFields and each filter.
      • Response
        • The returned response will include a list of payments

Example

// Login to our account
var loginRes = kd.http.fetch({
  method: 'POST',
  url: 'https://commerce.kodaris.com/api/user/employee/apiKeyLogin',
  version: 2,
  body: {
    apiKey: 'xxxx'
  },
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
});

// keep our session token for future requests
var userSessionApiKey = loginRes.body.data.userSessionApiKey;

// get CRSF token for requests
var tokenRes = kd.http.fetch({
  method: 'GET',
  url: 'https://commerce.kodaris.com/api/user/employee/authToken',
  version: 2,
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'userSessionApiKey': userSessionApiKey
  }
});

// keep our token for future requests
var token = tokenRes.body.data;

// get specific payment
var paymentRes = kd.http.fetch({
  method: 'POST',
  url: 'https://commerce.kodaris.com/api/system/payment/list',
  version: 2,
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'userSessionApiKey': userSessionApiKey,
    'X-CSRF-TOKEN': token
  },
  body: {
    
    // if you'd like to list specific payments,
    // you can send in filter fields to the API
    filterFields: [
      {
        name: 'externalOrderNumber', // filter on your order number
        operation: 'IS',
        value: '1143-00' // your order number
      }
    ]
  }
});

kd.log('paymentRes', paymentRes);

-> response ->
{
  "status" : 200,
  "errors" : null,
  "body" : {
    "success" : true,
    "code" : 200,
    "messages" : { },
    "errors" : { },
    "data" : {
      "size" : 10,
      "number" : 0,
      "totalElements" : 1,
      "isLast" : true,
      "totalPages" : 1,
      "isFirst" : true,
      "hasPrevious" : false,
      "hasNext" : false,
      "numberOfElements" : 1,
      "offset" : null,
      "content" : {
        "0" : {
          "code" : null,
          "status" : "Received",
          "processorClassName" : "xxxx",
          "valueFieldLabels" : "xxxx",
          "creditCardName" : "Company Payment Method",
          "creditCardType" : "Visa",
          "creditCardDate" : "1225",
          "creditCardNumber" : null,
          "creditCardNumberDisplay" : "XXXX XXXX XXXX 4242",
          "value1" : "cardAccount",
          "value2" : "Sale",
          "value3" : null,
          "value4" : "0",
          "value5" : "X",
          "value6" : "xxxx",
          "value7" : "xxxx",
          "value8" : "Approved",
          "value9" : "xxxx",
          "amount" : 45.36,
          "amountToPay" : null,
          "paymentReason" : null,
          "extra1" : "0",
          "extra2" : null,
          "extra3" : null,
          "paymentProfileID" : "xxxx",
          "paymentDate" : null,
          "scheduledDate" : null,
          "discountAmount" : 0,
          "discountDate" : null,
          "invoiceAmount" : 0,
          "invoiceDate" : null,
          "dueDate" : null,
          "checkNumber" : null,
          "sequenceNumber" : null,
          "sourceCode" : null,
          "transactionType" : "CompanyPayment",
          "transactionTypeLabel" : null,
          "shipto" : null,
          "journalNumber" : null,
          "setNumber" : null,
          "active" : true,
          "companyID" : 1171,
          "externalOrderNumber" : "1143-00",
          "jsonPaymentDetails" : null,
          "originalDiscountAmount" : null,
          "sourceModifiedTime" : null,
          "batchDate" : null,
          "reconciledDate" : null,
          "warehouseCode" : null,
          "merchantAccountID" : "xxxx",
          "terminalID" : 28,
          "paymentTransactionNumber" : null,
          "webPaymentID" : null,
          "state" : null,
          "ipAddress" : null,
          "cardName" : null,
          "cardZipCode" : null,
          "cardAddress" : null,
          "cardCity" : null,
          "hostCode" : null,
          "paymentMethodExternalToken" : "xxxx",
          "paymentMethodCardType" : "CREDIT",
          "paymentID" : 1723,
          "companyName" : null,
          "companyCode" : null,
          "paymentType" : "SALE",
          "created" : "2025-07-23 12:08:49:427",
          "autotimestamp" : "2025-07-23 12:08:49.0",
          "feeAmount" : 1.59,
          "feeLabel" : "Non-cash adjustment",
          "feeRate" : 0.035,
          "paymentReceiptEmail" : null,
          "generatedReceipt" : null,
          "lastIndexed" : "2025-07-23 12:15:01",
          "needsIndexing" : false
        }
      },
... omitted for brevity
In this article