Skip to main content

Migration API

The migration API allows the addition of customers to any mango arbitrarily the behaviour of the api is same as the add customer option on the customers page in the TagMango dashboard. The api can be called as follows:

curl --location 'https://api-prod-new.tagmango.com/integration/action/migrate-user' \
--header 'x-api-key: <Your API Key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "John Doe",
"email": "john@example.com",
"phone": 1900118822,
"mangoId": "66d0493aa0d85045eefbea89",
"coupon": "WOW",
"validityDays": 30,
"validUntil": "31/12/2024"
}'

Explanation of the API parameters

  • name → Name of the customer being added
  • email → Email of the customer being added
  • phone → The phone number of the customer being added
  • mangoId → The id of the mango/service the user is being added to, this id can be found by going to Dashboard > Services (or whatever your platform's synonym for mango/service is)
  • coupon (optional) → If provided must be a 100% discount coupon code which will be used to simulate the purchase flow to add the user if not provided a random ephermal coupon code is used.
  • validityDays (optional) → Number of days from the current date for which the subscription will be valid. Must be a positive integer (>= 1) and cannot be a decimal number. Cannot be negative. If both validityDays and validUntil are provided, validUntil takes precedence.
  • validUntil (optional) → The expiry date for the subscription in DD/MM/YYYY or DD-MM-YYYY format. The date must be valid and cannot be in the past. If both validUntil and validityDays are provided, validUntil takes precedence.