Sale

This is the most commonly used gateway function and is responsible for charging a customer’s credit card.

Successful sale transactions will contain a 'refNumber' in the generated response. The 'refNumber' can be used to call upon this transaction in future operations such as reauthorizations or queries.

Several variations of a sale's operation type are available to be used (Level 2 and recurring). Each variation offers different features. Refer to their definitions below to determine which are most suitable for the desired integration.

Function URL  

https://secure.1stpaygateway.net/secure/RestGW/Gateway/Transaction/Sale
        

Example Data  

{
    "merchantKey":"00000000-0000-0000-0000-000000000000",
    "processorId":"1000",
    "cardNumber": "4111111111111111",
    "cardExpMonth":"04",
    "cardExpYear":"16",
    "transactionAmount":"1.00",
    "level3Items":[{"Number":"ITM1", "Quantity":"100", "Price":"1.00", "Description":"Item 1", "UnitOfMeasure":"CGM", "ItemDiscountAmount":"0.01", "ItemDiscountRate":"0.01"}, {"Number":"ITM2", "Quantity":"200", "Price":"2.00", "Description":"Item 2", "UnitOfMeasure":"DZN", "ItemDiscountAmount":"0.02", "ItemDiscountRate":"0.02"}, {"Number":"ITM3", "Quantity":"300", "Price":"3.00", "Description":"Item 3", "UnitOfMeasure":"GRP", "ItemDiscountAmount":"0.03", "ItemDiscountRate":"0.03"}, {"Number":"ITM4", "Quantity":"400", "Price":"4.00", "Description":"Item 4", "UnitOfMeasure":"NMB", "ItemDiscountAmount":"0.04", "ItemDiscountRate":"0.04"}, {"Number":"ITM5", "Quantity":"500", "Price":"5.00", "Description":"Item 5", "UnitOfMeasure":"WSD", "ItemDiscountAmount":"0.05", "ItemDiscountRate":"0.05"}]
}

Attributes  

Sale  
Property Description
autoGenerateOrderId
  • If Order ID is not entered/supplied by code, generate a unique order ID

    Note: Set to false where code/user input is required to set this value

  • Required: False
  • Size: N/A
  • Data Type: Boolean
  • Default Value: True
orderIdIsUnique
  • Should the order ID be unique for this merchant's account
  • Required: False
  • Size: N/A
  • Data Type: Boolean
  • Default Value: True
orderId
  • The alphanumeric value that identifies the transaction
  • Required: True
  • Size: 50
  • Data Type: Text
  • Default Value: Auto generated if not entered
ipAddress
  • IP address of the customer contacting the merchant’s site or application.
  • Required: True
  • Size: 16
  • Data Type: Text
  • Default Value: Detected by Rest Gateway if not supplied
closeDate
  • The date that the transaction should post/settle. Transactions will run at noon EST of the specified date.
  • Required: False
  • Size: 10
  • Format: 09/09/9999 (MM/DD/YYYY)
  • Data Type: Text
cardNumber
  • Credit card number. Rest Gateway shall determine Bank based on card number entered
  • Require: True
  • Required:

    • Retail: True
    • Moto: True
    • Ecommerce: True
    • Swiped: N/A
  • Size: 20
  • Format: Whole Number
  • Data Type: Text
cardExpMonth
  • The month the credit card expires
  • Required:

    • Retail: True
    • Moto: True
    • Ecommerce: True
    • Swiped: N/A
  • Size: 2
  • Format: Whole Number
  • Data Type: Text
cardExpYear
  • Year the credit card expires
  • Required:

    • Retail: True
    • Moto: True
    • Ecommerce: True
    • Swiped: N/A
  • Size: 2
  • Format: Whole Number
  • Data Type: Text
cVV
  • 3 or 4 digit security code on the front or back of the credit card.
  • Require: True
  • Size: 4
  • Format: Whole Number
  • Data Type: Text
creditCardCryptogram
  • Credit Card representation used in place of cardNumber,cardExpMonth,cardExpYear,cVV. This is created from the cryptogram.js form. For more information please see our Hosted Payment Form documentation.
  • Required: False
  • Size: N/A
  • Data Type: Text
creditCardToken
  • Credit Card representation used in place of cardNumber(cardExpMonth, cardExpYear, and cVV will still need to be supplied). This is returned from a completed credit card transaction. For more information please contact your Solutions Delivery Consultant.
  • Required: False
  • Size: N/A
  • Data Type: Text
ownerCity
  • Cardholder's city
  • Required:

    • Retail: False
    • Moto: False
    • Ecommerce: True
    • Ach: False
    • Swiped: False
  • Size: 100
  • Data Type: Text
ownerCountry
  • Cardholder's country
  • Required:

    • Retail: False
    • Moto: False
    • Ecommerce: True
    • Ach: False
    • Swiped: False
  • Size: 200
  • Data Type: Text
ownerEmail
  • Cardholder's email address
  • Require: False
  • Size: 300
  • Data Type: Text
ownerName
  • Customer name printed on credit card
  • Required:

    • Retail: False
    • Moto: False
    • Ecommerce: True
    • Ach: False
    • Swiped: False
  • Size: 750
  • Data Type: Text
ownerPhone
  • Cardholder's phone number
  • Require: False
  • Size: 25
  • Data Type: Text
ownerState
  • Cardholder's state or province
  • Required:

    • Retail: False
    • Moto: False
    • Ecommerce: True
    • Ach: False
    • Swiped: False
  • Size: 100
  • Data Type: Text
ownerStreet
  • Cardholder's street address
  • Required:

    • Retail: False
    • Moto: False
    • Ecommerce: True
    • Ach: False
    • Swiped: False
  • Size: 250
  • Data Type: Text
ownerStreet2
  • Cardholder's secondary address
  • Required:

    • Retail: False
    • Moto: False
    • Ecommerce: False
    • Ach: False
    • Swiped: False
  • Size: 250
  • Data Type: Text
ownerZip
  • Cardholder's ZIP code
  • Required:

    • Retail: False
    • Moto: False
    • Ecommerce: True
    • Ach: False
    • Swiped: False
  • Size: 10
  • Data Type: Text
preventPartial
  • Indicates if a partial approval is allowed for this transaction. If this is set to 'true' then a partially approved transaction will be rejected.
  • Required: False
  • Size: N/A
  • Data Type: Boolean
  • Default Value: True
transactionAmount
  • The amount the customer is charged

    Note: Must be greater than 0.00

  • Required: True
  • Size: N/A
  • Format: Money (0000009.00)
  • Data Type: Text
traceModeEnabled
  • A log record of how the requested action was performed
  • Required: False
  • Size: N/A
  • Data Type: Boolean
Card Present  
Property Description
magData
  • Encrypted card data. Any track is allowed but it is recommended the highest track is used.
  • Required: True
  • Size: N/A
  • Data Type: Text
ksn
  • Serial number for the card reader being used.
  • Required: True
  • Size: N/A
  • Data Type: Text
encryptionBlockType
  • Slot number of the encryption key. It is recommended that you do pass the slot number for the decryption, but if you do not the primary production slot will be used.
  • Required: False
  • Size: N/A
  • Data Type: Text
Level 2  
Property Description
customerRefNo
  • Merchant's B2B reference number
  • Required:

    • Purchase Card set to True: Required
    • Purchase Card set to False: NOT Required
  • Size: 75
  • Data Type: string
localTaxFlag
  • Apply local tax
  • Required:

    • Purchase Card set to True: Required
    • Purchase Card set to False: NOT Required
  • Size: N/A
  • Data Type: Boolean
  • Default: false
purchaseCard
  • Is B2B account
  • Required: False
  • Size: N/A
  • Data Type: Boolean
  • Default Value: False
shippingZip
  • Shipping Zip Code
  • Required:

    • Purchase Card set to True: Required
    • Purchase Card set to False: NOT Required
  • Size: 9
  • Data Type: string
  • Default: ownerZip
taxAmount
  • Local sales tax
  • Required:

    • Purchase Card set to True: Required
    • Purchase Card set to False: NOT Required
  • Size: N/A
  • Format: Money (0000009.00)
  • Data Type: Text
Level 3  
Property Description
level3Items
  • List of line items for this transaction.
  • Required: False
  • Size: N/A
  • Data Type: List of Level3Item data
  • Level 3 Item data contains each of the following fields (all required):

    • Description: A text description of the item
    • Number: A unique identifier for the item (SKU Code, etc.)
    • Quantity: Non-negative quantity of the item purchased
    • Price: Non-negative amount in US dollars
    • UnitOfMeasure: string value to indicate how quantity of this item is measured
    • ItemDiscountAmount: Non-negative discount amount applied to this item
    • ItemDiscountRate: Non-negative discount rate applied per each item
Recurring  
Property Description
recurring
  • Is this transaction recurring
  • Required: False
  • Size: 1
  • Options available:

    • none
    • daily
    • weekly
    • biweekly
    • triweekly
    • monthly
    • bimonthly
    • quarterly
    • semiannually
    • annually
  • Data Type: Text
  • Default Value: none
recurringStartDate
  • The date on which recurring billing should start.
  • Required: False
  • Required: True
  • Size: N/A
  • Format: Date (MM/DD/YYYY)
  • Data Type: Text
  • Default Value: 01/01/1900
recurringEndDate
  • The date on which recurring billing should stop.

    NOTE: Recurring billing turns off at midnight of this date.

  • Required: False
  • Required: True
  • Size: N/A
  • Format: Date (MM/DD/YYYY)
  • Data Type: Text
  • Default Value: 01/01/2099
Merchant Information  
Property Description
merchantKey
  • 32 character token unique to the merchant's account
  • Required: True
  • Size: N/A
  • Data Type: Text
  • Default Value: Assigned by Rest Gateway
processorId
  • Unique number to identify the merchant's processing account
  • Required: True

  • Size: 9
  • Format: Whole Number
  • Data Type: Text
  • Default: Assigned by Rest Gateway

Return  

Success Sale  
{
  "isPartial":false,
  "partialOrder":null,
  "orderId":"635483057246267858",
  "authCode":"530139",
  "referenceNumber":"367045"
}
Success Partial Sale  
{
   "isPartial":true,
   "partialOrder":{
      "partialId":"635482913467839865",
      "amountRemaining":20,
      "originalFullAmount":50,
      "amountApproved":30
   },
   "orderId":"635483057448638093",
   "authCode":"440099"
}
{"authResponse"=>"Approved 668013", 
"authCode"=>"668013", 
"referenceNumber"=>"576570", 
"isPartial"=>false, 
"partialId"=>"",
"originalFullAmount"=>0.0, 
"partialAmountApproved"=>0.0, 
"avsResponse"=>"P", 
"cvv2Response"=>" ", 
"orderId"=>"635742957909628443", 
"cardDeclinedMessage"=>nil, 
"cardDeclinedNo"=>0}
        
Array
(
    [authResponse] => Approved 873310
    [authCode] => 873310
    [referenceNumber] => 409043
    [isPartial] => 
    [partialId] => 
    [originalFullAmount] => 0
    [partialAmountApproved] => 0
    [avsResponse] => D
    [cvv2Response] =>  
    [orderId] => 635678206749976610
    [cardDeclinedMessage] => 
    [cardDeclinedNo] => 0
)
        
{'authResponse': 'Approved 476077', 
'referenceNumber': '409331', 
'partialId': '', 
'orderId': '635679016864599701', 
'originalFullAmount': 0.0, 
'cvv2Response': ' ', 
'avsResponse': 'Y', 
'cardDeclinedNo': 0, 
'partialAmountApproved': 0.0, 
'isPartial': False, 
'cardDeclinedMessage': None, 
'authCode': '476077'}
        
iOS Coming Soon
Android Coming Soon
{
authResponse = “APPROVED”,
authCode = “DSC838”,
referenceNumber = “21306277”,
isPartial = “false”, 
partialId = “”,
originalFullAmount = “0”,
partialAmountApproved = “0”,
avsResponse = “D”,
cvv2Response = “P”,  
orderId = “635690388518267736”,
cardDeclinedMessage = “”, 
cardDeclinedNo = “0”
}