def METHOD_NAME(self, transfer_id):
    """
    Fetch Apple ID for a given transfer ID from Apple API.
    """
    migration_url = "https://appleid.apple.com/auth/usermigrationinfo"
    app_id = "org.edx.mobile"
    headers = {
        "Content-Type": "application/x-www-form-urlencoded",
        "Host": "appleid.apple.com",
        "Authorization": "Bearer " + self.access_token
    }
    payload = {
        "client_id": app_id,
        "client_secret": self.client_secret,
        "transfer_sub": transfer_id
    }
    response = requests.post(migration_url, data=payload, headers=headers)
    if response.status_code == 400:
        error = response.json().get('error')
        if error in [INVALID_GRANT_ERROR, INVALID_CLIENT_ERROR]:
            log.info("Error while fetching apple_id for transfer_id %s. Error: %s", transfer_id, error)
            raise AccessTokenExpiredException
        log.info("Request error while fetching apple_id for transfer_id %s. Error: %s "
                 "\nPayload: %s \nHeaders: %s", transfer_id, error, str(payload), str(headers))
        raise BadRequestException
    return response.json().get('sub')