Customer Account Webhooks
Webhook structure and samples for Customer Accounts.
Customer Account Webhook - Structure
{
"events":
[
{
"id": {EVENTID},
"created_at": {CREATEDDATE},
"resource_type": {RESOURCETYPE},
"description": {DESCRIPTION},
"event_source": {EVENTSOURCE},
"reference": {REFERENCE},
"Email": {EMAILADDRESS},
"company_name": {COMPANYNAME},
"first_name": {FIRSTNAME},
"last_name": {LASTNAME},
"address_line1": {BILLINGLINE1},
"address_line2": {BILLINGLINE2},
"city": {BILLINGCITY},
"postal_code": {BILLINGPOSTCODE},
"country_code": {BILLINGCOUNTY},
"status": {STATUS},
"title": {TITLE},
"delivery_address_line1": {DELIVERYLINE1},
"delivery_address_line2": {DELIVERYLINE2},
"delivery_city": {DELIVERYCITY},
"delivery_postal_code": {DELIVERYPOSTCODE},
"delivery_country_code": {DELIVERYCOUNTRY},
"custom_reference": {CUSTOMREFERENCE}
}
]
}
Webhooks are sent out of SmarterPay Cloud as a JSON array.
The JSON Syntax Rules are:
- Data is in name/value pairs, for example {“id” : “EV000003432”}.
- Data is separated by commas.
- Curly braces hold objects.
- Square brackets hold arrays.
| Property | Variable | Description | Empty Values (1) | Format | Example |
|---|---|---|---|---|---|
| id | {EVENTID} | The ID of the Webhook Event. | No. | String. | “EV000003432” |
| created_at | {CREATEDDATE} | The Date that event was created. | No. | ISO8601. | “2020-12-22T08:05:00.000Z” |
| resource_type | {RESOURCETYPE} | The Resource type will be customer_account. | No. | String. | “customer_account” |
| description | {DESCRIPTION} | The description of Webhook Event. | No. | String. | “Portal - Customer Account inserted” |
| event_source | {EVENTSOURCE} | The Event code that triggered the sending of the Webhook. | No. | Integer. | “10022091” |
| reference | {REFERENCE} | The ID of the Customer Account. | No. | String. | “CUST00032423” |
| {EMAILADDRESS} | The Email Address of the Customer. | Yes. | String. | “mike.walker@email.com” | |
| company_name | {COMPANYNAME} | The Company name of the Customer. | Yes. | String. | “SmarterPay” |
| first_name | {FIRSTNAME} | The First Name of the Customer. | No. | String. | “Mike” |
| last_name | {LASTNAME} | The Last Name of the Customer. | No. | String. | “Walker” |
| address_line1 | {BILLINGLINE1} | First Line of the Billing Address. | Yes. | String. | “32-36 Prospect Street” |
| address_line2 | {BILLINGLINE2} | Second Line of the Billing Address. | Yes. | String. | “” |
| city | {BILLINGCITY} | The Billing Address City. | Yes. | String | “Hull” |
| postal_code | {BILLINGPOSTCODE} | The Billing Address Post Code. | Yes. | String. | “HU2 8PX” |
| country_code | {BILLINGCOUNTY} | The Billing Address Country Code. | Yes. | ISO Alpha-2. | “GB” |
| status | {STATUS} | The Status of the Customer Account. | No. | String. | “active” |
| title | {TITLE} | Title for the Customer Name. | Yes. | String. | “Mr” |
| delivery_address_line1 | {DELIVERYLINE1} | First Line of the Delivery Address. | Yes. | String. | “32-36 Prospect Street” |
| delivery_address_line2 | {DELIVERYLINE2} | Second Line of the Delivery Address. | Yes. | String. | “” |
| delivery_city | {DELIVERYCITY} | The Delivery Address City. | Yes. | String | “Hull” |
| delivery_postal_code | {DELIVERYPOSTCODE} | The Delivery Address Post Code. | Yes. | String. | “HU2 8PX” |
| delivery_country_code | {DELIVERYCOUNTRY} | The Delivery Address Country Code. | Yes. | ISO Alpha-2 | “GB” |
| custom_reference | {CUSTOMREFERENCE} | The Custom reference. | Yes. | String. | “Payment Run 33” |
Notes:
(1) Empty Values - The property will always be in the Webhook, however the value of the property may be an empty string (“”).
| Property | Possible Values |
|---|---|
| status | active |
| inactive |
Customer Account Webhook - Samples
| Quick Links | |
|---|---|
| Customer Account Webhook - Sample - API Actions | Customer Account Webhook - Sample - Portal Actions |
Customer Account Webhook - Sample - API Actions
Customer Account Webhook - Sample - API Actions - Record Creation
Customer Account Webhook - Structure
{
"events":
[
{
"id":"FTBEV01781287",
"created_at":"2021-07-15T12:48:39.000Z",
"resource_type":"customer_account",
"description":"API - Customer Account inserted",
"event_source" : "20022091",
"reference":"FTBCUST00034750",
"Email":"lhale@email.com",
"company_name":"Halestorm",
"first_name":"Lizzy",
"last_name":"Hale",
"address_line1":"32-36 Prospect Street",
"address_line2":"",
"city":"Hull",
"postal_code":"HU2 8PX",
"country_code":"GB",
"status":"active",
"title":"",
"delivery_address_line1":"",
"delivery_address_line2":"",
"delivery_city":"",
"delivery_postal_code":"",
"delivery_country_code":"GB",
"custom_reference":""
}
]
}
Customer Account Webhook - Sample - Portal Actions
Customer Account Webhook - Sample - Portal Actions - Record Creation
Customer Account Webhook - Structure
{
"events":
[
{
"id":"FTBEV01781287",
"created_at":"2021-07-15T12:48:39.000Z",
"resource_type":"customer_account",
"description":"Portal - Customer Account inserted",
"event_source" : "20022091",
"reference":"FTBCUST00034750",
"Email":"lhale@email.com",
"company_name":"Halestorm",
"first_name":"Lizzy",
"last_name":"Hale",
"address_line1":"32-36 Prospect Street",
"address_line2":"",
"city":"Hull",
"postal_code":"HU2 8PX",
"country_code":"GB",
"status":"active",
"title":"",
"delivery_address_line1":"",
"delivery_address_line2":"",
"delivery_city":"",
"delivery_postal_code":"",
"delivery_country_code":"GB",
"custom_reference":""
}
]
}