Transactions using stored payment information can be submitted in a single step. See the customer method for how to get a list of payment methods to reference from this API.
| URL | Method |
|---|---|
| api/transaction/add | POST |
Include the following JSON object with the post to describe the transaction.
Not all fields are required. You can omit optional ones per the rules below. Depending on which fields you supply, the transaction will be classified as Level I, II or III, each of which has different fees and rates associated.
For Level II and III transactions, there are special rules to control if new or existing shipping addresses are to be used. See the choices in the table for a synopsis.
| Field | Description | Required For Level | ||
|---|---|---|---|---|
| I | II | III | ||
| { | ||||
| ApiKey: "string", | your api key here | * | * | * |
| MID: "string", | your merchant account number | * | * | * |
| TransactionType: "string" | "sale", "auth", or "credit" | * | * | * |
| Amount: number, | total amount of transaction (including tax & shipping) | * | * | * |
| TaxAmount: number, | * | * | ||
| ShippingAmount: number, | * | * | ||
| CustomerPONumber: "string", | * | * | ||
| CustomerId: number, | Id of an existing customer | * | * | |
| PaymentMethodId: number, | Id of an existing payment method | * | * | |
| Choose one of the following for Shipping Address: | ||||
| 1) If you want to create a new Shipping Address... | ||||
| ShippingId: number, | Set to (indicates a new shipping address is being entered) | * | ||
| SaveNewShippingAddress: bool, | true to save shipping address for future use; false to not save it. | * | ||
| ShippingAddress: { | * | |||
| Tag: "string", | Ship to recipient | |||
| Address1: "string", | ||||
| Address2: "string", | ||||
| City: "string", | ||||
| State: "string", | ||||
| Postal: "string", | Zip Code | |||
| Phone: "string" | ||||
| }, | ||||
| 1) If you want to reference an existing Shipping Address... | ||||
| ShippingId: number, | Set to Id of an existing shipping address | * | ||
| LineItems: [ | Array of 1 or more line items | * | ||
| { | ||||
| ProductCode: "string", | The product code identifying an item from your product catalog | * | ||
| Quantity: number, | * | |||
| Price: number | If not specified, the default price from your product catalog will be used. | |||
| } | ||||
| ] | ||||
| } | ||||
This API returns the following in JSON format if the operation is successful.
| Field | Description |
|---|---|
| { | |
| ID | Transaction ID |
| AuthorizationCode | Authorization code for "sale" and "auth" transaction types (null for "credit" types) |
| CustomerID | ID of the Customer |
| CustomerName | Name of the Customer |
| Account | Name of the customer account |
| TransactionType | Sale, Authorization, Credit |
| TransactionTime | Date and Time |
| Level | 1,2,3 |
| TotalAmount | Total transaction amount including shipping and tax |
| Description | Transaction description |
| TransactionSource | “Virtual Terminal” |
| Status | “Not Settled” |
| CaptureAmount | Amount captured only if the transaction had a previous Auth |
| PaymentMethodID | ID of the payment method stored in the vault |
| CardholderFirstName | |
| CardholderLastName | |
| CardType | Visa, Mastercard, Discover, Amex |
| CardLast4 | Last 4 digits of the customer credit card number |
| CustomerPONumber | Level II/III only. Customer PO Number |
| TaxAmount | Level II/III only. Tax Amount |
| ShippingAmount | Level II/III only. Customer PO Number |
| Billing |
|
| ShippingAddressID | Level II/III only: ID of the shipping address |
| Shipping |
|
| LineItems[] |
|
| Success | true |
| Message | “Transaction Complete” |
| } |