Easymailing
Store customers

Update a store customer

PUT /stores/{storeResourceId}/customers/{resourceId}

PUT/stores/{storeResourceId}/customers/{resourceId}

Changes the data of a customer and re-processes their audience member with the same rules as create_store_customer. If you send a different email, it does not rename the existing member: the new email is subscribed as a member (a new one if nobody has it) and the customer is linked to it; the previous member is left as it was.

When to use: When the buyer changes their details in the shop and the change must reach the audience.

When not to use: To register a new buyer use create_store_customer.

Side effects: The member is processed again like on creation: depending on the audience and on its current status it can receive the confirmation or welcome email (a person who unsubscribed on their own gets a confirmation email, at most once every 15 minutes, every time the shop syncs them; a member with status suscriber.status.unsuscribed.admin is confirmed again at once in a single opt-in audience). A new email creates a new member with its own subscription. The store's group is added to the member and the group webhook and automations fire for it. The query flags disable_double_opt_in, disable_welcome_email and disable_sms_double_opt_in (all true/false) turn the confirmation and welcome messages off. When the plan has no room for more subscribers and the person is not an active subscriber yet, the customer data is saved but nobody is subscribed and the customer keeps the member it already had, if any; the next update with room in the plan subscribes them.

Permissions: Requires the manager role or higher, or the marketing.audiences.write capability.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

storeResourceId*string

Identifier (resource_id) of the store the customer belongs to.

resourceId*string

Identifier (resource_id) of the customer: the one you chose when you created it with create_store_customer.

Request Body

The updated Customer resource

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X PUT "https://api.easymailing.com/stores/acme-shop/customers/customer-1042" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "phone": "string",    "company": "string",    "firstname": "string",    "lastname": "string",    "member_consent": {      "ip": "192.168.0.1",      "consent_at": "2019-08-24T14:15:22Z",      "treatment_purposes": [        "/entity/1"      ]    },    "custom_fields": [      {        "list_field": "/entity/1",        "value": "string"      }    ]  }'
{  "resource_id": "string",  "email": "user@example.com",  "phone": "string",  "company": "string",  "firstname": "string",  "lastname": "string",  "member": "/entity/1",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}