Skip to main content
POST
/
v1
/
customers
Enroll a customer
curl --request POST \
  --url https://api.mageloyalty.com/v1/customers \
  --header 'Authorization: <api-key>'
Enroll a customer in the loyalty program. If the customer is already enrolled, their existing record is returned with 200 OK instead. Only shopify_customer_id is required — the endpoint fetches the customer’s name, email, and account creation date directly from Shopify.

Side effects on first enrollment

  • Assigns the customer to the lowest VIP tier
  • Awards signup points if a signup earning rule is configured
  • Generates a referral link
  • Sets birthday metafields on the Shopify customer record

Request body

FieldTypeRequiredDescription
shopify_customer_idstringYesThe customer’s Shopify customer ID
{
  "shopify_customer_id": "6789012345"
}

Response

Returns 201 Created on successful enrollment, or 200 OK if the customer was already enrolled. The response shape matches the customer object.

Errors

StatusScenario
400shopify_customer_id missing or invalid JSON
404No Shopify customer found with that ID
503Unable to connect to Shopify