Events
- 11 Sep 2024
- 4 Minutes to read
- Print
- PDF
Events
- Updated on 11 Sep 2024
- 4 Minutes to read
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Introduction
The payload of an event will consist of two parts:
- General fields, common to all events
- Event specific fields, nested within the data field
General payload fields
Field | Type | Description |
---|---|---|
time | Integer | Epoch timestamp in milliseconds of the event. |
type | String | Type of the event. Possible values are listed below. |
source | String | Source of the event. Is equal to the Connect client schema name. |
status | String | Status of the resource associated to the event. |
data | Object | Data for the resource associated to the event. |
Event types
- subscription
- product
- order
- coupon
- customer
Subscription
This event is generated by Connect when there is an update on a subscription.
General fields
Field | Description |
---|---|
type | The field will contain the value 'subscription'. |
status | The status of the subscription. Possible values: 'start': The subscription is started. 'stop': The subscription is stopped. 'renew': The subscription is renewed. 'stop_reset': The subscription was stopped and starts agian. 'deliveryplan_changed:' Deliveryplan has been changed on subscription. |
Event specific fields
Field | Type | Description | Nullable |
---|---|---|---|
customerNumber | Integer | Connect customer number related to the event. | No |
productCode | String | Product code of the subscription that has started. | No |
periodEnd | Integer | Epoch timestamp in milliseconds for end of current subscription period. | Yes |
Example payload
{
"time": 1610665200000,
"type": "subscription",
"status": "start",
"data": {
"customerNumber": 12345,
"productCode": "PROD1",
"periodEnd": 1610665200000
}
}
Product
This event is generated when a product is new, updated or deleted.
General fields
Field | Description |
---|---|
type | The field will contain the value 'product'. |
status | The status of the product. Possible values: 'new': The product is active. 'update': The product is updated. 'delete': The product is deleted. |
Event specific fields
Field | Type | Description | Nullable |
---|---|---|---|
productCode | String | Product code | No |
companyCode | String | Company code | Yes |
Example payload
{
"time": 1610665200000,
"type": "product",
"status": "new",
"data": {
"productCode": "KUP",
"companyCode": "468979834"
}
}
Coupon
This event is generated when a coupon is created, updated or deleted.
General fields
Field | Description |
---|---|
type | The field will contain the value 'coupon'. |
status | The status of the coupon. Possible values: 'new': The coupon is new. 'update': The coupon is updated. 'delete': The coupon is deleted. |
Event specific fields
Field | Type | Description | Nullable |
---|---|---|---|
couponCode | String | Coupon code | No |
couponNumber | Integer | Coupon number | No |
Example payload
{
"time": 1610665200000,
"type": "coupon",
"status": "new",
"data": {
"couponCode": "KUP",
"couponNumber": 99
}
}
Order
This event is generated when order process is initiated or processed.
General fields
Field | Description |
---|---|
type | The field will contain the value 'order'. |
status | The status of the order. Possible values: 'verified': The verification process of an order is initiated. 'processed': The verification process of an order is processed. |
Event specific fields
Field | Type | Description | Nullable |
---|---|---|---|
receivers | Integer array | List of Connect customer numbers that are receivers in the order. This will be empty if payer is the same as the receiver. | Yes |
payer | Integer | Connect customer number of the payer of the order. | Yes |
connectOrderNumber | Integer | Connect order number. | No |
connectIDOrderNumber | Integer | ConnectID order number. | Yes |
status | String | Status code for the order. See description here. | Yes |
Example payload
{
"time": 1610665200000,
"type": "order",
"status": "verified",
"data": {
"receivers": [
23456,
34567
],
"payer": 12345,
"connectOrderNumber": 54321,
"connectIDOrderNumber": 24680,
"status": "B"
}
}
Customer
The event will be generated and sent to EventBrigde if customer data has been changed. This means the event will be trigged by a change of name, address, email address, or phone numbers.
General fields
Field | Description |
---|---|
type | The field will contain the value 'customer'. |
status | The status of the customer data. Possible values: 'data_changed': Customer data is updated. 'new': New customer is created. |
Event specific fields
Field | Type | Description | Nullable |
---|---|---|---|
customerNumber | Integer | Customer number. | No |
name | object | Object containing name information. | No |
firstName | String | Customer first name. | Yes |
middleName | String | Customer middle name. | Yes |
lastName | String | Customer last name. | Yes |
companyName | String | Name of the company. | Yes |
departmentName | String | department name. | Yes |
phoneNumbers | object array | Object containing phone numbers. | No |
phoneNumber | String | The phone number, following the E.164 standard. | Yes |
phoneNumberType | String | Phone number type: Company, Personal, Fax | Yes |
emails | String array | Email addresses. | No |
address | String | Object containing address information. | No |
addressType | String | Address type - possible values: 'currentAddress' 'historicalAddress' 'futureAddress' | No |
streetAddress | String | The street name for this address. | Yes |
streetNumber | String | The street number for this address. | Yes |
entrance | String | The entrance for this address. | Yes |
floor | String | The floor for this address. | Yes |
postalCode | String | The postal code for this address. | Yes |
postalPlace | String | The postal place for this address. | Yes |
postalAddress | String | The postal address for this address. | Yes |
countryCode | String | The country code for this address - ISO 3166 - alpha-2. | Yes |
Example payload
{
"time": 1610665200000,
"type": "customer",
"status": "updated",
"data": {
"customerNumber": 3,
"name": {
"firstName": "Kari",
"middleName": "Fjordstrand",
"lastName": "Nordmann",
"companyName": "Mediaconnect",
"departmentName": "Support"
},
"phoneNumbers": [
{
"phoneNumber": "+4711122333",
"phoneNumberType": "personal"
},
{
"phoneNumber": "+4711133444",
"phoneNumberType": "company"
}
],
"emails": [
"email1@mediaconnnect.no",
"email2@mediaconnect.no"
],
"address": {
"addressType": "currentAddress",
"streetAddress": "Storgt.",
"streetNumber": 56,
"entrance": "A",
"floor": 2,
"postalCode": "2016",
"postalPlace": "Oslo",
"postalAddress": "Pb 265 Økern",
"countryCode": "NO"
}
}
}
Order status codes
The following status codes are used on Connect orders.
Code | Description |
---|---|
A | Preliminary order (not yet confirmed by the merchant service provider). |
B | Confirmed order, initial status for most orders. |
C | Order updated in client schema. |
D | An error occurred on this order. |
G | Duplicate order. |
H | Wrong coupon code or number. |
I | Error creating a name and/or address. |
J | Error creating recurring product. |
K | This order should not be processed. |
L | This order needs to be processed manually. |
M | This order has been processed manually. |
N | Error due to active gift subscription. |
O | Error due to active gift subscription, email sent. |
P | Error when handling prepaid/single credit card. |