{
  "openapi": "3.0.0",
  "info": {
    "title": "Auth API",
    "description": "Obtain a JWT to use with the Mention Me APIs.",
    "termsOfService": "https://mention-me.com/help/tnc_f/site",
    "contact": {
      "name": "Mention Me",
      "url": "https://mention-me.com",
      "email": "support@mention-me.com"
    },
    "version": "v2"
  },
  "servers": [
    {
      "url": "https://mention-me.com",
      "description": "Production"
    },
    {
      "url": "https://demo.mention-me.com",
      "description": "Demo"
    }
  ],
  "paths": {
    "/api/oauth/token": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Get access token",
        "description": "Given a `client_id` and `client_secret`, this will return an `access_token` which can be used in the Authorization header of subsequent requests to the Merchant API.\n\nThe token provided will last for 3600 seconds (1 hour) and will need to be refreshed after this time.",
        "operationId": "post_merchant_api_oauth_token",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A response containing the `access_token` for you to use.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthOutput"
                }
              }
            }
          },
          "4XX": {
            "description": "An error has occurred retrieving an access token.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/RFC7807Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RequestAuthentication": {
        "required": [
          "partnerCode",
          "situation",
          "authenticationToken",
          "localeCode"
        ],
        "properties": {
          "partnerCode": {
            "description": "Your partner code, used to link to your users and offers",
            "type": "string",
            "example": "[YOUR-PARTNER-CODE]"
          },
          "situation": {
            "description": "Situation - a string representing where in the application you are making this request",
            "type": "string",
            "example": "mobile-app"
          },
          "segment": {
            "description": "Segment - the segment the customer belongs to",
            "type": "string",
            "example": "vip"
          },
          "localeCode": {
            "description": "Locale code - ISO standard locale code (e.g. en_GB) for the locale you expect the content to be in",
            "type": "string",
            "example": "en_GB"
          },
          "ipAddress": {
            "description": "IP address of the customer connection. If you're making a request on behalf of a customer, pass their IP address here. If the customer will connect directly, leave this empty and we will retrieve this from their request.",
            "type": "string",
            "example": "127.0.0.1"
          },
          "userDeviceIdentifier": {
            "description": "User Device Identifier should be a unique reference to this device. We use this for preventing gaming. Multiple users with the same Device Identifier will be treated as the same individual and may be flagged for gaming. On Android the UniqueID could be an InstanceID or GUID. On iPhone the UniqueID should be generated by identifierForVendor.",
            "type": "string",
            "example": ""
          },
          "deviceType": {
            "description": "Device type - your description of the device the user is using. We use this for performance and conversion optimisation.",
            "type": "string",
            "example": ""
          },
          "appName": {
            "description": "Your application name. Used for reporting.",
            "type": "string",
            "example": ""
          },
          "appVersion": {
            "description": "Your application version reference. Used for reporting and troubleshooting.",
            "type": "string",
            "example": "e.g. MyApp/v1.73"
          },
          "authenticationToken": {
            "description": "This is a signature using a salted hash of the email address of the customer with a secret key, and validates the authenticity of the request.\n\nFor information on how to correctly generate this token, please see the documentation: https://docs.mention-me.com/api-reference/entry-point-api/authentication-token",
            "type": "string",
            "example": ""
          }
        },
        "type": "object"
      },
      "Referee": {
        "properties": {
          "emailAddress": {
            "description": "Customer email address",
            "type": "string",
            "example": ""
          },
          "title": {
            "description": "Customer title such as Mr, Miss, Dr or Sir",
            "type": "string",
            "example": ""
          },
          "firstname": {
            "description": "Customer firstname",
            "type": "string",
            "example": ""
          },
          "surname": {
            "description": "Customer surname",
            "type": "string",
            "example": ""
          },
          "uniqueIdentifier": {
            "description": "Your unique identifier for this customer e.g. CustomerId",
            "type": "string",
            "example": ""
          }
        },
        "type": "object"
      },
      "RequestWithVariation": {
        "required": [
          "partnerCode",
          "situation",
          "localeCode"
        ],
        "properties": {
          "partnerCode": {
            "description": "Your partner code, used to link to your users and offers",
            "type": "string",
            "example": "[YOUR-PARTNER-CODE]"
          },
          "situation": {
            "description": "Situation - a string representing where in the application you are making this request",
            "type": "string",
            "example": "mobile-app"
          },
          "segment": {
            "description": "Segment - the segment the customer belongs to",
            "type": "string",
            "example": "vip"
          },
          "localeCode": {
            "description": "Locale code - ISO standard locale code (e.g. en_GB) for the locale you expect the content to be in",
            "type": "string",
            "example": "en_GB"
          },
          "ipAddress": {
            "description": "IP address of the customer connection. If you're making a request on behalf of a customer, pass their IP address here. If the customer will connect directly, leave this empty and we will retrieve this from their request.",
            "type": "string",
            "example": "127.0.0.1"
          },
          "userDeviceIdentifier": {
            "description": "User Device Identifier should be a unique reference to this device. We use this for preventing gaming. Multiple users with the same Device Identifier will be treated as the same individual and may be flagged for gaming. On Android the UniqueID could be an InstanceID or GUID. On iPhone the UniqueID should be generated by identifierForVendor.",
            "type": "string",
            "example": ""
          },
          "deviceType": {
            "description": "Device type - your description of the device the user is using. We use this for performance and conversion optimisation.",
            "type": "string",
            "example": ""
          },
          "appName": {
            "description": "Your application name. Used for reporting.",
            "type": "string",
            "example": ""
          },
          "appVersion": {
            "description": "Your application version reference. Used for reporting and troubleshooting.",
            "type": "string",
            "example": "e.g. MyApp/v1.73"
          },
          "variation": {
            "description": "Variation - an index (0,1,2...) specifying which of the currently running AB tests to choose (if available)",
            "type": "string",
            "example": ""
          }
        },
        "type": "object"
      },
      "Request": {
        "required": [
          "partnerCode",
          "situation",
          "localeCode"
        ],
        "properties": {
          "partnerCode": {
            "description": "Your partner code, used to link to your users and offers",
            "type": "string",
            "example": "[YOUR-PARTNER-CODE]"
          },
          "situation": {
            "description": "Situation - a string representing where in the application you are making this request",
            "type": "string",
            "example": "mobile-app"
          },
          "segment": {
            "description": "Segment - the segment the customer belongs to",
            "type": "string",
            "example": "vip"
          },
          "localeCode": {
            "description": "Locale code - ISO standard locale code (e.g. en_GB) for the locale you expect the content to be in",
            "type": "string",
            "example": "en_GB"
          },
          "ipAddress": {
            "description": "IP address of the customer connection. If you're making a request on behalf of a customer, pass their IP address here. If the customer will connect directly, leave this empty and we will retrieve this from their request.",
            "type": "string",
            "example": "127.0.0.1"
          },
          "userDeviceIdentifier": {
            "description": "User Device Identifier should be a unique reference to this device. We use this for preventing gaming. Multiple users with the same Device Identifier will be treated as the same individual and may be flagged for gaming. On Android the UniqueID could be an InstanceID or GUID. On iPhone the UniqueID should be generated by identifierForVendor.",
            "type": "string",
            "example": ""
          },
          "deviceType": {
            "description": "Device type - your description of the device the user is using. We use this for performance and conversion optimisation.",
            "type": "string",
            "example": ""
          },
          "appName": {
            "description": "Your application name. Used for reporting.",
            "type": "string",
            "example": ""
          },
          "appVersion": {
            "description": "Your application version reference. Used for reporting and troubleshooting.",
            "type": "string",
            "example": "e.g. MyApp/v1.73"
          }
        },
        "type": "object"
      },
      "OrderDetails": {
        "required": [
          "orderIdentifier",
          "total",
          "currencyCode",
          "dateString"
        ],
        "properties": {
          "orderIdentifier": {
            "description": "Your Order Identifier for the transaction that has taken place",
            "type": "string",
            "example": "123456"
          },
          "total": {
            "description": "Order subtotal, excluding tax and shipping in the currency specified by currencyCode",
            "type": "string",
            "example": "100"
          },
          "currencyCode": {
            "description": "3 letter currency code for the currency in which the transaction took place. Use the ISO4217 format (e.g. GBP, EUR, etc",
            "type": "string",
            "example": "GBP"
          },
          "dateString": {
            "description": "The date on which the transaction took place (typically the current date/time). Use ISO8601 format (e.g. 2016-11-30T17:52:50Z)",
            "type": "string",
            "example": "2026-01-01T12:00:00+00:00"
          },
          "couponCode": {
            "description": "If a coupon was used in the transaction, the coupon code the consumer used. If multiple coupons were used, pass them as a comma separated list. Leave blank if no coupon was used.",
            "type": "string",
            "example": "ABC23252"
          },
          "discountAmount": {
            "description": "The discount amount. Our assumption is this has already been taken off the order subtotal provided. This allows us to calculate the Cost Per Acquisition for referral.",
            "type": "string",
            "example": "12.44"
          },
          "orderItemCount": {
            "description": "The number of items in the order/cart (if applicable). This helps us understand the type of purchase and can be a signal of advocacy.",
            "type": "string",
            "example": "3"
          },
          "isSubscription": {
            "description": "Whether this order is for a subscription (recurring). This helps us qualify and categorise the revenue.",
            "type": "boolean",
            "example": ""
          },
          "isGift": {
            "description": "Whether this order is a gift (being bought for someone else). Gifts can be signals of advocacy.",
            "type": "boolean",
            "example": ""
          }
        },
        "type": "object"
      },
      "ImplementationDetails": {
        "properties": {
          "wrapContentWithBranding": {
            "description": "If true (default), serve content in the URLs with customisable branding wrapper (normally a logo and padding). If false, serve content without any wrapping. ",
            "type": "boolean",
            "example": true
          },
          "showCloseIcon": {
            "description": "If true (and the page is rendered inside an iframe), Mention Me will include a close icon. A user clicking on the close icon will trigger a postMessage event which can be listened to for closing the iframe. Documentation is available at https://docs.mention-me.com/api-reference/entry-point-api/postmessage",
            "type": "boolean",
            "example": false
          }
        },
        "type": "object"
      },
      "CustomerEnrolling": {
        "required": [
          "emailAddress",
          "firstname",
          "surname"
        ],
        "properties": {
          "emailAddress": {
            "description": "Customer email address",
            "type": "string",
            "example": "jane.doe@example.com"
          },
          "title": {
            "description": "Customer title such as Mr, Miss, Dr or Sir",
            "type": "string",
            "example": ""
          },
          "firstname": {
            "description": "Customer firstname",
            "type": "string",
            "example": ""
          },
          "surname": {
            "description": "Customer surname",
            "type": "string",
            "example": ""
          },
          "uniqueIdentifier": {
            "description": "Your unique identifier for this customer e.g. CustomerId",
            "type": "string",
            "example": ""
          },
          "segment": {
            "description": "Customer segment - a string containing segment data about this customer, e.g. vip or employee. You can concatenate multiple segments together if you wish using hyphens.",
            "type": "string",
            "example": ""
          },
          "customField": {
            "description": "Custom field - a string containing custom data about this customer, e.g. SEGMENT001 or Package B",
            "type": "string",
            "example": ""
          },
          "visitorId": {
            "description": "The visitor ID from the MentionMe Browser Fingerprint, used to link customer journeys. This should be a SHA256 hash (browserId + clientIP).",
            "type": "string",
            "example": ""
          },
          "hasEngaged": {
            "description": "Has this customer been informed of their privacy rights, and actively engaged in the offer? Mention Me expects you to set this as false when you first show the offer, and true when someone has actively engaged, e.g. after clicking a call to action. If no value is provided, we will use the default defined on the offer.",
            "type": "boolean",
            "example": false
          }
        },
        "type": "object"
      },
      "CustomerDetails": {
        "required": [
          "emailAddress",
          "firstname",
          "surname"
        ],
        "properties": {
          "emailAddress": {
            "description": "Customer email address",
            "type": "string",
            "example": "jane.doe@example.com"
          },
          "title": {
            "description": "Customer title such as Mr, Miss, Dr or Sir",
            "type": "string",
            "example": ""
          },
          "firstname": {
            "description": "Customer firstname",
            "type": "string",
            "example": ""
          },
          "surname": {
            "description": "Customer surname",
            "type": "string",
            "example": ""
          },
          "uniqueIdentifier": {
            "description": "Your unique identifier for this customer e.g. CustomerId",
            "type": "string",
            "example": ""
          },
          "segment": {
            "description": "Customer segment - a string containing segment data about this customer, e.g. vip or employee. You can concatenate multiple segments together if you wish using hyphens.",
            "type": "string",
            "example": ""
          },
          "customField": {
            "description": "Custom field - a string containing custom data about this customer, e.g. SEGMENT001 or Package B",
            "type": "string",
            "example": ""
          },
          "visitorId": {
            "description": "The visitor ID from the MentionMe Browser Fingerprint, used to link customer journeys. This should be a SHA256 hash (browserId + clientIP).",
            "type": "string",
            "example": ""
          }
        },
        "type": "object"
      },
      "Address": {
        "properties": {
          "addressLine1": {
            "description": "First line of address",
            "type": "string",
            "example": ""
          },
          "addressLine2": {
            "description": "Second line of address",
            "type": "string",
            "example": ""
          },
          "addressCity": {
            "description": "City part of address",
            "type": "string",
            "example": ""
          },
          "addressCounty": {
            "description": "County or state part of address",
            "type": "string",
            "example": ""
          },
          "addressPostCode": {
            "description": "Post or ZIP code",
            "type": "string",
            "example": ""
          },
          "addressCountry": {
            "description": "Country of address",
            "type": "string",
            "example": ""
          }
        },
        "type": "object"
      },
      "AddressWithCountry": {
        "properties": {
          "addressCountry": {
            "description": "Country of address e.g. UK or France",
            "type": "string",
            "example": ""
          }
        },
        "type": "object"
      },
      "AuthInput": {
        "required": [
          "client_id",
          "client_secret",
          "grant_type"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "client_secret": {
            "type": "string"
          },
          "grant_type": {
            "type": "string",
            "enum": [
              "client_credentials"
            ]
          }
        },
        "type": "object"
      },
      "AuthOutput": {
        "properties": {
          "access_token": {
            "type": "string"
          },
          "expires_in": {
            "type": "string"
          },
          "token_type": {
            "type": "string",
            "enum": [
              "bearer"
            ]
          }
        },
        "type": "object"
      },
      "RFC7807Problem": {
        "properties": {
          "status": {
            "type": "integer",
            "maximum": 599,
            "minimum": 200
          },
          "type": {
            "type": "string",
            "example": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        },
        "type": "object"
      }
    }
  },
  "tags": [
    {
      "name": "Auth"
    }
  ]
}