Skip to main content (Press Enter)
Helcim Logo
Click here if you return to contents

Purchase Using Mag-Data

Please note that merchants cannot send full card numbers via API unless they have obtained an exception.

This API call lets you process a sale with a credit card magnetic data (unencrypted or encrypted). The response is an XML of the processed transaction.

Request Fields

Field Name Type Required Description
transactionType String Yes purchase
accountId Integer Yes The Helcim Commerce account ID.
apiToken String Yes API token used for authentication and access control.
terminalId Integer Yes The terminal ID.
amount Decimal Yes The transaction amount.
cardMag String Yes The credit card magnetic strip data. (Use this input if the magnetic stripe data is not encrypted, or use the cardMagEnc and serialNumber if the magnetic stripe data is encrypted.
serialNumber String Yes The terminal serial number.
cardMagEnc String Yes The credit card magnetic strip data (Encrypted).

Response Fields (XML)

Field Name Type Description
message - XML structure
response Integer 1 or 0. Whether the transaction was approved or declined.
responseMessage String Result of transaction (Approved/Denied).
notice String Error/warning message from Helcim.
transaction - XML structure
transactionId Integer The transaction ID.
type String The transaction type (purchase, refund, pre-auth, capture).
date String The date of the transactions
time String The time of the transaction.
cardHolderName String The card holder's name.
amount Decimal The amount of the transactions.
currency String The currency of the transaction.
cardnumber String The credit card number (first 4 and last 4 digits only).
cardToken String The credit card token.
expiryDate Integer The credit card expiry date.
cardType String The credit card type (Visa, Mastercard, Amex, Discovery).
avsResponse String The address verification response.
cvvResponse String The CVV verification response.
approvalCode String The approval code.
orderNumber String The order number.
customerCode String The customer code.


For all API requests, there are also generic API authentication and user access restriction errors.

Response Code Error Code Message Description
0 - Invalid Amount The transaction amount was not entered.
0 - Declined - Invalid Card Number Invalid Expiry Date The credit card number and/or expiry date was not entered or is invalid.
0 - Card F4L4 Does Not Match Card Token The first 4 and last 4 digits of the credit card do not match the data of the credit card token.
0 - Card Token Belongs to Another Customer ID The card token does not match the customer code.

Related Articles

General Request Fields
Refund or Return
Capture - Force
Batch Settlement
Response Fields
A Void
Pre-Authorization or Preauth with Customer Code
Preauthorization or Preauth with Card Token
Refund or Return with Card Token
Purchase or Sale
Purchase Using a Card Token
Purchase Using a Customer Code
Pre-Authorization or Preauth
Verification - Only

Was this article helpful?

Feedback submitted - Thank you!

If you need immediate assistance please contact our Merchant Experience Specialists here