flexEngage ecommerce Platform Integration API.

Integration guide

This guide serves to accompany our API Specification. It walks you through common ecommerce flows and how they should be implemented using our API.

The process explanations in this guide assumes your account is using the following features:

NOTE:

Use cases

Every order starts with an order confirmation, that is when your customer places the order, and your Order Management System (OMS) accepts the order. This creates an event that can be sent to our system.

POST ‘https://api.flexengage.com/v1/brand-01/order-events’

{
	"requestId": "1654654646",
	"order": {
		"id": "202009171"
	},
	"eventType": "ORDER_CONFIRMED",
	"retailerEventType": "OrderCreated",
	"data": {
		"order": {
			"id": "202009171"
		},
		"customer": {
			"name": {
				"honorific": null,
				"lastName": "Doe",
				"middleName": null,
				"firstName": "John"
			},
			"emailAddress": "john.doe@flexengage.com",
			"loyaltyProgram": {
				"account": "loyalty-gold-252451114",
				"program": "Loyalty Gold",
				"customAttributes": {
					"attribute": [{
						"key": "OrderTotalPointsEarned",
						"value": "0"
					}]
				},
				"id": "loyalty-gold"
			},
			"customerId": "252451114"
		},
		"billingAddress": {
			"line1": "123 any st.",
			"line2": "Apt. 1808",
			"city": "Orlando",
			"state": "Florida",
			"zipcode": "33137"
		}
	},
	"notificationChannels": [{
		"channelType": "EMAIL",
		"isDigital": true,
		"emailAddress": "john.doe@flexengage.com"
	}],
	"items": [{
			"id": "item-124-funny-hats",
			"name": "Funny Hats",
			"customAttributes": {
				"team": "Dallas Cowboys"
			}
		},
		{
			"id": "item-123-funny-shoes",
			"name": "Funny Shoes",
			"description": "These are some really funny shoes"
		},
		{
			"id": "item-125-funny-pants",
			"name": "Funny Pants",
			"description": "These are some really funny pants"
		}
	]
}

Given the request above, and the default brand configuration, two things will happen:

Say that we then receive an ORDER_SHIPPED event like this:

POST ‘https://api.flexengage.com/v1/brand-01/order-events’

{
	"requestId": "1654658758",
	"order": {
		"id": "202009171"
	},
	"eventType": "ORDER_SHIPPED",
	"retailerEventType": "Fulfillment",
	"data": {
		"order": {
			"id": "202009171"
		},
		"customer": {
			"name": {
				"honorific": null,
				"lastName": "Doe",
				"middleName": null,
				"firstName": "John",
				"any": []
			},
			"emailAddress": "john.doe@flexengage.com",
			"loyaltyProgram": {
				"account": "loyalty-gold-252451114",
				"program": "Loyalty Gold",
				"customAttributes": {
					"attribute": [{
						"key": "OrderTotalPointsEarned",
						"value": "0"
					}]
				},
				"id": "loyalty-gold"
			},
			"customerId": "252451114"
		},
		"billingAddress": {
			"line1": "123 any st.",
			"line2": "Apt. 1808",
			"city": "Orlando",
			"state": "Florida",
			"zipcode": "33137"
		}
	},
	"notificationChannels": [{
		"channelType": "EMAIL",
		"emailAddress": "john.doe@flexengage.com"
	}],
	"shipments": [{
		"shipmentId": "EZ1000000001",
		"carrier": "USPS",
		"trackingNumber": "EZ1000000001",
		"items": [{
			"id": "item-124-funny-hats",
			"name": "Funny Hats",
			"customAttributes": {
				"team": "Dallas Cowboys"
			}
		}]
	}]
}

With this event few things will happen:

Say that we then receive another ORDER_SHIPPED event like this:

POST ‘https://api.flexengage.com/v1/brand-01/order-events’

{
	"requestId": "16543458725",
	"order": {
		"id": "202009171"
	},
	"eventType": "ORDER_SHIPPED",
	"retailerEventType": "Fulfillment",
	"data": {
		"order": {
			"id": "202009171"
		},
		"customer": {
			"name": {
				"honorific": null,
				"lastName": "Doe",
				"middleName": null,
				"firstName": "John",
				"any": []
			},
			"emailAddress": "john.doe@flexengage.com",
			"loyaltyProgram": {
				"account": "loyalty-gold-252451114",
				"program": "Loyalty Gold",
				"customAttributes": {
					"attribute": [{
						"key": "OrderTotalPointsEarned",
						"value": "0"
					}]
				},
				"id": "loyalty-gold"
			},
			"customerId": "252451114"
		},
		"billingAddress": {
			"line1": "123 any st.",
			"line2": "Apt. 1808",
			"city": "Orlando",
			"state": "Florida",
			"zipcode": "33137"
		}
	},
	"notificationChannels": [{
		"channelType": "EMAIL",
		"emailAddress": "john.doe@flexengage.com"
	}],
	"shipments": [{
		"shipmentId": "EZ2000000002",
		"carrier": "FEDEX",
		"trackingNumber": "EZ2000000002",
		"items": [{
			"id": "item-123-funny-shoes",
			"name": "Funny Shoes",
			"description": "These are some really funny shoes"
		}]
	}]
}

With this event few things will happen:

So far we have an order that has been confirmed and 2 different shipments, one for each item. we still have one item that has not been fulfilled. So we might get an event like the following:

POST ‘https://api.flexengage.com/v1/brand-01/order-events’

{
	"requestId": "16546546430",
	"order": {
		"id": "202009171"
	},
	"eventType": "ORDER_CANCELLED",
	"retailerEventType": "OrderCancellation",
	"data": {
		"order": {
			"id": "202009171"
		},
		"customer": {
			"name": {
				"honorific": null,
				"lastName": "Doe",
				"middleName": null,
				"firstName": "John"
			},
			"emailAddress": "john.doe@flexengage.com",
			"loyaltyProgram": {
				"account": "loyalty-gold-252451114",
				"program": "Loyalty Gold",
				"customAttributes": {
					"attribute": [{
						"key": "OrderTotalPointsEarned",
						"value": "0"
					}]
				},
				"id": "loyalty-gold"
			},
			"customerId": "252451114"
		},
		"billingAddress": {
			"line1": "123 any st.",
			"line2": "Apt. 1808",
			"city": "Orlando",
			"state": "Florida",
			"zipcode": "33137"
		}
	},
	"notificationChannels": [{
		"channelType": "EMAIL",
		"isDigital": true,
		"emailAddress": "john.doe@flexengage.com"
	}],
	"items": [{
		"id": "item-125-funny-pants",
		"name": "Funny Pants",
		"description": "These are some really funny pants"
	}]
}

With this event few things will happen:

We have seen a typical order’s journey through a set of events, and the different things that would happen based on these events.