Shopping

Checkout

verify/payment.json

method: GET

secured: true

url: /v1/shopping/checkout/verify/payment.json

If the cart has enough information to calculate a balance then you will see a response like this:

{
    "CartId": 0,
    "ClearedCards": null,
    "PaymentMethod": null,
    "Balance": {
        "due": {
            "value": 52.85,
            "key": "TotalDue",
            "label": "Total Due",
            "formattedValue": "$52.85"
        },
        "extra": [
            {
                "value": 1.23,
                "key": "TotalFreight",
                "label": "Freight Amount",
                "formattedValue": "$1.23"
            },
            {
                "value": 6,
                "key": "TotalHandling",
                "label": "Handling Charge",
                "formattedValue": "$6.00"
            },
            {
                "value": 4.62,
                "key": "TotalTax",
                "label": "Tax Amount",
                "formattedValue": "$4.62"
            }
        ]
    },
    "Details": {
        "Retail": {
            "value": 56.6,
            "key": "TotalRetail",
            "label": "Total Retail",
            "formattedValue": "$56.60"
        },
        "Cost": {
            "value": 41,
            "key": "TotalCost",
            "label": "Cost",
            "formattedValue": "$41.00"
        },
        "PV": {
            "value": 36,
            "key": "TotalPV",
            "label": "Total PV",
            "formattedValue": "36"
        },
        "BV": {
            "value": 41,
            "key": "TotalBV",
            "label": "Total BV",
            "formattedValue": "41.00"
        },
        "items": {
            "value": 1,
            "key": "TotalItems",
            "label": "Total Items",
            "formattedValue": "1"
        }
    },
    "RequireSignature": {
        "field": "RequireSignature",
        "label": "Require Adult Signature for Delivery",
        "selected": false
    },
    "ShippingMethod": {
        "value": 11130,
        "label": "Delivered"
    },
    "ShippingMethods": [
        {
            "value": 11130,
            "label": "Delivered"
        },
        {
            "value": 11131,
            "label": "Delivered-Next Day"
        }
    ],
    "success": true,
    "error": []
}

The following values are significant

Property Notes
Balance.due This is the amount you must pass to sucessfully pay for the transaction. In the US market we support spreading a total cart over multiple credit cards (as logn as the sum of thouse changes exactly equals this value). This "multicard" behavior is not supported in our app and will over time be removed.
Balance.extra This is an array of values that contribute to the Balance.due like Taxes, Freight and Handeling. Each market has unique rules of which of these extra charges to show (and in what amount). To keep this logic out of the app this is provided as an array with correct labels. The order of this array is also the intended display order. The sum of Details.cost.value and all of the Balance.extra.value properties will always equal the Balance.due.value.
Details.cost This is amount of the Balance.due that the products are contirbuting to.

method: POST

secured: true

url: /v1/shopping/checkout/verify/payment.json

Field Notes
Cards A JSON Array with the following structure
[
    {
        "Id": "1",
        "CardHolderName": "Jason Sperske", //Optional in some markets
        "CardType": "VISA",
        "CardNumber": "4111-1111-1111-1111",
        "ExpMonth": "1",
        "ExpYear": "2015",
        "PostalCode": "", //Optional in some markets
        "CVV": "",        //Optional in some markets
        "Amount": "52.85"
    }
]
Property Notes
Id A number that represents the row in the UI that the card was entered (for multiple credit cards)
Type: Int
CardType A ENUM represeting the various supported credit cards
Type: String (VISA|MASTERCARD|DISCOVER)
CardNumber The full credit card number (non neumeric values are stripped so it will accept spaces or hyphens)
Type: String
ExpMonth The expiration month of the credit card.
Type: Integer
ExpYear The full 4 digit expiration year of the credit card.
Type: Integer
PostalCode The postal code of the owner of the credit card.
Type: String
Amount The amount to be charged to the credit card (for markets that support multiple card you can split the total charge over several cards, otherwise this ammount must match the total due of the cart).
Type: Decimal

Type: JSON Array
Alternatively you can pass a single credit card
CardType A ENUM represeting the various supported credit cards
Type: String (VISA|MASTERCARD|DISCOVER)
CardNumber The full credit card number (non neumeric values are stripped so it will accept spaces or hyphens)
Type: String
ExpMonth The expiration month of the credit card.
Type: Integer
ExpYear The full 4 digit expiration year of the credit card.
Type: Integer
PostalCode The postal code of the owner of the credit card.
Type: String
Amount The amount to be charged to the credit card (Distributors and Promtoers have the option of charging up to the retail cost on a credit card, common if they are buying for someone else).
Type: Decimal (Optional, it will assume the amount due if ommited)

If you pass any invalid data you will see a response like this:

{
    "CartId": 0,
    "ClearedCards": null,
    "PaymentMethod": null,
    "Balance": null,
    "success": false,
    "error": [
        {
            "field": "CreditCard_1",
            "error": "ErrorCreditCard",
            "message": "Credit Card Number is not valid"
        }
    ]
}

If you pass valid data you will see a response like this:

{
    "CartId": 101259,
    "ClearedCards": null,
    "PaymentMethod": null,
    "Balance": null,
    "success": true,
    "error": []
}