Object merging is done automatically by the Centinel API. This feature will always occur with all requests and cannot be disabled or behavior changed. |
Below are examples of how the merging can affect your objects in different ways.
Remember that all merging types are active at once. The examples are broken out to help explain the different ways things are merged. |
Additive merging will take unique fields from each object to create a fuller more complete object
{ "OrderDetails":{ "Amount":1500, "CurrencyCode": "840" } } |
{ "OrderDetails":{ "OrderDescription":"My new order" } } |
{ "OrderDetails":{ "Amount":1500, "CurrencyCode": "840", "OrderDescription":"My new order" } } |
Update merging will overwrite stale fields from the JWT order object with the more recent browser object
{ "OrderDetails":{ "Amount":1500 } } |
{ "OrderDetails":{ "Amount":2500 } } |
{ "OrderDetails":{ "Amount":2500 } } |
You may not have all the data when you create the JWT, so most likely your JWT order object will be a bit more sparse than the browser object.
{ "OrderDetails":{ "Amount":2500, "CurrencyCode": "840", "OrderNumber":"sa4lj2kds34SAIu97sde12d3" }, "Cart":[ { "Name":"Blue Jeans", "Quantity":1 } ], "Consumer":{ "ShippingAddress":{ "FirstName": "John", "LastName":"Smith", "Address1":"8100 Tyler Blvd.", "City": "Mentor", "State":"Ohio", "PostalCode":"44060" } } } |
{ "Consumer":{ "Account":{ "AccountNumber": 4000...0002, "ExpirationMonth": 01, "ExpirationYear": 2020, "NameOnCard":"John Smith" }, "BillingAddress":{ "FirstName": "John", "LastName":"Smith", "Address1":"8100 Tyler Blvd.", "City": "Mentor", "State":"Ohio", "PostalCode":"44060" }, "ShippingAddress":{ "FirstName": "John", "LastName":"Smith", "Address1":"123 Main Street", "City": "Cleveland", "State":"Ohio", "PostalCode":"44091" } } } |
{ "OrderDetails":{ "Amount":2500, "CurrencyCode": "840", "OrderNumber":"sa4lj2kds34SAIu97sde12d3" }, "Cart":[ { "Name":"Blue Jeans", "Quantity":1 } ], "Consumer":{ "Account":{ "AccountNumber": 4000...0002, "ExpirationMonth": 01, "ExpirationYear": 2020, "NameOnCard":"John Smith" }, "BillingAddress":{ "FirstName": "John", "LastName":"Smith", "Address1":"8100 Tyler Blvd.", "City": "Mentor", "State":"Ohio", "PostalCode":"44060" }, "ShippingAddress":{ "FirstName": "John", "LastName":"Smith", "Address1":"123 Main Street", "City": "Cleveland", "State":"Ohio", "PostalCode":"44091" } } } |