Checkout

Introduction

The checkout process is the last step in the carting workflow and is what tells the system to process the shopping cart, validate the contents of that cart and turn it into an order.

How It Works

As long as the cart is active and isn’t currently locked or processing, the cart will attempt to be validated and processed.

  • Validation:
    • The end user of the cart actually exists
      • If not, the user will be created for the subscriber
    • The cart items have recipients assignedsd
      • Cart items must be purchased for someone
    • Validation of the items
      • Ensure the items' required values and edited fields are populated correctly
      • Ensure the item in the cart is the item that was added to the earlier
      • Ensure the gift cards aren't being paid for with exchange cards
    • Validation of the payments
      • Ensure the payments applied to the cart can actually be used at the subscriber
        • Ex.: Does the subscriber accept credit cards?
        • Ex.: Does the subscriber accept American Express?
    • Validate that the payments and pricing add up
      • Check that an exchange card isn't purchasing a gift card
      • Ensure the amount being paid adds up to the cart total amount
  • Processing
    • Once validation succeeds, the cart will be locked so that it cannot be modified during processing
    • If validation fails at any time during the checkout process, the cart will be rolled back to an active state, any processed payments will be voided, and any created items will be removed.
    • The cart totals will be calculated
      • Items will be priced correctly with taxes and discounts
      • Payments will be balanced across the items in the cart if necessary
      • The total amounts for payments, taxes, items, prices, and discounts will be calculated
    • The cart will be converted into an order, products will be created (gift cards, etc.), and any notifications (purchase receipts, gift card deliveries, etc.) will be sent.
    • Once processing has finished (either successfully or not), the cart status will be updated and can be checked via the Get Carts call.
    • See Cart States for more information on the checkout responses

How To Use Checkout

Using the cart checkout process is fairly straightforward, as there is only 2 calls. The first is to tell the system to begin the checkout process, and the next is to check via the Get Carts call to see if the process completed successfully.

  • Checkout
    • Request
      • POST /Sales/{Subscriber Id}/Carts/Checkout
      • Type = POST
      • Header
        • Content Type = Application/json
        • Authorization = Bearer {Authorization Token}
      • Data = NULL
    • Response
  • See Get Carts to check the cart status

Processing Failure

  • If payment processing fails the cart will be set to the OrderProcessingFailed state and its PaymentProcessingFailureReason property will be set.
  • This property's failure type can be the following:
    • Critical: An internal error occured. Detail will be null.
    • Gateway: An electronic payment was unable to be processed. Detail will be the message returned by the gateway.

Miscellaneouss

  • Cart States

    • Creating
      • In process of being created
    • Created
      • Finished creation process
    • Active
      • Actions can be taken against the cart
    • Abandoned
      • No longer being worked on
    • Locked
      • Actively being worked on and cannot be modified by other actions
    • OrderCreated
      • The cart has been transformed into an order and can no longer be modified by other actions
    • OrderProcessingFailed
      • The order created from the cart was unable to be processed
    • Finalized
      • The cart's order has been processed.