Statflo Documentation
Customers
Customers
A
Customer
has authenticated users that use TextKit to send or receive messages, or execute on TextKit campaigns. They receive their own Twilio sub-account, generated by TextKit.
registerCustomer
Creating a new Customer requires a Partner
ID. A partner is someone who provides the TextKit service to one or more Customers. We've included returning errors in this example, but this is optional.
mutation { registerCustomer(input: { space: "acme", partnerId: "25521a6f-b8d1-414b-8575-545430f076fd", industryId: "e4c81004-1a4c-477f-97e3-b67022e9a351", label: "ACME Co." }) { userErrors { field message } }}
Which responds, when complete:
{ "data": { "registerCustomer": true }}
activateCustomer
A registered Customer
must be activated to enable access to TextKit APIs and SDKs.
To activate a customer, use these queries. You can run them separately or join them together like this example.
After a
Customer
is activated, you can use theupdateCustomerContactInfo
query on its own to change the address information.
mutation { activateCustomer(input: { id: "e4c81004-1a4c-477f-97e3-b67022e9a351" expectedVersion: :any }), updateCustomerContactInfo(input: { id: "e4c81004-1a4c-477f-97e3-b67022e9a351" businessName: "ACME Corporation Inc." secondaryName: "ACME Co." phoneNumber: "+14165551212" addressLine1: "1 Yonge St" addressLine2: "Suite 1204" postalCode: "M5E 1E5" province: "ON" country: "CA" }) }
Which responds, when complete:
{ "data": { "activateCustomer": true, "updateCustomerContactInfo": true }}
updateCustomer
To update contact information for a Customer, use the query below.
mutation { updateCustomerContactInfo(input: { id: "e4c81004-1a4c-477f-97e3-b67022e9a351" businessName: "ACME Corporation Inc." secondaryName: "ACME Corp." phoneNumber: "+14165551212" addressLine1: "1 Yonge St" addressLine2: "Suite 1204" postalCode: "M5E 1E5" province: "ON" country: "CA" }) }
Which responds, when complete:
{ "data": { "updateCustomerContactInfo": true }}
deactivateCustomer
To deactivate a Customer
, use this query:
mutation { deactivateCustomer(input: { id: "e4c81004-1a4c-477f-97e3-b67022e9a351" expectedVersion: :any }) }
Which responds, when complete:
{ "data": { "deactivateCustomer": true }}
terminateCustomer
When you terminate a Customer
, this is a process that cannot be reversed. You'll need to provide the data retention strategy to using these two variables:
strategy
is set to either NO_RETENTION
, TEMPORARY
or INDEFINITE
.
period
is an integer, and is the number of months to hold onto the encryption key.
After the retention period, the encryption key for the given Customer
is permanently deleted, making any data stored permanently unreadable.
Use this query:
mutation { terminateCustomer(input: { id: "e4c81004-1a4c-477f-97e3-b67022e9a351" retention: { strategy: NO_RETENTION, period: 12 expectedVersion: :any }) { response }}
Which responds, when complete:
{ "data": { "terminateCustomer": true }}