public class Sale {
public String messageId;
public String eventId;
public Decimal eventSchemaVersion;
public String eventInstanceOriginationDateTime;
public SaleEventData eventData;

public class SaleEventData {
public Integer siteId;
public Integer saleId;
public String purchasingClientId;
public List<PaymentDetails> payments;
public String saleDateTime;
public String soldById;
public String soldByName;
public Integer locationId;
public Integer totalAmountPaid;
public List<SaleItemDetails> items;

public class PaymentDetails {
public Integer paymentId;
public Integer paymentMethodId;
public String paymentMethodName;
public String paymentAmountPaid;
public Integer paymentLastFour;
public String paymentNotes;

public class SaleItemDetails {
public Integer itemId;
public String type;
public String name;
public Integer amountPaid;
public Integer amountDiscounted;
public Integer quantity;
public String recipientClientId;
public Integer paymentReferenceId;

Sale mbSale = (Sale)JSON.deserialize(jsonInput, Sale.class);
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter