Commerce SDK (CSDK) transaction flows: sale, void, refund, cancel and lookup
Commerce SDK (CSDK) sales, voids and refunds follow the same sequence: send startPaymentTransaction, store the chanId, poll getPaymentTransactionStatus until it shows completed = true, then read the result: APPROVED, DECLINED or FAILED. Start of Service, cancelling a transaction and looking one up use their own commands, listed below.
On this page
This is a condensed summary of the CSDK transaction flows in Elavon’s developer documentation. For every parameter and response field, see Elavon’s Commerce SDK documentation.
How do I run Start of Service (opening the application)?
Run this when your application opens. The paymentGatewayId you store in step 2 is used by every transaction that day.
- Send
openPaymentGatewaycommand - Capture/Store the
paymentGatewayIdfor use throughout the day - Send
setDeviceConnectionConfigurationcommand with parameters of the peripherals that will be used - Send
startCardReadersSearchcommand - Poll
getCardReadersSearchStatuscommand untildata->cardReadersSearch->completed = true- a) If successful in locating the reader, it will be listed in an array
data->cardReadersSearch->cardReaders - b) If failure, send
getDeviceConnectionConfigurationcommand to validate the configurations from step 3 were setup properly
- a) If successful in locating the reader, it will be listed in an array
How do I process a Card Present Sale (EMV/NFC/MSR)?
Use this when the cardholder inserts, taps or swipes their card.
- Send
startPaymentTransactioncommand: includepaymentGatewayIdfrom “Start of Service” step 2 &transactionType = SALE - Capture/Store the
chanIdfor use throughout this transaction - Poll
getPaymentTransactionStatuscommand: includepaymentGatewayId&chanId- a) Continue polling until
data->paymentGatewayCommand->completed = true - b) If the array
requiredInformationappears in the response, parse the value and send acontinuePaymentTransactioncommand with the requiste information (see “Process a Card Not Present Sale” step # for reference)
- a) Continue polling until
- Parse through the response in step 3a for
data->paymentGatewayCommand->paymentTransactionData->result- a) If APPROVED, capture/store the rest of the information within
data->paymentGatewayCommand->paymentTransactionDataand handle as needed within your payment solution (internal record keeping, receipt creating/printing, notifying the merchant and cardholder) - b) If DECLINED, notify the merchant and cardholder and prompt for another form of payment or different card (potentially start over at step 1)
- c) If FAILED, parse the information within
data->paymentGatewayCommand->paymentTransactionData->errorsto determine the issue and handle accordingly (communication issues, card reader failures, card failure, user failure)
- a) If APPROVED, capture/store the rest of the information within
How do I process a Void of a Sale?
To void a sale, you need the originalTransId you stored when the sale was approved.
- Send
startPaymentTransactioncommand: includepaymentGatewayIdfrom “Start of Service” step 2,transactionType = VOID, &originalTransId(captured from “Process a Card Present Sale” step 4a) - Capture/Store the
chanIdfor use throughout this transaction - Poll
getPaymentTransactionStatuscommand: includepaymentGatewayId&chanId- a) Continue polling until
data->paymentGatewayCommand->completed = true
- a) Continue polling until
- Parse through the response for
data->paymentGatewayCommand->paymentTransactionData->result- a) If APPROVED, capture/store the rest of the information within
data->paymentGatewayCommand->paymentTransactionDataand handle as needed within your payment solution (internal record keeping, receipt creating/printing, notifying the merchant and cardholder) - b) If DECLINED, notify the merchant and cardholder (potentially start over at step 1 or look to completing a Stand-Alone Refund)
- c) If FAILED, parse the information within
data->paymentGatewayCommand->paymentTransactionData->errorsto determine the issue and handle accordingly (communication issues, card reader failures, card failure, user failure)
- a) If APPROVED, capture/store the rest of the information within
How do I process a Stand-Alone Refund?
A stand-alone refund doesn’t need the original transaction ID.
- Send
startPaymentTransactioncommand: includepaymentGatewayIdfrom “Start of Service” step 2 &transactionType = STANDALONE_REFUND - Capture/Store the
chanIdfor use throughout this transaction - Poll
getPaymentTransactionStatuscommand: includepaymentGatewayId&chanId- a) Continue polling until
data->paymentGatewayCommand->completed = true
- a) Continue polling until
- Parse through the response for
data->paymentGatewayCommand->paymentTransactionData->result- a) If APPROVED, capture/store the rest of the information within
data->paymentGatewayCommand->paymentTransactionDataand handle as needed within your payment solution (internal record keeping, receipt creating/printing, notifying the merchant and cardholder) - b) If DECLINED, notify the merchant and cardholder (potentially start over at step 1)
- c) If FAILED, parse the information within
data->paymentGatewayCommand->paymentTransactionData->errorsto determine the issue and handle accordingly (communication issues, card reader failures, card failure, user failure)
- a) If APPROVED, capture/store the rest of the information within
How do I process a Linked Refund?
A linked refund is tied to the original sale, so you include its originalTransId.
- Send
startPaymentTransactioncommand: includepaymentGatewayIdfrom “Start of Service” step 2,transactionType = LINKED_REFUND, &originalTransId(captured from “Process a Card Present Sale” step 4a) - Capture/Store the
chanIdfor use throughout this transaction - Poll
getPaymentTransactionStatuscommand: includepaymentGatewayId&chanId- a) Continue polling until
data->paymentGatewayCommand->completed = true
- a) Continue polling until
- Parse through the response for
data->paymentGatewayCommand->paymentTransactionData->result- a) If APPROVED, capture/store the rest of the information within
data->paymentGatewayCommand->paymentTransactionDataand handle as needed within your payment solution (internal record keeping, receipt creating/printing, notifying the merchant and cardholder) - b) If DECLINED, notify the merchant and cardholder (potentially start over at step 1 or look to completing a Stand-Alone Refund)
- c) If FAILED, parse the information within
data->paymentGatewayCommand->paymentTransactionData->errorsto determine the issue and handle accordingly (communication issues, card reader failures, card failure, user failure)
- a) If APPROVED, capture/store the rest of the information within
How do I process a Card Not Present Sale?
Use this when the card details are keyed in rather than read by the device.
- Send
startPaymentTransactioncommand: includepaymentGatewayIdfrom “Start of Service” step 2,transactionType = SALE, &cardEntryTypes = ["MANUALLY_ENTERED"] - Capture/Store the
chanIdfor use throughout this transaction - Send
continuePaymentTransactioncommand: includepaymentGatewayId,chanId, andcardPresentset to eithertrueorfalse - Poll
getPaymentTransactionStatuscommand: includepaymentGatewayId&chanId- a) Continue polling until
data->paymentGatewayCommand->completed = true
- a) Continue polling until
- Parse through the response for
data->paymentGatewayCommand->paymentTransactionData->result- a) If APPROVED, capture/store the rest of the information within
data->paymentGatewayCommand->paymentTransactionDataand handle as needed within your payment solution (internal record keeping, receipt creating/printing, notifying the merchant and cardholder) - b) If DECLINED, notify the merchant and cardholder (potentially start over at step 1 or look to completing a Stand-Alone Refund)
- c) If FAILED, parse the information within
data->paymentGatewayCommand->paymentTransactionData->errorsto determine the issue and handle accordingly (communication issues, card reader failures, card failure, user failure)
- a) If APPROVED, capture/store the rest of the information within
How do I cancel an active transaction?
Use this while the cardholder is interacting with the PinPad/Peripheral/Device.
- Send
cancelPaymentTransactioncommand: includepaymentGatewayId&chanId - Poll
getPaymentTransactionStatuscommand: includepaymentGatewayId&chanId- a) Continue polling until
data->paymentGatewayCommand->completed = true
- a) Continue polling until
- Parse through the response for
data->paymentGatewayCommand->paymentTransactionData->resultThis will show “FAILED”, with
data->paymentGatewayCommand->paymentTransactionData->errors="ECLCommerceError ECLTransactionCanceled"
How do I look up a transaction?
- Send
searchPaymentTransactioncommand: includepaymentGatewayId& any relevant data that would be associated with the specific transaction being searched - Parse through the response for
data->paymentGatewayCommand->transactionSearchResults->transactionsfor any transaction objects for the specific transaction being searched
Updated November 2, 2026
Still stuck? Talk to a person.
Our team answers the phone.
Building payments into your software? See Cartis payment integration